Documentation

Datpaq CLI Reference

Full reference for every public surface of the Datpaq CLI.

Install

Install with Go. A Homebrew tap is planned and will be announced when published.

bash
# Requires Go 1.26.3+
go install github.com/datpaq/cli/cmd/datpaq@latest

# Verify
datpaq --version

Authentication

Three ways to provide credentials, checked in this order: DATPAQ_API_KEY environment variable, then the config file at ~/.config/datpaq/config.toml (mode 0600), then none.

bash
datpaq auth login              # Browser SSO via datpaq.com
datpaq auth set-token <token>  # Save an API key to the config file
datpaq auth status             # Show current auth state
datpaq auth logout             # Clear stored credentials
datpaq auth setup --launch     # Print + open the credential-setup URL

Global flags

These persistent flags work on every Datpaq subcommand.

Persistent global flags for the Datpaq CLI
FlagTypeDescription
--jsonboolOutput as JSON
--compactboolReturn only key fields (id, name, status, timestamps) for minimal token usage
--csvboolOutput as CSV (table and array responses)
--plainboolOutput as plain tab-separated text
--quietboolBare output, one value per line
--selectstringComma-separated fields to include in output
--configstringConfig file path
--timeoutdurationRequest timeout (default 30s)
--rate-limitfloatMax requests per second (0 to disable)
--dry-runboolShow the request without sending it
--no-cacheboolBypass response cache
--no-inputboolDisable all interactive prompts (for CI/agents)
--idempotentboolTreat already-existing create results as a successful no-op
--yesboolSkip confirmation prompts (for agents and scripts)
--no-colorboolDisable colored output
--human-friendlyboolEnable colored output and rich formatting
--agentboolSet agent-friendly defaults (see Agent / CI mode)
--allow-partial-failureboolDowngrade response-body partial-failure to a warning
--data-sourcestringauto, live, or local (for read commands)
--profilestringApply values from a saved profile
--deliverstringRoute output to a sink: stdout, file:<path>, or webhook:<url>

Output formats

The CLI picks a human-friendly format by default. Switch to a machine-readable format on demand.

bash
datpaq ip-geolocation get --ip 8.8.8.8 --json
datpaq ip-geolocation get --ip 8.8.8.8 --compact
datpaq ip-geolocation get --ip 8.8.8.8 --csv
datpaq ip-geolocation get --ip 8.8.8.8 --plain
datpaq ip-geolocation get --ip 8.8.8.8 --select country,city
datpaq ip-geolocation get --ip 8.8.8.8 --quiet

Agent / CI mode

--agent is a shortcut that sets several flags at once, each only if not already explicitly set. Pair it with --dry-run, --allow-partial-failure, and explicit --timeout values for predictable CI runs.

bash
--agent  ≡  --json --compact --no-input --no-color --yes

# Use it on any command
datpaq ip-geolocation get --ip 8.8.8.8 --agent | jq '.country'

Profiles

Save reusable sets of flag values and apply them with --profile <name>. Profiles are stored at ~/.datpaq/profiles.json. Explicit flags on a command always override profile values.

bash
datpaq profile save dev      # Capture current flags as profile "dev"
datpaq profile list          # List saved profiles
datpaq profile show dev      # Print profile as JSON
datpaq profile use dev       # Print profile values without executing
datpaq profile delete dev --yes

# Apply a saved profile to any command
datpaq ip-geolocation get --ip 8.8.8.8 --profile dev

Doctor

datpaq doctor walks through config load, stored auth, environment variables, API reachability, credential presence, and local-cache freshness. Use --json with --fail-on for CI:

bash
datpaq doctor
datpaq doctor --json
datpaq doctor --json --fail-on error    # Non-zero exit on hard failure
datpaq doctor --json --fail-on stale    # Non-zero exit if local sync is stale

Exec vs direct calls

datpaq exec <interface>.<method> is a curated, interactive surface — it prompts for missing required parameters and always returns pretty-printed JSON. Binary endpoints (image-processing, web-screenshot) are excluded from exec and have dedicated commands instead. Direct calls (datpaq <interface> <method>) don't prompt and let you pick any output format.

bash
# Curated, interactive surface (prompts for missing required params)
datpaq exec list
datpaq exec ip-geolocation.get --ip 8.8.8.8

# Direct interface call (no prompting, more flexible output)
datpaq ip-geolocation get --ip 8.8.8.8 --csv

Code samples

datpaq sample <interface> <method> --lang <lang> emits a copy-pasteable snippet in curl, js, py, or go. Snippets reference DATPAQ_API_KEY so they're safe to share.

bash
datpaq sample ip-geolocation get --lang curl
datpaq sample ip-geolocation get --lang js
datpaq sample ip-geolocation get --lang py
datpaq sample ip-geolocation get --lang go

datpaq sync pulls API data to a local SQLite store so reads work offline or under rate-limit pressure. Sync is paginated, resumable, and parallel, with windowing via --since and a full refresh via --full. datpaq search runs FTS over the synced data; flip live vs local with --data-source auto|live|local.

bash
# Sync API data to a local SQLite store for offline reads
datpaq sync --since 7d
datpaq sync --full --concurrency 8

# Full-text search across synced data (or live, or both)
datpaq search "san francisco" --data-source auto --limit 20

Config file

TOML at ~/.config/datpaq/config.toml (mode 0600). Environment variables override file values, so the same config works on a laptop and in CI.

toml
# ~/.config/datpaq/config.toml  (mode 0600)
base_url = "https://datpaq.com/api/v1"
api_key_header = "YOUR_API_KEY"

# Optional custom headers attached to every request
[headers]
X-Internal-Trace = "team-abc"

MCP server

datpaq-mcp is a sibling binary that exposes every CLI command as an MCP tool over stdio.

bash
go install github.com/datpaq/cli/cmd/datpaq-mcp@latest

Example Claude Desktop config entry:

json
{
  "mcpServers": {
    "datpaq": {
      "command": "datpaq-mcp"
    }
  }
}

Active API interfaces

The interfaces below are surfaced by datpaq api, datpaq exec, and datpaq sample. Other interfaces still work as direct commands, but aren't advertised in discovery. List is pulled live from the Datpaq API directory.