# 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.

Availability

Center of Agentic does not publish a command-line tool. Nothing needs installing: the recipes below use `curl` and `jq` against the [REST API](https://centerofagentic.com/docs/api), and they work in bash, zsh and sh, and in CI.

## 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.

```bash
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" "$@"
}
```

Caution

Keep the key out of shell history and repositories. Read it from a secret manager or your CI's secret store, and give each job the narrowest scope that works. See [Authentication](https://centerofagentic.com/docs/authentication).

## Recipes

### Check the key and the service

```bash
# 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

```bash
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](https://centerofagentic.com/docs/api/receipts) documents the other filters.

```bash
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.

```bash
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](https://centerofagentic.com/docs/guides/run-an-agent) has the complete shell sequence; the [Quickstart](https://centerofagentic.com/docs/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](https://centerofagentic.com/docs/guides/automation) 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](https://centerofagentic.com/contact) which tasks you would run with it.

## Next steps

- [**Run an agent** The complete launch sequence for a run, in shell and TypeScript.](https://centerofagentic.com/docs/guides/run-an-agent)

- [**Automation and CI** Least-privilege keys, safe retries and a pipeline script.](https://centerofagentic.com/docs/guides/automation)

- [**Python** The same calls from Python with the standard library.](https://centerofagentic.com/docs/guides/python)

Source: https://centerofagentic.com/docs/cli

## Related pages

- [REST API](https://centerofagentic.com/docs/api)
- [Authentication](https://centerofagentic.com/docs/authentication)
- [Receipts](https://centerofagentic.com/docs/api/receipts)
- [Run an agent](https://centerofagentic.com/docs/guides/run-an-agent)
- [Quickstart](https://centerofagentic.com/docs/quickstart)
- [Automation and CI](https://centerofagentic.com/docs/guides/automation)
- [tell us](https://centerofagentic.com/contact)
- [Run an agent The complete launch sequence for a run, in shell and TypeScript.](https://centerofagentic.com/docs/guides/run-an-agent)
- [Automation and CI Least-privilege keys, safe retries and a pipeline script.](https://centerofagentic.com/docs/guides/automation)
- [Python The same calls from Python with the standard library.](https://centerofagentic.com/docs/guides/python)
