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.
# Requires Go 1.26.3+
go install github.com/datpaq/cli/cmd/datpaq@latest
# Verify
datpaq --versionAuthentication
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.
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 URLGlobal flags
These persistent flags work on every Datpaq subcommand.
| Flag | Type | Description |
|---|---|---|
| --json | bool | Output as JSON |
| --compact | bool | Return only key fields (id, name, status, timestamps) for minimal token usage |
| --csv | bool | Output as CSV (table and array responses) |
| --plain | bool | Output as plain tab-separated text |
| --quiet | bool | Bare output, one value per line |
| --select | string | Comma-separated fields to include in output |
| --config | string | Config file path |
| --timeout | duration | Request timeout (default 30s) |
| --rate-limit | float | Max requests per second (0 to disable) |
| --dry-run | bool | Show the request without sending it |
| --no-cache | bool | Bypass response cache |
| --no-input | bool | Disable all interactive prompts (for CI/agents) |
| --idempotent | bool | Treat already-existing create results as a successful no-op |
| --yes | bool | Skip confirmation prompts (for agents and scripts) |
| --no-color | bool | Disable colored output |
| --human-friendly | bool | Enable colored output and rich formatting |
| --agent | bool | Set agent-friendly defaults (see Agent / CI mode) |
| --allow-partial-failure | bool | Downgrade response-body partial-failure to a warning |
| --data-source | string | auto, live, or local (for read commands) |
| --profile | string | Apply values from a saved profile |
| --deliver | string | Route 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.
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 --quietAgent / 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.
--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.
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 devDoctor
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:
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 staleExec 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.
# 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 --csvCode 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.
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 goSync & search
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.
# 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 20Config 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.
# ~/.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.
go install github.com/datpaq/cli/cmd/datpaq-mcp@latestExample Claude Desktop config entry:
{
"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.