# Porkbun CLI

> Manage Porkbun via CLI - general, domains, dns, forwards, ssl. Use when user mentions 'porkbun', 'domain', 'dns records', 'domain registrar', or 'ssl certificate'.

- Skill: `melvynx/porkbun-cli` (Agent Skill)
- Install (CLI): `npx skillmds@latest add melvynx/porkbun-cli`
- Raw SKILL.md: https://api.skillmd.com/api/skills/melvynx/porkbun-cli/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: melvynx (https://skillmd.com/u/melvynx)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/melvynx/porkbun-cli

---


# porkbun-cli

## Setup

If `porkbun-cli` is not found, install and build it:
```bash
bun --version || curl -fsSL https://bun.sh/install | bash
npx api2cli bundle porkbun
npx api2cli link porkbun
```

`api2cli link` adds `~/.local/bin` to PATH automatically. The CLI is available in the next command.

Always use `--json` flag when calling commands programmatically.

## Authentication

```bash
porkbun-cli auth set "your-token"
porkbun-cli auth test
```

## Resources

### general

| Command | Description |
|---------|-------------|
| `porkbun-cli general ping --json` | Test API connection and get your IP |
| `porkbun-cli general pricing --json` | Get domain pricing for all TLDs |

### domains

| Command | Description |
|---------|-------------|
| `porkbun-cli domains list --json` | List all domains in account |
| `porkbun-cli domains list --fields domain,status --json` | List domains with specific fields |
| `porkbun-cli domains check example.com --json` | Check domain availability |
| `porkbun-cli domains nameservers example.com --json` | Get nameservers for a domain |
| `porkbun-cli domains update-ns example.com --ns ns1.porkbun.com,ns2.porkbun.com --json` | Update nameservers |
| `porkbun-cli domains auto-renew example.com --status on --json` | Enable auto-renew |
| `porkbun-cli domains auto-renew example.com --status off --json` | Disable auto-renew |

### dns

| Command | Description |
|---------|-------------|
| `porkbun-cli dns list example.com --json` | List all DNS records |
| `porkbun-cli dns list example.com --fields name,type,content --json` | List DNS records with specific fields |
| `porkbun-cli dns get example.com 12345 --json` | Get specific DNS record by ID |
| `porkbun-cli dns create example.com --type A --content 1.1.1.1 --json` | Create A record |
| `porkbun-cli dns create example.com --type A --name www --content 1.1.1.1 --ttl 300 --json` | Create A record with subdomain and TTL |
| `porkbun-cli dns create example.com --type MX --content mail.example.com --prio 10 --json` | Create MX record with priority |
| `porkbun-cli dns edit example.com 12345 --type A --content 2.2.2.2 --json` | Edit DNS record |
| `porkbun-cli dns edit example.com 12345 --type MX --content mail2.example.com --prio 20 --json` | Edit MX record with priority |
| `porkbun-cli dns delete example.com 12345 --json` | Delete DNS record |
| `porkbun-cli dns get-by-type example.com A --json` | Get all A records |
| `porkbun-cli dns get-by-type example.com A www --json` | Get A records for subdomain |
| `porkbun-cli dns edit-by-type example.com A www --content 2.2.2.2 --json` | Edit DNS record by type/subdomain |
| `porkbun-cli dns delete-by-type example.com A --json` | Delete all A records |
| `porkbun-cli dns delete-by-type example.com A www --json` | Delete A records for subdomain |

### forwards

| Command | Description |
|---------|-------------|
| `porkbun-cli forwards list example.com --json` | List all URL forwards |
| `porkbun-cli forwards list example.com --fields subdomain,location --json` | List forwards with specific fields |
| `porkbun-cli forwards add example.com --subdomain www --location "https://example.com" --type permanent --json` | Add permanent URL forward |
| `porkbun-cli forwards add example.com --subdomain blog --location "https://blog.example.com" --include-path --json` | Add forward with path inclusion |
| `porkbun-cli forwards add example.com --subdomain "*" --location "https://example.com" --wildcard --json` | Add wildcard forward |
| `porkbun-cli forwards delete example.com 12345 --json` | Delete URL forward |

### ssl

| Command | Description |
|---------|-------------|
| `porkbun-cli ssl retrieve example.com --json` | Get SSL certificate bundle |

## Global Flags

All commands support: `--json`, `--format <text|json|csv|yaml>`, `--verbose`, `--no-color`, `--no-header`

