CLI Overview
The Hamtrax CLI is a small, focused command-line tool for logging POTA contacts, managing activations, and integrating Hamtrax into your scripts and custom hardware. It's designed to be operated by both humans at a terminal and AI agents calling commands programmatically.
What it does
The CLI exposes a deliberately small slice of Hamtrax functionality -- the parts you actually need from a terminal:
- whoami -- show your callsign, plan, tier, and native QSO count.
- List folders, contacts, and activations.
- Create POTA activations (with idempotent find-or-create semantics).
- Create QSOs in contact-holding folders they match -- the same park/month guardrails as the web app apply, and POTA fields auto-populate in a valid activation folder.
- Delete QSOs (requires an
elevatedkey).
Use the web app or the iOS and Android apps for imports, exports, and maps. Use the CLI when you want to control Hamtrax from a terminal, script, or custom hardware.
Who it's for
- Portable operators running a Raspberry Pi or laptop in the field who want to script their logging flow.
- Custom hardware builders wiring Hamtrax into rig-control software, foot-switch loggers, or display panels.
- AI agents that need a stable, machine-readable API for logging contacts on a user's behalf -- see AI Agent Guide for shell commands or MCP for a compatible assistant connection.
- Power users who prefer keyboard over UI for repetitive logging.
How it works
- Install the CLI on your computer.
- In the Hamtrax web app, open Tools > Hamtrax CLI and generate an API key.
- Run
hamtrax auth loginand paste the key when prompted. You only need to do this once per device. - Run Hamtrax commands from your terminal, scripts, or custom hardware. Contacts and activations are saved to your Hamtrax logbook.
See Auth and Keys for detailed setup and key-management instructions.
$ hamtrax activations create --reference K-1234 --callsign N0CALL
Activation started: K-1234 (folder: <folder-id>).
$ hamtrax contacts create --callsign W1AW --mode FT8 --frequency 14.074 --folder <folder-id>
Logged QSO <qso-id>.
Agent-friendly by design
The CLI is built with three principles that matter for automation:
- Stable exit codes -- every error class maps to a deterministic exit code (see AI Agent Guide).
- Structured output --
--jsonfor one-shot calls,--ndjsonfor streaming list output into pipelines. - Self-describing help --
hamtrax help --alldumps the entire command tree to stdout andhamtrax --help-jsonemits a machine-readable manifest, both versioned alongside the API.
What's next
- Install the CLI -- one
npm i -gaway. - Generate an API key -- 60 seconds in the web app.
- Worked examples -- log a POTA contact, run an activation end-to-end.
- AI Agent Guide -- env-var auth, JSON output, exit-code table, sample LLM prompts.
- MCP -- connect a compatible assistant with controlled read, create, and delete access.