Skip to main content

Using it with an agent

The CLI is made for an AI agent to use as much as a person: it can read an issue, look up its logs, fix it and mark it resolved.

collector issues list --env production --json
collector issues show 2C7ZffP787kc --markdown > issue.md
collector logs --request F3xAbCdEfGh --markdown # the request it came from
claude "Fix the error in issue.md. When the fix is merged, run: collector issues resolve 2C7ZffP787kc"

Give it a token cut to size​

Don't hand it your session: create an access token for the agent, read-only if it only needs to look, or limited to one organization, and give it as COLLECTOR_TOKEN. You can revoke it when it's done without touching your own session.

What the agent needs to know​

  • --markdown gives the text Collector writes for an AI: in issues show, the error, the stack trace with the code around your application's lines, the request, what happened before and the tags; in logs, one line per record, top to bottom like a story.
  • --json, on any command, prints Collector's JSON as is. Under --json, errors go to stderr as {"error": {"code", "message"}}.
  • Results go to stdout; hints, progress and warnings to stderr.
  • Lists show one page (--limit up to 100, then --cursor), or every page with --all.
  • The exit codes tell a refusal (1), a usage mistake (2) and a token problem (3) apart.
  • Collector's messages and the Markdown follow your language in Collector; --lang en or --lang es (or COLLECTOR_LANG) asks for one. The CLI's own text is English.
  • collector api <path> makes a raw request to the API, for anything without a command of its own.
  • collector open issue <id> prints (and, at a terminal, opens) the issue's page in the web app, to leave a person the link.

The agent guide​

app.clt.chrom.ar/agents.md is a Markdown guide for a coding agent, like Claude Code, to set Collector up in your project: it installs the CLI, signs in with collector login, picks or creates the project (collector use <organization>/<project>, collector dsn) and, per language (Elixir, Node, browser JavaScript or other), installs the SDK and sets up errors, logs, speed and source maps. It ends by checking it works, with collector test and collector issues list.

It's public and carries no secrets: the DSN comes from collector dsn. It's in English and Spanish: ?lang=en or ?lang=es, otherwise your browser's language.

From the app​

The Use Collector from your terminal card, on the projects list, has Copy instructions: it copies that same guide, in your language, to paste to the agent.

Every issue's page has Copy as Markdown, the same text as issues show --markdown. And Setup has Copy instructions, so an agent can set the SDK up in your project.