The command-line interface for name.com
Register domains, manage DNS, and run your entire domain portfolio — without leaving the terminal.
Recorded against the sandbox API with vhs — see docs/demo.tape for the script.
And namecom status, for the portfolio at a glance — illustrated below with a
representative account rather than a real one:
$ namecom status
Profile default https://api.name.com
47 domains 3 expiring within 30 days 1 transfer pending 2 unlocked
Balance $125.40
Expiring soon
acme.io 2026-10-18 (16 days)
staging.dev 2026-10-25 (23 days)
oldsite.net 2026-10-30 (28 days)
Transfers in progress
newco.com
→ Run 'namecom domain renew <domain>' to renew expiring domains
→ Run 'namecom domain list' to see all domains
namecom status -q prints just the expired and soon-expiring domains, one per
line, ready for xargs.
- Why
- Installation
- Quick start
- Commands
- Workflows
- Output formats
- JSON contract
- Configuration
- Shell completion
- Global flags
- Exit codes
- Idempotency keys
- Development
- Contributing
- Changelog
- Security policy
- License
The name.com web UI is great for humans. The CLI is for agents and terminal wizards.
- Automate domain renewals, DNS changes, and email forwards in CI/CD pipelines
- Script bulk operations across dozens of domains at once
- Integrate with secret managers via
token_cmd— no credentials in shell history - Pipe JSON output directly into
jq,grep, and other tools - Stay fast — tab completion,
--dry-run, and--yesflags for confident automation
Homebrew (macOS / Linux):
brew tap patramsey/tap
brew trust patramsey/tap
brew install namecomUpgrading from v0.2.4 - v0.3.1? Those versions shipped as a Homebrew cask; this is a formula again.
brew updatemigrates you automatically but cannot finish the job, because Homebrew will not link a formula while a cask of the same name is installed. Two steps remain:brew uninstall --cask --force namecom brew link namecomWithout the second,
namecomwill not be on your PATH. Fresh installs need neither.
Download a release binary:
# namecom_darwin_arm64.tar.gz (Apple Silicon), namecom_darwin_amd64.tar.gz (Intel Mac),
# namecom_linux_amd64.tar.gz or namecom_linux_arm64.tar.gz
ARCHIVE=namecom_darwin_arm64.tar.gz
BASE=https://github.com/patramsey/namecom-cli/releases/latest/download
curl -fLO "$BASE/$ARCHIVE"
curl -fLO "$BASE/checksums.txt"
grep " $ARCHIVE\$" checksums.txt | shasum -a 256 -c # must print "OK"
tar xzf "$ARCHIVE"
sudo mv namecom /usr/local/bin/All platforms and checksums on the releases page.
The checksum catches a corrupted download. To check that an archive was built by this repository's release workflow from a tagged commit, verify its build provenance with the GitHub CLI (releases after v0.5.4):
gh attestation verify "$ARCHIVE" --repo patramsey/namecom-climacOS: these binaries are not signed with an Apple Developer ID. The commands above are unaffected —
curldoes not set the quarantine attribute — but a tarball downloaded through a browser is quarantined, and macOS will refuse to run it with "Apple could not verify 'namecom' is free of malware." Clear it withxattr -d com.apple.quarantine namecom, or approve the binary under System Settings → Privacy & Security. Homebrew installs are unaffected.
Go install:
go install github.com/patramsey/namecom-cli@latest
mv "$(go env GOPATH)/bin/namecom-cli" "$(go env GOPATH)/bin/namecom"go install names the binary after the module path (namecom-cli); the mv renames it to namecom to match the rest of this README.
# 1. Authenticate (create an API token at https://www.name.com/account/settings/api)
namecom auth login
# 2. See your portfolio at a glance
namecom status
# 3. Check if a domain is available
namecom domain check mycoolstartup.com
# 4. Register it
namecom domain register mycoolstartup.com
# 5. Point it somewhere
namecom dns create mycoolstartup.com --type A --answer 1.2.3.4
# Tip: jump to the name.com dashboard for any domain
namecom open mycoolstartup.com| Group | Commands |
|---|---|
domain |
list get search check register renew lock autorenew privacy set-ns contacts auth-code pricing update claims requirements |
dns |
list create update delete export import sync |
dnssec |
list get create delete |
transfer |
list get create cancel eligibility internal-in cancel-outbound |
email |
list get create update delete |
url |
list get create update delete |
vanity-ns |
list get create update delete |
contact |
unverified resend verify — ICANN contact verification |
auth |
login logout status |
status |
account overview: domain counts, expiring domains, pending transfers, balance |
order |
list get refund |
config |
list-profiles (alias profiles) use show |
api |
raw HTTP passthrough with auth applied |
open |
open name.com in a browser (honors $BROWSER; prints the URL when no browser can be opened) |
version |
version and build information |
completion |
shell completion scripts: bash zsh fish powershell |
Every list also answers to ls and every delete to rm. In dns,
dnssec, email, url and vanity-ns, create also answers to add.
namecom --help
namecom domain --help
namecom dns --help
Register a domain and set it up:
namecom domain check acme.io # check availability
namecom domain register acme.io # register it
namecom dns create acme.io --type A --answer 1.2.3.4
namecom dns create acme.io --type MX --answer mail.google.com --priority 10
namecom email create acme.io hello --to you@gmail.com # hello@acme.io → you@gmail.com
namecom domain autorenew on acme.io # never let it expireManage DNS records:
namecom dns list acme.io
namecom dns create acme.io --type CNAME --host www --answer acme.io.
namecom dns update acme.io 12345 --answer 5.6.7.8
namecom dns export acme.io --zone > acme.io.zone # export as BIND zone file
namecom dns list acme.io --host www # only the records at wwwKeep DNS in a file and sync it (re-runnable: a second run changes nothing):
namecom dns export acme.io --zone > acme.io.zone # 1. snapshot the live zone
$EDITOR acme.io.zone # 2. edit it, or keep it in git
namecom dns sync acme.io --file acme.io.zone --dry-run # 3. see the plan; nothing is sent
namecom dns sync acme.io --file acme.io.zone # 4. apply it, after a confirmation
namecom dns sync acme.io --file acme.io.zone --prune # ...also deleting what the file dropped- Records match on host, type and answer. A new TTL or priority is an update; a new answer is a new record (a CNAME's target is updated in place).
- Nothing is deleted without
--prune. Even then, apex NS records and CAA records are kept unless you pass--prune-all. Either flag refuses an empty file, so a wrong path cannot wipe the zone. - If a change fails, sync stops and reports what it applied. Fix the cause and run it again.
- The file can be a BIND zone or the JSON
dns exportwrites. In CI,--dry-run -o jsonprints the plan, and--yesskips the confirmation.
For scripts that add or remove single records, dns create --if-not-exists,
dns delete --if-exists and dns import --skip-existing succeed when the
work is already done, so a retry does not fail. url create --if-not-exists
and url delete --if-exists do the same for URL forwarding.
Transfer a domain in:
namecom transfer eligibility acme.io # confirm it's eligible
namecom transfer create acme.io --auth-code XXXXXX
namecom transfer get acme.io # check status
# set WHOIS contacts on arrival (same JSON as domain register --contacts-file);
# changing contacts may start a registrar transfer lock
namecom transfer create acme.io --auth-code XXXXXX --contacts-file contacts.jsonSet up email forwarding and URL forwarding:
namecom email create acme.io hello --to you@gmail.com # hello@acme.io → you@gmail.com
namecom email list acme.io
namecom url create acme.io --to https://new-site.com --if-not-exists # redirect apex; safe to re-runPublish DNSSEC DS records (values from your DNS host, which signs the zone):
namecom dnssec list acme.io
namecom dnssec create acme.io --algorithm 13 --digest-type 2 --key-tag 12345 --digest 187A3A5B12591918A105DCF4E78C182C2FDA3D108D53526AE8117139748F21D3Set up vanity nameservers:
namecom vanity-ns create acme.io --hostname ns1.acme.io --ips 1.2.3.4
namecom vanity-ns create acme.io --hostname ns2.acme.io --ips 5.6.7.8
namecom domain set-ns acme.io --ns ns1.acme.io,ns2.acme.ioCall an endpoint namecom does not wrap (namecom api, modelled on gh api):
namecom api /core/v1/domains/acme.io # the method defaults to GET
namecom api /core/v1/domains --paginate --jq '.domains[].domainName' # every page as one list
namecom api POST /core/v1/domains/acme.io/records -f host=www -f type=A -f answer=1.2.3.4 -F ttl=300 --dry-run
namecom api PUT /core/v1/domains/acme.io/records/123 --input record.json --yes # in a script, a write needs --yes
namecom api -X DELETE /core/v1/domains/acme.io/records/123 --dry-run
namecom api /core/v1/hello --include # status line and headers, then the body
namecom api /core/v1/domains -i --jq '.totalCount' # headers as they came, then the filtered body- The method is GET, or POST when you pass a body (
-f,-F,--data,--input). Name it to send anything else. -f key=valuesends a string;-Fkeeps numbers andtrue/false/nullas JSON, and reads@file. With-X GETthey are query parameters.--paginatefetches every page, 1000 items at a time, and prints them as one document. It stops at 100 pages unless you raise--max-pages.- Anything but GET or HEAD is a write, and confirms like any other: pass
--yesin a script, or--dry-runto see the request first. - The response body prints exactly as the API sent it.
namecom api --help has the full rules.
Scripting and automation:
# List every domain expiring within 60 days (BSD/macOS date, then GNU date)
namecom domain list --all --expiring-before "$(date -v+60d +%F 2>/dev/null || date -d '+60 days' +%F)" -q
# Bulk-create an A record across all domains
namecom domain list --all -q | xargs -I{} namecom dns create {} --type A --answer 1.2.3.4
# '-' reads names from stdin, one per line (blank lines and # comments skipped)
namecom domain check - < names.txt
namecom domain list --all -q | namecom domain autorenew on - --yes # one process, paced as a whole
# Dry-run first, then apply
namecom dns create acme.io --type TXT --answer "v=spf1 include:sendgrid.net ~all" --dry-run
namecom dns create acme.io --type TXT --answer "v=spf1 include:sendgrid.net ~all" --yes
# Capture the new record's ID
ID=$(namecom dns create acme.io --type A --host api --answer 1.2.3.4 -q)
namecom dns delete acme.io "$ID" --yesRate limit. namecom paces itself to 10 requests a second (bursts of 5)
and retries a 429 with backoff, which leaves headroom under the API's limit
of 20 a second for the account. The limiter is per process: xargs -P 8
runs eight processes with eight limiters, which together send up to 80
requests a second, so the excess comes back as 429s and, once retries run
out, exit code 5. Prefer one process with many arguments, which is paced as
a whole:
namecom domain list --all -q | namecom domain check - # not xargs -P
namecom dns delete acme.io $(namecom dns list acme.io --type TXT -q) --yesFor commands that take one domain, run xargs without -P (one process
at a time); -P 2 already reaches the account's limit, and anything else
using the same account shares it.
Confirmations. Writes that are hard to undo ask first when run in a terminal:
- deletes:
dns delete,email delete,url delete,vanity-ns delete,dnssec delete - anything that charges, refunds or moves a domain:
domain register,domain renew,transfer create,transfer internal-in,transfer cancel,transfer cancel-outbound,order refund domain set-ns,domain contacts set,domain lock off,domain privacy off,domain autorenew onandoff, anddomain updatemaking any of those three changesdns syncwith changes to apply,auth loginreplacing a saved profile, andnamecom apiwith any method but GET and HEAD
In a script or a pipe there is no one to ask, so these exit 2
(confirmation_required) until you pass --yes. The rest — the other
creates and updates, dns import, domain lock on, domain privacy on, contact resend/verify, auth logout, config use — run without asking. Any
write can be previewed with --dry-run.
Paging. A list prints one page: 1 to 1000 items with --limit (the
API's page size without it) from --page, filtered or not, and its footer —
or nextPage in JSON — says when there are more. --all fetches every page,
1000 items a request, and so does -q without --page or --limit.
Every command supports --output table, --output json, --output yaml
and --output tsv, except dns export, which writes a file: JSON, YAML or
a zone file. The default is table in a terminal and json when output is
piped or redirected:
namecom domain list # rich table with colors and expiry urgency
namecom domain list --output json # machine-readable JSON
namecom domain list --output tsv # the table's columns, tab-separated
namecom domain list --quiet # one domain per line, for scriptingnamecom help formatting covers everything in this section, with examples.
--fields a,b,c keeps only those keys — the JSON keys -o json shows — of
each list item, or of the object a command prints, in that order. A list
keeps its {"data": [...]} envelope, so nextPage and total are still
there. It works with every -o, in the TSV shapes below: for a list the
fields are the columns, and for one object the field<TAB>value rows. A
table keeps the list's footer on stderr, so a list cut short by --limit
says so. The values are the JSON's, not the table's: true rather than
yes, a timestamp rather than a date, an empty host rather than @.
namecom domain list --all --fields domainName,expireDate -o tsv --no-header |
while IFS=$'\t' read -r name expires; do echo "$name $expires"; done
namecom dns list example.com --fields id,type,host,answer -o tableAn item without a field gets null for it (an empty TSV cell): the API
leaves out empty values, so items do not all have the same keys. A field
the output cannot have is a usage error (exit 2) that lists the fields there
are — on an empty list too.
--fields names top-level keys only; reach into nested ones with --jq.
--jq <expr> runs a jq expression over the document -o json would print,
with an embedded jq (gojq), so jq need
not be installed. Each result prints on its own line: a string as itself,
without quotes (as jq -r and gh --jq print it), anything else as compact
JSON. gojq prints an object's keys sorted. A string prints raw, escape
sequences and all, where a table shows them as \x1b: pipe through
cat -v to read values you don't trust.
namecom domain list --all --jq '.data[] | select(.locked | not) | .domainName'
id=$(namecom dns create example.com --type A --answer 192.0.2.1 --yes --jq .id)
namecom dns create example.com --type A --answer 192.0.2.1 --dry-run --jq .body--jq implies JSON, so it can't be combined with -o table, yaml or
tsv. With --fields, the fields are picked first. Mistakes are usage
errors (exit 2): a malformed expression, or an unknown field on a write, is
caught before anything is sent; an unknown field on a read, or an
expression that fails on the output, prints nothing. The one exception is an
expression that fails after a write went through: the result prints
unfiltered with a warning, and exit 0, since the change was made. Errors
still go to stderr as the usual envelope.
-o tsv prints a table's columns as tab-separated values, with a header row
unless --no-header. There is no colour, a date has no "(in 3 months)", and
a missing value is an empty cell, not "—". A backslash, tab, line feed or
carriage return in a value is written \\, \t, \n or \r, so every row
is one line, and any other control character as an escape such as \x1b.
The shape never depends on the data:
- A list prints a header row and a row per item, with the same columns
whatever the items hold, and the header alone when it is empty. Several
objects (
domain get a.com b.com, the roles ofdomain contacts get) are a list. - One object prints
field<TAB>valuerows, the same rows whatever it holds: a value it lacks is an empty cell.domain getuses its table's field names; the rest (status,version,auth status,config show,domain claims,domain pricing,transfer eligibility,url get,email get,order get,open) use the-o jsonkeys with bare values, a value's source as a key of its own (profileSource), and a list in a value as a JSON array (order get's items are oneorderItemscell). - A write prints its result's
-o jsonkeys the same way: the record it made, withchangedwhere JSON has it, orsuccess,changedandmessage; a read never does. A dry run printsmethod,pathandbody(as compact JSON) columns.
-q still wins over -o, tsv included. With --fields or --jq, which
choose what to print as well, it is a usage error.
-q/--quiet follows one rule whatever --output says: lists print one ID
or name per line, create commands print the new resource's ID, other writes
print nothing, and other reads print the one value a script most likely wants
(version the version, auth status the username, domain pricing the
price). Errors still go to stderr. --dry-run is the exception: with -q
it still prints the whole preview.
Tables drop their rightmost columns to fit a narrow terminal and say which
they hid; --wide keeps them all.
--dry-run prints the request a write would send, and sends nothing. In JSON
mode — including the default when piped — that is a JSON document with
dryRun, method, path and body keys; -o table prints
METHOD /path and the body instead.
With -o json — the default when output is piped — and with -o yaml,
which carries the same keys, output follows the rules below. A change to any
of them is a breaking change and is called out in the
CHANGELOG.
-
One document per stream. The result goes to stdout. stderr carries at most one document: the error envelope when the command fails, or
{"warnings": [...]}when it succeeded with something to say. -
Lists are
{"data": [...]}, withnextPageandtotaladded when the list is paged.datais[], nevernull, when there is nothing in it, and a list the API counts says"total": 0then. This covers everylist, anddomain check,domain search,config list-profilesanddns exporttoo (dns importanddns syncread both that and the bare array older versions exported), anddomain getgiven several domains or-. -
One resource is the object itself, as the API returns it:
domain getwith one domain,dns create,email update. A create or update adds"changed"to it:falsewhen there was nothing to do (dns create --if-not-existsfor a record already there, an update to the values it has),trueotherwise. -
Keys are camelCase everywhere:
domainsTotal,dryRun,idempotencyKey. Values that name a kind of thing, such as error types (not_found) or dry-run actions (save_profile), are snake_case. -
A write with no resource to return prints
{"success": true, "changed": true, "message": "…"}.changedisfalsewhen the target was already in the requested state and nothing was sent —domain lock onfor a locked domain,dns delete --if-existsfor a record that is gone,dns import --skip-existingwith nothing new.messageis for people; branch onchanged, not on its wording. -
A write over several targets — a toggle given several domains,
dns deletewith several IDs — is still one document: the same three keys, withchangedtrue when any target changed, and one{"domain", "id", "changed", "message"}item per target underdata(domainoridas applies). One target prints the plain document above, so.changedreads either. -
A dry run prints
{"dryRun": true, "method": …, "path": …, "body": …}, with aquoteobject for a write that costs money. A dry run that plans several requests —dns import, a toggle ordns deleteover several targets — prints{"dryRun": true, "data": [ … ]};dns sync --dry-runadds its plan (creates,updates,deletes,kept,unchanged) beside thatdata. A dry run that would only change the config file —auth login,auth logout,config use— prints{"dryRun": true, "config", "action", "profile", "default"}, whereauth logout'sdefaultis the profile that would be the default afterwards anddefaultSourcesays whether the file'sdefault:key names it (config) or the profiles left imply it (implied).open --dry-runprints{"url", "opened": false, "dryRun": true}. -
domain checkgives each namepurchasable:true,falsefor a taken name, ornullwhen the registry did not answer for it (the table saysunknown). -
domain claimsanddomain pricingprint the API's response as it comes. Claims names the domaindomain, notdomainName, because the API does; pricing does not name it at all. Both take one domain, so a script that checks several has the name it passed for each. -
dns syncprints what it did:{"domain", "changed", "applied": [ … ], "unchanged"}. When a change fails, that document still goes to stdout, withfailed(andoutcomeUnknown: truewhen it may have gone through) andnotAttempted, and the error envelope goes to stderr. -
Warnings — a
--base-urlorNAMECOM_BASE_URLthat is not name.com, duplicate IDs dropped fromorder refund, records created before adns importfailed, an existing record's different TTL underdns create --if-not-exists— are not printed as text. They come out at the end, in the error envelope'swarnings, or as{"warnings": [...]}on stderr when the command succeeded. -
Nothing is HTML-escaped.
<,>and&print as themselves. -
Errors are one document on stderr:
{ "error": { "type": "not_found", "status": 404, "message": "domain \"example.com\" not found", "hint": "run 'namecom domain list' to see your domains" } }typeis always there, and is one of:typeMeaning Exit code usageThe command line is wrong: an unknown command or flag, a bad argument or value 2 confirmation_requiredA write needs --yes, because there is no terminal to ask2 authCredentials missing, failing or rejected, a config file that cannot be used, or access denied (HTTP 401, or a 403 about the account or its IP address; a 403 about the domain itself, such as "The domain is expired.", is api)3 not_foundHTTP 404 4 rate_limitedHTTP 429, after the CLI's own retries 5 conflictThe thing already exists (the API answers a duplicate DNS record with a 400 that says so), or HTTP 409, which the API uses for a reused idempotency key 1 abortedA confirmation was declined or a prompt cancelled 1 networkNo HTTP response: a timeout, or a connection that failed 1 unavailabledomain check --exit-statusfound a name that is not available, ordomain registerwas given one; nothing failed1 apiAny other failure: another API error, or a local one such as an unreadable file 1 statusis the HTTP status, present only when the API answered.messageandhintare for people. The other keys appear only when they apply:detailsholds structured detail (the raw response body fornamecom api, the profile, username, endpoint and config file for a rejectedauth status, with where each came from asusernameSource,tokenSourceand so on), andsuggestionsthe full command lines an unknown command was probably meant to be (["namecom dns delete"]).idempotencyKeyis set when a write's outcome is unknown (exit 6): theX-Idempotency-Keythe request carried. The envelope also has a top-levelhint, a copy oferror.hintwhere older versions put it. It is deprecated and will be removed in 0.6.0; readerror.hint.
namecom api is the one exception: it prints the API's response body exactly
as received ({"domains": [...]}, not {"data": [...]}). It exists to reach
endpoints namecom does not wrap and to show what the API itself says, and
reshaping the body would hide the very thing it was asked for. Its errors use
the envelope above, with the response body as details. -o yaml, -o tsv
and -q do not apply to it and are usage errors (exit 2); use --jq or
--fields to pick from the body.
Credentials are written by namecom auth login to your platform's user config directory:
| Platform | Location |
|---|---|
| macOS | ~/Library/Application Support/namecom/config.yaml |
| Linux | $XDG_CONFIG_HOME/namecom/config.yaml, or ~/.config/namecom/config.yaml |
| Windows | %AppData%\namecom\config.yaml |
namecom auth status prints the path in use. An older ~/.namecom/config.yaml is still read if the current location has no config, and NAMECOM_CONFIG overrides both. Multiple profiles are supported for managing separate accounts:
namecom auth login --profile work
namecom auth login --profile personal
namecom domain list --profile work
namecom config use work # make it the defaultSandbox vs. production — test changes safely against name.com's sandbox API before running them for real:
namecom auth login --profile sandbox --sandbox
namecom domain register test.com --profile sandbox--sandbox at login saves the profile as a sandbox one, so every command run
with it targets api.dev.name.com. The sandbox has its own API token,
separate from your production one. Omit --profile to use your default
(production) profile.
Environment variables (useful in CI; namecom help environment lists them all):
export NAMECOM_USERNAME=yourname
export NAMECOM_TOKEN=yourtoken
export NAMECOM_SANDBOX=true # target sandbox API (true/false, yes/no, on/off, 1/0)
export NAMECOM_PROFILE=staging # select a profile
export NAMECOM_CONFIG=~/namecom-ci.yaml # use this file instead of the default
export NAMECOM_BASE_URL=http://127.0.0.1:8080 # a local stub; --base-url overrides it
export NAMECOM_NO_UPDATE_NOTIFIER=1 # never print the "new release" notice
namecom domain listNAMECOM_USERNAME and NAMECOM_TOKEN are enough on their own: no config file
or profile is needed. namecom config show and namecom auth status resolve
credentials exactly as other commands do and say where each value came from
(env NAMECOM_TOKEN, flag --username, profile work, token_cmd); in JSON
that is a sibling key such as "usernameSource": "env NAMECOM_USERNAME".
CI — a GitHub Actions job needs only the two variables, from repository
secrets. auth status checks them first, so a bad token fails the job before
any real work:
jobs:
dns:
runs-on: ubuntu-latest
env:
NAMECOM_USERNAME: ${{ secrets.NAMECOM_USERNAME }}
NAMECOM_TOKEN: ${{ secrets.NAMECOM_TOKEN }}
NAMECOM_NO_UPDATE_NOTIFIER: "1"
steps:
- uses: actions/setup-go@v5
with:
go-version: stable
- run: |
go install github.com/patramsey/namecom-cli@latest
mv "$(go env GOPATH)/bin/namecom-cli" "$(go env GOPATH)/bin/namecom"
- run: namecom auth status
- run: namecom dns create example.com --type TXT --host _verify --answer "${{ vars.VERIFY_TOKEN }}" --yesTo write a profile without a terminal instead — for a later step, or a
machine image — pipe the token to --with-token, or save a credential
helper with --token-cmd. Both check the credentials with the API first
(--no-verify skips that), and replacing an existing profile needs --yes:
echo "$NAMECOM_TOKEN" | namecom auth login --username alice --with-token
namecom auth login --username alice --token-cmd 'op read op://vault/namecom/token' --profile ciSecret manager integration — add token_cmd to your config and credentials are fetched at runtime, never stored on disk:
profiles:
default:
username: yourname
token_cmd: "op read op://vault/namecom/token" # 1Password exampleThe command must print the token on a single line. It runs through sh -c on
macOS and Linux, and through cmd.exe on Windows. To use sh syntax on
Windows, call sh yourself — for example
token_cmd: sh -c "op read op://vault/namecom/token | tr -d '\r'" — with an
sh on your PATH (Git for Windows ships one).
The Homebrew formula installs completions for bash, zsh and fish. For other installs, write the script to a directory your shell reads; these need no root:
# bash (needs the bash-completion package, v2)
mkdir -p ~/.local/share/bash-completion/completions
namecom completion bash > ~/.local/share/bash-completion/completions/namecom
# zsh: then add `fpath=(~/.zfunc $fpath)` to ~/.zshrc, before `compinit` runs
mkdir -p ~/.zfunc
namecom completion zsh > ~/.zfunc/_namecom
# fish
mkdir -p ~/.config/fish/completions
namecom completion fish > ~/.config/fish/completions/namecom.fishPowerShell: add namecom completion powershell | Out-String | Invoke-Expression
to your $PROFILE.
Open a new shell afterwards. namecom completion <shell> --help has more.
| Flag | Default | Description |
|---|---|---|
-o, --output |
table in TTY, json otherwise |
Output format: table, json, yaml, tsv |
--fields |
Keep only these keys of each list item, or of the object, in this order — see Picking fields, jq, and TSV | |
--jq |
Filter the JSON output with a jq expression; strings print unquoted | |
-q, --quiet |
Script output: lists print one ID or name per line, creates the new ID, other writes nothing — see Output formats | |
-y, --yes |
Skip all confirmation prompts; required, when not in a terminal, for the writes that confirm — see Confirmations | |
--dry-run |
Print the request a write would send, without sending it — a JSON document in JSON mode. Reads are unaffected | |
--profile |
Use a named credential profile | |
--sandbox |
Target the sandbox API (api.dev.name.com) |
|
--base-url |
Send requests to another API base URL, such as a local stub or a proxy (overrides NAMECOM_BASE_URL). Your credentials go wherever it points; a warning says so when it is not name.com |
|
--color |
auto |
Colorize output: auto, always, never |
--wide |
Keep every table column, even when the table is wider than the terminal | |
--timeout |
30s |
Total time budget for one API call, retries included |
--debug |
Log HTTP requests/responses to stderr (token and auth codes redacted) | |
--debug-file |
Log HTTP requests/responses to a file (appends; useful as an audit log) | |
--no-header |
Omit the header row from table and TSV output | |
--idempotency-key |
a fresh key per write | Pin every write in this invocation to one key, so re-running the same command after a failure can be recognized as a retry by endpoints that honor idempotency keys — see Idempotency keys |
--username |
API username (overrides config and NAMECOM_USERNAME) |
|
--token |
API token (overrides config and NAMECOM_TOKEN) |
| Code | Meaning |
|---|---|
0 |
Success |
1 |
API or other runtime error, a confirmation declined or a prompt cancelled (Ctrl-C), or a name that is not available — found by domain check --exit-status, or given to domain register |
2 |
Usage error: an unknown command or flag, a wrong number of arguments, or an invalid value. Also a write with no terminal to confirm it and no --yes (confirmation_required) |
3 |
Authentication: credentials missing (an unknown profile included, named by --profile or config use), failing or rejected, a config file that cannot be read or written, or access denied (HTTP 401, or a 403 that is not about the domain itself — an expired domain's 403 exits 1) |
4 |
Not found (HTTP 404) |
5 |
Rate limited (HTTP 429), after the CLI's own retries |
6 |
Write outcome unknown: a request that changes something got a 5xx, or timed out or lost its connection after it was sent, so it may or may not have been carried out — see Idempotency keys |
With --output json or yaml — including the JSON default when piped — an
error is written to stderr as one document, an error object whose type
says which of these it is. See JSON contract.
Every POST, PUT and DELETE namecom sends carries an X-Idempotency-Key
header: a fresh key per request, or, with --idempotency-key, the key you
name for every write in that invocation. PATCH (domain update) carries
none.
When a write fails in a way that leaves its outcome unknown — the API
answered 5xx, or the request timed out or lost its connection after it was
sent — namecom exits 6 and names the key it used: in the hint
(outcome unknown; re-run with --idempotency-key <key>) and, in JSON mode,
as error.idempotencyKey. A POST is never retried on a 5xx, because the
server may already have done the work. Check whether the change was made;
if it was not, re-run the same command with --idempotency-key <key>.
dns sync is the exception: it is not re-run with the key, since the next
run sends different requests, but simply run again. It plans from the live
zone, so a change that did land is not repeated. Its result document marks
the failed change outcomeUnknown, and its hint says to run sync again.
Whether the key prevents a duplicate depends on the endpoint. The Core API declares the header on five operations:
| API operation | namecom command |
|---|---|
CreateDomain |
domain register, and the register domain check offers |
ProcessRefund |
order refund |
VerifyContact |
contact verify |
ResendContactVerificationEmail |
contact resend |
PurchasePrivacy |
none (domain privacy on uses a different endpoint) |
The API reference describes what a reused key does only for refunds: the
same key returns the original response instead of refunding again. For the
other four the header is declared but what the API does with it is not
documented. Every other write — DNS records, email and URL forwarding,
vanity nameservers, DNSSEC, transfers, renewals, nameserver and contact
changes — ignores it. Two dns create requests under one key made two
records in the sandbox. For those, check before you retry.
make build # compile to ./namecom
make test # go test ./...
make lint # golangci-lint runThe API client is github.com/namedotcom/core-api-go, name.com's own SDK. There is no code generation step.
Contributions welcome — see CONTRIBUTING.md for the setup, the checks CI runs, and what to know before touching the API client or a command that writes. Participation is governed by the Code of Conduct.
Security issues should go through private vulnerability reporting rather than a public issue — see SECURITY.md.
Release history is in CHANGELOG.md.
MIT — see LICENSE.
