Namecheap CLI v0.2.0
Python 3.11+ · Zero Dependencies · MIT

Namecheap DNS.
Guarded for agents.

Inspect zones, preview record diffs, apply state-hash guarded writes with automatic local backups, and verify live public DNS propagation from one deterministic JSON CLI.

Dry-run by default --if-match SHA-256 0600 zone backups Cloudflare DoH check Agent Skill included
PREVIEW → APPLY → VERIFY
# 1. Dry-run preview (never mutates DNS)
$ namecheap dns set example.com @ A 203.0.113.10
{
  "schema_version": 1,
  "ok": true,
  "command": "dns set",
  "data": {
    "dry_run": true,
    "changed": true,
    "state_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
  }
}

# 2. Apply with optimistic concurrency & check live DoH
$ namecheap dns set example.com @ A 203.0.113.10 --yes --if-match 9f86d0...
$ namecheap dns check example.com --host @ --type A
Every mutation requires --yes and the preview's --if-match hash.
Installs the standalone namecheap command in an isolated uv environment.
uv tool install 'git+https://github.com/R-Varun/namecheap-cli'
Built for whole-zone replacement safety

Namecheap's API overwrites every host record at once.
This CLI makes every write safe to automate.

01 / DETERMINISTIC JSON

Self-describing contract

Every command emits one versioned JSON document on stdout—including invalid flags and provider errors. Run namecheap schema for full command discovery and error semantics.

02 / GUARDED TRANSACTIONS

State hashes & local locks

Writes hold an account/domain lock, validate your preview's SHA-256 state hash, re-read before submission, preserve email routing metadata, and verify every record and TTL afterward.

03 / RECOVERY & LIVE DOH

Backups & propagation checks

A 0600 backup and journal entry are written before any submission. Restore with namecheap restore, and confirm public resolution via namecheap dns check.

Why a dedicated CLI

No MCP server overhead. No unguarded XML scripts.

Capability Namecheap CLI Ad-hoc XML API scripts Always-on MCP servers
Whole-zone clobber protection Preview diff + --if-match hash + post-write verify Easy to wipe existing MX/TXT records Varies; rarely optimistic-locked
Context window cost Zero idle tokens; on-demand namecheap schema Requires reading custom code Tool schemas loaded every turn
Pre-write backup & rollback Automatic 0600 snapshot + namecheap restore Manual Manual
Runtime dependencies Zero (Python 3.11+ stdlib only) requests / lxml / dotenv Node / Python server runtime
Agent-ready out of the box

Drop into Claude Code, Codex, Cursor, or CI.

Ships with a portable SKILL.md, machine-readable schema.json, llms.txt, stdin zone piping (dns apply example.com -), domain allowlists, and strict production/sandbox credential isolation.

  • BasicDNS Manage A, AAAA, ALIAS, CNAME, MX, MXE, NS, TXT, and URL/URL301/FRAME records.
  • Delegation Inspect and switch between Namecheap BasicDNS and custom nameservers with backup protection.
  • Live DoH Compare Namecheap's stored zone against Cloudflare public DNS-over-HTTPS via dns check.
  • Bounded scope Blocks writes when unknown email modes or unsupported dashboard settings appear—never buys or transfers domains.