Anysite CLI is agent-native — it auto-detects when stdout is a pipe or subprocess (non-TTY) and switches all output to structured JSON. No flags, no configuration. AI agents like Claude Code, n8n, Make, and custom scripts get machine-readable responses out of the box.Every command returns:
A JSON envelope with ok, result/error, hints, and meta
Exit codes for programmatic flow control
Error codes with retryable flag and suggestions
Next-step hints so agents discover follow-up commands without documentation
# In terminal — human-readable output (default)anysite api /api/linkedin/user user=satyanadella# In terminal — force JSON outputanysite api /api/linkedin/user user=satyanadella --json# In pipe — JSON automaticallyanysite api /api/linkedin/user user=satyanadella | jq '.result.name'# In pipe — force human outputanysite api /api/linkedin/user user=satyanadella --human | less
The --non-interactive flag disables interactive prompts (confirmations, selections). It is auto-enabled when stdin is not a TTY.
{ "ok": false, "error": { "code": "AUTH_FAILED", "message": "Authentication failed: invalid or expired API key", "retryable": false, "suggestions": [ "Set API key: anysite config set api_key <key>", "Or set environment variable: export ANYSITE_API_KEY=<key>" ] }, "meta": { "version": "0.3.0", "command": "anysite api /api/linkedin/user" }}
Always check the ok field first. Use error.code for programmatic handling, error.retryable to decide whether to retry, and error.suggestions for recovery steps.
Every command returns next-step hints — suggested follow-up commands based on what you just did. In JSON mode, hints appear in the hints array. In human mode, they are printed as dim text on stderr.Agents use hints to discover follow-up actions without consulting documentation:
Copy
# Collect hints from responseHINTS=$(anysite api /api/linkedin/user user=satyanadella | jq -r '.hints[].command')echo "$HINTS"# anysite api /api/linkedin/user/posts user=satyanadella# anysite db insert mydb --table profiles --stdin
The CLI includes a comprehensive dataset configuration guide accessible via the command line:
Copy
# Full configuration referenceanysite dataset guide# Specific sectionanysite dataset guide --section sources# Complete example configanysite dataset guide --example advanced# List all available sections and examplesanysite dataset guide --list# JSON output for agentsanysite dataset guide --json
Agents can use anysite dataset guide --json to get a structured reference of all dataset pipeline features, source types, and configuration options.