Install
$ npx api2cli install Melvynx/porkbun-cliDetails
README
porkbun-cli
CLI for the Porkbun API - domain registrar and DNS management. Made with api2cli.dev.
Install
npx api2cli install Melvynx/porkbun-cli
This clones the repo, builds the CLI, links it to your PATH, and installs the AgentSkill to your coding agents.
Install AgentSkill only
npx skills add Melvynx/porkbun-cli
Auth
# Save credentials (format: apikey:secretapikey)
porkbun-cli auth set pk1_abc123:sk1_xyz789
# Show saved token (masked)
porkbun-cli auth show
porkbun-cli auth show --raw
# Verify credentials
porkbun-cli auth test
# Remove saved token
porkbun-cli auth remove
General
# Test API connection and get your IP
porkbun-cli general ping
# Get domain pricing for all TLDs (no auth needed)
porkbun-cli general pricing
Domains
# List all domains in account
porkbun-cli domains list
porkbun-cli domains list --fields domain,expireDate
# Check domain availability
porkbun-cli domains check coolsite.dev
# Get nameservers
porkbun-cli domains nameservers example.com
# Update nameservers
porkbun-cli domains update-ns example.com --ns ns1.porkbun.com,ns2.porkbun.com
# Set auto-renew on or off
porkbun-cli domains auto-renew example.com --status on
porkbun-cli domains auto-renew example.com --status off
DNS
# List all DNS records
porkbun-cli dns list example.com
# Get a specific record by ID
porkbun-cli dns get example.com 12345
# Create records
porkbun-cli dns create example.com --type A --content 1.1.1.1
porkbun-cli dns create example.com --type A --name www --content 1.1.1.1 --ttl 300
porkbun-cli dns create example.com --type MX --content mail.example.com --prio 10
# Edit a record by ID
porkbun-cli dns edit example.com 12345 --type A --content 2.2.2.2
# Delete a record by ID
porkbun-cli dns delete example.com 12345
# Get records by type (and optional subdomain)
porkbun-cli dns get-by-type example.com A
porkbun-cli dns get-by-type example.com A www
# Edit records by type (and optional subdomain)
porkbun-cli dns edit-by-type example.com A www --content 2.2.2.2
# Delete records by type (and optional subdomain)
porkbun-cli dns delete-by-type example.com A www
URL Forwarding
# List forwards
porkbun-cli forwards list example.com
# Add a forward
porkbun-cli forwards add example.com --subdomain www --location "https://example.com" --type permanent
porkbun-cli forwards add example.com --subdomain "" --location "https://other.com" --include-path --wildcard
# Delete a forward
porkbun-cli forwards delete example.com 12345
SSL
# Retrieve SSL certificate bundle
porkbun-cli ssl retrieve example.com
Global Flags
All commands support: --json, --format <text|json|csv|yaml>, --verbose, --no-color, --no-header
