cfreg

A tiny, scriptable CLI wrapper around the Cloudflare Registrar REST API. Single file, Python 3 stdlib only (no dependencies), JSON output, and no interactive prompts — every input is a flag or argument, so it drops straight into scripts and pipes into jq.

Why not the official cf CLI? As of v0.0.5 its registrar surface is only domains {get,list,update} — no search, check, or register — and its OAuth token isn’t accepted for raw API calls. So cfreg talks to the API directly with a dedicated Registrar-scoped token.

Commands

1cfreg search <query> [--ext com,dev,app] [--limit 20]   # suggestions
2cfreg check <domain> [<domain>...]                       # real-time availability (≤20)
3cfreg list                                               # your registrations
4cfreg get <domain>                                       # one registration's state
5cfreg register <domain> [--years N] [--auto-renew] --yes # BILLABLE
6cfreg update <domain> [--auto-renew] [--lock] [--privacy]
7cfreg status <domain>                                    # poll a workflow
1cfreg check arcadevault.dev mybrand.com -c | jq '.result.domains'

Safety

  • register is the only billable, non-refundable call. It refuses to run without --yes — a required flag, not a prompt — so scripts opt in explicitly and a stray re-run can’t accidentally buy a domain.
  • auto_renew defaults to false; it’s only set when you ask.
  • Credentials come from --token / --account flags or CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID environment variables. Clean, scriptable exit codes (0 success, 1 API error, 2 usage error, 3 network error).