Skip to main content

Options

Every command takes these.

Environment variables

Files

The CLI keeps its files in agentrail under XDG_CONFIG_HOME, so ~/.config/agentrail by default, readable only by you:
  • the sign-in, when you signed in with --insecure-storage. Otherwise it is in your operating system’s keychain;
  • a sign-in an agent started and has not finished;
  • the list of commands Agentrail last sent, so help works when Agentrail cannot be reached;
  • when it last checked npm for a newer CLI.
A workspace link is .agentrail/link.json in the directory you linked. When neither a coding agent nor a CI run gives the CLI a session, it keeps its own in a file named cli-session-<id>.json, in an agentrail folder under ~/Library/Application Support on macOS, XDG_STATE_HOME (~/.local/state by default) on Linux, or %LOCALAPPDATA% on Windows. If it cannot write there, it uses the temporary folder. See What Agentrail is told.

What Agentrail is told

Each request the CLI makes to Agentrail says:
  • the command that ran, by its words, never its inputs;
  • the run, and how many requests it has made;
  • how the CLI was started: by a coding agent, in CI, in a terminal or from a script;
  • the coding agent running it and the agent’s version, when there is one, and the names, never the values, of the environment variables that showed it was an agent or CI;
  • a session, as a one-way hash: the agent’s own session, the CI run, or else the session the CLI keeps on this computer, which ends after 30 minutes without a command and lasts a day at most;
  • the versions of the CLI and of the library that sends this.
This lets Agentrail tell the commands of one session from another’s. It goes only to Agentrail’s own servers. Set DO_NOT_TRACK=1 to send none of it and keep no session file. Every request still names the CLI’s version, which Agentrail needs to tell you when your CLI is too old. Set AGENTRAIL_CLI_DEBUG=1 to print what is sent, as it is sent.

Exit codes