New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

porkbun-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

porkbun-cli

CLI for Porkbun — manage domains, DNS, SSL and more from the terminal

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
3
-40%
Maintainers
1
Weekly downloads
 
Created
Source

Porkbun CLI

CLI for Porkbun — manage domains, DNS, SSL and more from the terminal.

JSON output by default, ideal for AI agents and automation.

Features

  • Domains — list, check availability, register, nameservers, auto-renew
  • DNS — create, edit, delete, retrieve records (A, AAAA, CNAME, MX, TXT, NS, SRV, CAA, etc.)
  • DNSSEC — manage DS records
  • SSL — retrieve certificate bundles
  • URL Forwarding — add, list, delete forwards
  • Glue Records — create, update, delete
  • Multi-format — output as JSON (default), table or CSV via --format
  • Dry-run — preview any write operation before executing
  • Automatic retry — retry with backoff on 429/5xx errors

Installation

Via npm

npm install -g porkbun-cli

From source

git clone https://github.com/yabbal/porkbun.git
cd porkbun
pnpm install
pnpm build
pnpm link --global

Verify the installation:

porkbun --help

Configuration

API keys

Get your API keys from porkbun.com/account/api.

Set them as environment variables:

export PORKBUN_API_KEY=pk1_xxxxx
export PORKBUN_API_SECRET=sk1_xxxxx

Or create a .env file in the working directory:

PORKBUN_API_KEY=pk1_xxxxx
PORKBUN_API_SECRET=sk1_xxxxx

Test your credentials:

porkbun ping

Usage

Ping (test authentication)

porkbun ping

Pricing

porkbun pricing                        # All TLD pricing
porkbun pricing --tld com              # Specific TLD
porkbun pricing --tld dev --format table

Domains

porkbun domain list                    # List all domains
porkbun domain list --format table     # Table format
porkbun domain check example.com       # Check availability
porkbun domain create example.com --cost 1108  # Register (cost in cents)

Name servers

porkbun domain ns get example.com
porkbun domain ns update example.com --ns "ns1.dns.com,ns2.dns.com"

Auto-renew

porkbun domain auto-renew example.com --status on
porkbun domain auto-renew example.com --status off

URL forwarding

porkbun domain forward list example.com
porkbun domain forward add example.com --location "https://target.com" --type permanent
porkbun domain forward delete example.com --id 12345

Glue records

porkbun domain glue list example.com
porkbun domain glue create example.com --subdomain ns1 --ips "1.2.3.4,5.6.7.8"
porkbun domain glue update example.com --subdomain ns1 --ips "9.10.11.12"
porkbun domain glue delete example.com --subdomain ns1

DNS records

# List
porkbun dns list example.com
porkbun dns list example.com --type A
porkbun dns list example.com --format table

# Create
porkbun dns create example.com --type A --content 1.2.3.4
porkbun dns create example.com --type A --content 1.2.3.4 --name www --ttl 3600
porkbun dns create example.com --type MX --content mail.example.com --prio 10

# Edit
porkbun dns edit example.com --id 12345 --type A --content 5.6.7.8
porkbun dns edit-by-name-type example.com --type A --subdomain www --content 5.6.7.8

# Delete
porkbun dns delete example.com --id 12345
porkbun dns delete-by-name-type example.com --type A --subdomain www

DNSSEC

porkbun dnssec list example.com
porkbun dnssec create example.com --key-tag 12345 --alg 13 --digest-type 2 --digest abc123
porkbun dnssec delete example.com --key-tag 12345

SSL

porkbun ssl example.com

Output formats

All commands support --format:

porkbun domain list --format json     # JSON (default)
porkbun domain list --format table    # ASCII table
porkbun domain list --format csv      # CSV
porkbun dns list example.com --format csv > records.csv

Dry-run

All write commands support --dry-run:

porkbun dns create example.com --type A --content 1.2.3.4 --dry-run

Pipe with jq

JSON output combines naturally with jq:

# Domain names
porkbun domain list | jq '.[].domain'

# A records only
porkbun dns list example.com | jq '[.[] | select(.type == "A")]'

# Check availability
porkbun domain check example.com | jq '.response.avail'

# Pricing for .com
porkbun pricing | jq '.pricing.com'

Environment variables

VariableDescription
PORKBUN_API_KEYPorkbun API key (required)
PORKBUN_API_SECRETPorkbun API secret key (required)

Claude Code Skill

This CLI is designed to be used as a Claude Code skill. The agent can manage your Porkbun domains directly from a conversation:

  • Structured JSON output, easily parseable by AI
  • All commands are non-interactive
  • Combinable with jq for complex analysis

Tech stack

ToolRole
TypeScriptLanguage
cittyCLI framework
cli-table3Table rendering
tsupBuild
BiomeLinter & formatter

License

MIT — yabbal

Keywords

porkbun

FAQs

Package last updated on 17 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts