GitHub

A small nushell wrapper over the name.com Core API. Manage DNS records on name.com domains from the command line, with structured nushell tables coming back from list-records so you can pipe them into the rest of your shell pipeline.

Install

Clone, then either put the repo on your PATH or symlink the entry script:

ln -s (pwd)/namecom ~/.local/bin/namecom

The shell.nix provides nushell if you need it:

nix-shell

Credentials

The easiest path is the login subcommand:

namecom login

It points you at the right page to generate a token, prompts for your username + the token, validates them against /core/v1/hello, and writes ~/.config/namecom/credentials with 0600 perms.

To verify an existing credentials file without re-entering anything:

namecom login --check

The file is TOML at ~/.config/namecom/credentials.toml:

username = "your-namecom-username"
token    = "your-api-token"

Treat the token like a password — don't commit it.

For the sandbox environment (api.dev.name.com), append -test to your username when logging in and export NAMECOM_SANDBOX=1 before running other commands.

Usage

# One-time credential setup.
namecom login
# List every record on a domain.
namecom list jobl.dev
# Filter with the usual nushell tools.
namecom list jobl.dev | where type == "A"
# Add an A record. Subdomain "stats", points at 1.2.3.4, default 300s TTL.
namecom add jobl.dev stats A 1.2.3.4
# Add with a custom TTL.
namecom add jobl.dev stats A 1.2.3.4 --ttl 3600
# Delete a record by id (get the id from `list`).
namecom del jobl.dev 12345678

Why nushell

The name.com API speaks JSON. Nushell speaks structured data natively. Wiring them together means namecom list produces a real table you can where / sort-by / select on, instead of a pile of JSON you'd have to pipe through jq. The whole CLI is ~100 lines of nushell as a result.

Read the original on github.com ↗