Skip to content
Documentation menu

Command line

No first-party CLI is published. Every API-key operation works from a shell with curl and jq; these recipes cover the common tasks.

Set up your shell

Export a workspace API key and define one helper. The helper adds the credential, fails on HTTP errors and prints the JSON body.

Shell
export COA_API_KEY="ak_..."

coa() {
  local route="$1"; shift
  curl --fail-with-body -sS "https://centerofagentic.com/api/$route" \
    -H "Authorization: Bearer $COA_API_KEY" "$@"
}

Recipes

Check the key and the service

Shell
# Which workspace does this key belong to?
coa me | jq '{userId, workspace: (.tenant.slug // .tenant.id)}'

# Is the service answering?
coa health | jq .

List agents

Shell
coa agents | jq -r '.agents[] | [.id, .status, .name] | @tsv'

See the latest refused runs

Every run leaves a receipt with the policy decision. This lists the ten most recent denials with their reason codes; Receipts documents the other filters.

Shell
coa "receipts?decision=deny&limit=10" \
  | jq -r '.receipts[] | [.createdAt, .agentName, .decision.reason_code] | @tsv'

Export every receipt

The receipt list is paged, newest first, with at most 200 receipts per page. Pass the createdAt and id of the last receipt on a page to get the next one, and stop when hasMore is false.

Shell
cursor=""
: > receipts.ndjson
while :; do
  page=$(coa "receipts?limit=200$cursor") || { printf '%s\n' "$page" >&2; break; }
  printf '%s\n' "$page" | jq -c '.receipts[]' >> receipts.ndjson
  [ "$(printf '%s\n' "$page" | jq '.hasMore')" = "true" ] || break
  cursor=$(printf '%s\n' "$page" | jq -r '.receipts[-1] | "&createdBefore=\(.createdAt | @uri)&beforeId=\(.id)"')
done

Run an agent

A run needs the run scope and an X-CoA-Model-Request header. An activated agent also needs a launch ticket and the X-CoA-Agent-Protocol and X-CoA-Agent-Ticket headers. Run an agent has the complete shell sequence; the Quickstart walks through it once.

In CI

The same helper works in a pipeline. Store the key as a secret and give the job the read scope unless it runs agents. Start the script with set -euo pipefail: the recipes pipe coa into jq, and without pipefail the shell ignores the exit status of curl. --fail-with-body then stops the job on an HTTP error while still printing the error body. A governed denial is not an HTTP error: a denied run answers 200 with decision set to deny, so a job that runs agents must check decision too. Automation and CI covers retries, rate limits and a complete workflow file.

Tell us what you need

If a command-line tool would help your team, tell us which tasks you would run with it.

Next steps

Something missing or unclear? Tell us and we will improve this page.