Terminal-First Workflows
The Primox CLI gives you direct access to your shooting data from the terminal. Every operation available in the web interface can be performed through commands: listing projects, creating sessions, logging data, running analysis, and generating reports.
The CLI is designed for power users who prefer keyboard-driven workflows, want to script repetitive tasks, or need to integrate Primox data into other tools. All output can be formatted as JSON for piping into tools like jq, or as human-readable tables for quick reference.
Installation
Install the CLI globally using npm. This makes the primox command available system-wide:
npm install -g @primox/cli
Alternatively, use npx to run it without installing globally:
npx @primox/cli rifles list
Authentication
The CLI authenticates using your Primox API key. Run the login command to save your key locally. The key is stored in a configuration file at ~/.primoxrc and used automatically for all subsequent commands.
$ primox login# Enter your API key when prompted# Key is saved to ~/.primoxrc $ primox login --status# Check current authentication status $ primox login --logout# Remove saved credentials
Your API key is stored in plain text at ~/.primoxrc. Keep this file secure and do not share it. Use file permissions to restrict access (chmod 600 ~/.primoxrc on Unix systems).
Command Structure
All CLI commands follow a consistent pattern: the resource type, the action to perform, and any options.
primox <resource> <action> [options]
Resources include rifles, projects, sessions, loads, recipes, barrels, powders, projectiles, primers, brass, and more. Each resource supports a set of actions appropriate to its type.
# List all rifles$ primox rifles list # Create a new project$ primox projects create --name "6.5 CM Development" # Get a session report$ primox sessions report --id <session-id> # Run ladder analysis$ primox analyze ladder --session <session-id>
Command Reference
Below is a summary of the key command groups. Each group manages a specific type of data in your Primox account.
Rifles
Manage your rifle inventory. List all rifles, create new entries, or update existing rifle details like name and notes.
primox rifles listprimox rifles createprimox rifles updateProjects
Manage your load development projects. Projects are the primary container for sessions, loads, and equipment tracking. Filter by name or reloading status.
primox projects listprimox projects createprimox projects updateSessions
Full session lifecycle management. Create sessions of any type (ladder, seating depth, shooting, calibration, and more), retrieve details and reports, soft-delete with side-effect handling, and restore deleted sessions.
primox sessions listprimox sessions getprimox sessions createprimox sessions updateprimox sessions deleteprimox sessions restoreprimox sessions reportRecipes
Manage your ammunition recipes. Each recipe defines a combination of brass, powder, projectile, primer, charge weight, and seating depth.
primox recipes listprimox recipes createprimox recipes updateAnalysis
Run computations on your session data. Velocity statistics (mean, SD, ES), group analysis (size, mean radius), charge ladder analysis (node detection, viability scoring), seating depth trends, cross-session comparison, and load safety validation.
primox analyze velocityprimox analyze groupprimox analyze ladderprimox analyze seating-depthprimox analyze compareprimox analyze validate-loadReference Data
Access the global reference database. Look up caliber specifications, manufacturer listings, propellant physics data, cartridge dimensions, and published load data from manufacturers.
primox reference calibersprimox reference manufacturersprimox reference propellantsprimox reference cartridgesprimox reference published-loadsAdditional Resources
Additional commands for managing loads, barrels, powders, projectiles, primers, brass, subscription status, and unit conversion.
primox loads listprimox loads updateprimox barrels listprimox barrels createprimox powders listprimox powders createprimox projectiles listprimox projectiles createprimox primers listprimox primers createprimox brass listprimox brass createprimox subscriptionprimox convertOutput Formats
Every command supports three output formats. Use the --format flag to switch between them:
--format jsonRaw JSON output. Ideal for scripting, piping to jq, or feeding into other programs. Returns the API response as-is.
--format prettyFormatted, indented output with labels and structure. Good for reading in the terminal when you need full detail.
--format tableCompact tabular layout with columns. Best for quick scanning when you want an overview of multiple records.
# Human-readable table output$ primox rifles list --format table # Machine-readable JSON output$ primox sessions list --format json # Detailed pretty-printed output$ primox sessions report --id <id> --format pretty
Scripting and Automation
The CLI's JSON output makes it easy to integrate into shell scripts, CI pipelines, or data processing workflows. Combine with standard Unix tools for powerful automation.
$ primox projects list --format json | jq '.[].id'
# Get all session reports for a project$ for id in $(primox sessions list --project <project-id> --format json | jq -r '.[].id'); do primox sessions report --id $id --format json > "report_$id.json" done
# Run a safety validation check$ primox analyze validate-load \ --cartridge "6.5 Creedmoor" \ --powder "Hodgdon H4350" \ --charge-weight 41.5 \ --bullet-weight 140
Combine the CLI with the MCP server for the best of both worlds: use the CLI for scripted automation and batch operations, and use the MCP connection with Claude for interactive, conversational data exploration.
