Automate with the CLI
The CLI emits structured output (JSON, YAML) for scripting. Combined with jq and --quiet mode, it composes naturally with shell pipelines.
For a command reference, see CLI.
Capture IDs
Section titled “Capture IDs”AGENT_ID=$(everruns agents create \ --name "assistant" \ --system-prompt "You are a helpful assistant." \ -o json | jq -r '.id')
SESSION_ID=$(everruns sessions create --agent "$AGENT_ID" -o json | jq -r '.id')
everruns chat "What time is it?" --session "$SESSION_ID"Quiet mode
Section titled “Quiet mode”--quiet suppresses headers and tables, printing only the essential identifier:
everruns agents create -f agent.toml --quiet# Output: agt_550e8400e29b41d4a716446655440000Useful inside $(...) substitution when JSON parsing is overkill.
Filter listings
Section titled “Filter listings”# Active agents onlyeverruns agents list --output json | jq '.data[] | select(.status == "active")'
# Just the names of agents tagged "production"everruns agents list -o json \ | jq -r '.data[] | select(.tags[]? == "production") | .name'
# Agents created in the last 24heverruns agents list -o json \ | jq --arg cutoff "$(date -u -d '24 hours ago' +%FT%TZ)" \ '.data[] | select(.created_at > $cutoff)'Configure the API URL
Section titled “Configure the API URL”# Per-commandeverruns --api-url http://localhost:9300/api agents list
# For the whole shellexport EVERRUNS_API_URL=http://localhost:9300/apiexport EVERRUNS_API_KEY=devIn CI, set both via secrets and the CLI will pick them up automatically.
Drive sessions from a file-defined agent
Section titled “Drive sessions from a file-defined agent”cat > agent.md <<'EOF'---name: "code-reviewer"capabilities: - ref: current_time - ref: filesystem config: allowed_paths: ["/workspace"]tags: [development]---You are an expert code reviewer.
When reviewing code:1. Check for bugs and edge cases2. Suggest performance improvements3. Ensure code follows best practicesEOF
AGENT_ID=$(everruns agents create -f agent.md -o json | jq -r '.id')SESSION_ID=$(everruns sessions create --agent "$AGENT_ID" -o json | jq -r '.id')
everruns chat "Review the diff at HEAD~1..HEAD" --session "$SESSION_ID"Send-and-exit (no streaming)
Section titled “Send-and-exit (no streaming)”--no-stream queues the message and returns immediately. Useful when a downstream system polls for results.
everruns chat "Process the queue" --session "$SESSION_ID" --no-streamSee also
Section titled “See also”- CLI reference — full command list and flags.
- Define agents as files — the file formats accepted by
-f.