Docs
Configuration
All 33 options of Agent Tank 0.10.0: CLI flag, environment variable and config key side by side, with defaults and the release that added each one.
Three ways to configure
Every setting can be given as a command-line flag, an AGENT_TANK_* environment variable or a key in a JSON config file, though not every setting exists on every surface. The tables below show all three side by side.
Command-line flags, for one-off runs:
agent-tank --claude --codex --port 8080 --refresh-cooldown 60
Environment variables, for secrets and service managers:
AGENT_TANK_TOKEN=change-me AGENT_TANK_AUTO_REFRESH_MODE=interval agent-tank
A config file, for multiple accounts and settings you keep:
{
"agents": [{ "provider": "claude" }, { "provider": "codex" }],
"autoRefresh": { "mode": "interval", "interval": 120 },
"history": { "retentionDays": 30 }
}
agent-tank -c config.json
Precedence
The README states the order as: environment variables override CLI flags and config file values, CLI flags override the config file, and defaults apply last.
| Effective order (first wins) | Options |
|---|---|
| Environment variable → CLI flag → config file → default | Bind address, Basic Auth user, Basic Auth password, Bearer token, History database |
| Environment variable → CLI flag (when passed) → config file → default | Record history, Dashboard sparkline |
| Environment variable → config file → CLI flag or its default | Docker bridge bind, Auto-refresh, Refresh mode, Refresh interval, Refresh cooldown, Activity debounce, Keepalive, Keepalive interval, Retention |
| On if any of the three turns it on | Fresh process, Claude API mode |
| CLI flag or its default; the config key is ignored | Port |
| Combined from every surface; ids must be unique | Accounts, Monitor Claude, Monitor Codex, Monitor Antigravity |
Background mode has three exceptions: --no-background, --once and --json suppress AGENT_TANK_BACKGROUND=1 for that run. --once also turns off auto-refresh and keepalive whatever else is set.
Boolean flags and variables
Every on/off flag also accepts a --no- prefix. These are the ones that change something: the defaults that are on, and --no-background to override AGENT_TANK_BACKGROUND=1:
agent-tank --no-auto-discover
agent-tank --no-docker
agent-tank --no-auto-refresh
agent-tank --no-keepalive
agent-tank --no-history
agent-tank --no-history-chart
agent-tank --no-background
Boolean environment variables accept 1 or true to turn a setting on, and 0 or false to turn it off:
AGENT_TANK_DOCKER,AGENT_TANK_AUTO_REFRESH,AGENT_TANK_KEEPALIVE,AGENT_TANK_HISTORY,AGENT_TANK_HISTORY_CHART: when set, any value other than1ortrueturns the setting off.AGENT_TANK_FRESH_PROCESS,AGENT_TANK_CLAUDE_API,AGENT_TANK_BACKGROUND:1ortrueturns the setting on; any other value leaves it as the flags and config file set it.
Accounts and providers
Which CLIs Agent Tank monitors. With no provider flag, --agent or agents entry, it auto-discovers every supported CLI on your PATH.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Monitor Claude | --claude |
— | claude |
off | 0.9.0 |
Monitor the default Claude Code account.
|
|||||
| Monitor Codex | --codex |
— | codex |
off | 0.9.0 |
Monitor the default OpenAI Codex account.
|
|||||
| Monitor Antigravity | --agy |
— | agy |
off | 0.9.7 |
Monitor the default Antigravity CLI (
|
|||||
| Accounts | --agent |
— | agents |
— | 0.9.11 |
Add an account as Accounts from |
|||||
| Auto-discover | --auto-discover--no-auto-discover |
— | — | on | 0.9.0 |
Auto-discover the supported CLIs installed on your |
|||||
Multiple accounts
Use the agents array to monitor several accounts, including several accounts of the same provider. Each entry takes a provider (claude, codex, agy), an optional unique id and display alias, and an optional configPath directory:
{
"agents": [
{
"provider": "codex",
"id": "work",
"alias": "Work",
"configPath": "/srv/accounts/codex-work"
},
{
"provider": "codex",
"id": "personal",
"alias": "Personal",
"configPath": "/srv/accounts/codex-personal"
},
{
"provider": "claude",
"id": "client-a",
"alias": "Client A",
"configPath": "./accounts/claude-client-a"
}
]
}
The same setup on the command line repeats --agent provider[:alias][=config-path] once per account:
agent-tank \
--agent codex:work=/srv/accounts/codex-work \
--agent codex:personal=/srv/accounts/codex-personal
- id and alias. The
id(or the CLI alias after:) is the key returned by/statusand used by the account-specific status, history and refresh endpoints. If bothidandaliasare set in JSON,idis the API key andaliasis the dashboard label. Without either, the id is the provider name. - Allowed ids. Letters, numbers, dots, underscores and hyphens, starting with a letter or number. Every id must be unique.
- Paths. Relative
configPathvalues are resolved relative to the JSON config file (relative--agentpaths, relative to the current directory), and~/is expanded to your home directory.
The path is passed to the provider CLI as its config home:
| Provider | provider | Config home variable |
|---|---|---|
| Claude Code | claude | CLAUDE_CONFIG_DIR |
| OpenAI Codex | codex | CODEX_HOME |
| Antigravity CLI | agy | GEMINI_CLI_HOME |
Server
Where the dashboard and HTTP API listen.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Port | --port |
— | port |
3456 | 0.9.0 |
HTTP server port for the dashboard and API. In 0.10.0 the |
|||||
| Bind address | --host |
AGENT_ |
host |
127. |
0.9.0 |
Address to bind. When omitted, Agent Tank binds |
|||||
| Docker bridge bind | --docker--no-docker |
AGENT_ |
dockerAccess |
on | 0.9.4 |
Also bind the Docker bridge gateway addresses when |
|||||
Authentication
The HTTP server is open by default. Set a Basic Auth user and password, a Bearer token, or both.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Basic Auth user | --auth-user |
AGENT_ |
auth. |
— | 0.9.0 |
HTTP Basic Auth username. |
|||||
| Basic Auth password | --auth-pass |
AGENT_ |
auth. |
— | 0.9.0 |
HTTP Basic Auth password. Prefer the environment variable or config file: flags are visible to other users in the process list. |
|||||
| Bearer token | --auth-token |
AGENT_ |
auth. |
— | 0.9.0 |
API key accepted as a Bearer token. |
|||||
Refresh
When and how often Agent Tank asks each CLI for fresh usage data.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Auto-refresh | --auto-refresh--no-auto-refresh |
AGENT_ |
autoRefresh. |
on | 0.9.0 |
Enable or disable background auto-refresh. Turning it off is the same as mode |
|||||
| Refresh mode | --auto-refresh-mode |
AGENT_ |
autoRefresh. |
activity | 0.9.0 |
Refresh strategy: An unknown value falls back to |
|||||
| Refresh interval | --auto-refresh-interval |
AGENT_ |
autoRefresh. |
60 |
0.9.0 |
Auto-refresh interval in seconds for |
|||||
| Refresh cooldown | --refresh-cooldown |
AGENT_ |
refreshCooldown |
30 |
0.9.5 |
Minimum time between refreshes of the same agent, applied to manual refreshes, startup refreshes and detected activity.
|
|||||
| Activity debounce | --activity-debounce |
AGENT_ |
autoRefresh. |
5000 |
0.9.0 |
In |
|||||
| Fresh process | --fresh-process |
AGENT_ |
freshProcess |
off | 0.9.0 |
Spawn a new CLI process for every refresh instead of keeping one session alive. Also disables keepalive. On if any surface turns it on; |
|||||
Auto-refresh modes
| Mode | Description |
|---|---|
activity | Default. Watches known local agent directories and refreshes when activity is detected. |
interval | Refreshes on a fixed timer (--auto-refresh-interval). |
none | No background refresh. Use manual refresh only (POST /refresh or the dashboard buttons). |
# Interval polling
agent-tank --auto-refresh-mode interval
# Manual-only mode
agent-tank --auto-refresh-mode none
# Longer activity debounce
agent-tank --activity-debounce 10000
Activity directories
In activity mode Agent Tank watches these local directories:
| Provider | Watched directories |
|---|---|
| Claude Code | ~/.config/claude/projects/~/.claude/ |
| OpenAI Codex | ~/.codex/sessions/~/.codex/ |
| Antigravity CLI | ~/.gemini/antigravity-cli/ |
If no suitable directories are found, it falls back to interval mode.
Session keepalive
Keepalive helps persistent PTY-backed sessions stay warm. It is disabled automatically with --fresh-process and --once, and is not needed for Codex JSON-RPC mode.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Keepalive | --keepalive--no-keepalive |
AGENT_ |
keepalive. |
on | 0.9.0 |
Enable or disable session keepalive. |
|||||
| Keepalive interval | --keepalive-interval |
AGENT_ |
keepalive. |
300 |
0.9.0 |
Session keepalive interval in seconds. |
|||||
Claude API mode
By default Claude usage is collected via PTY by running /usage. Claude API mode reads the same OAuth credentials the CLI already uses and calls https://api.anthropic.com/api/oauth/usage instead, refreshing expired tokens when needed and falling back to PTY mode if the API path fails.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Claude API mode | --claude-api |
AGENT_ |
claudeApi |
off | 0.9.0 |
Read Claude usage from the Anthropic OAuth usage API instead of the CLI’s On if any surface turns it on; |
|||||
agent-tank --claude --claude-api
# or
AGENT_TANK_CLAUDE_API=1 agent-tank --claude
Usage history
Usage history is stored in SQLite with Node’s built-in node:sqlite, one row per metric per refresh. It needs Node.js 22.5+; on older runtimes Agent Tank logs one warning, keeps running without history and reports store: "none".
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Record history | --history--no-history |
AGENT_ |
history. |
on | 0.10.0 |
Enable or disable usage history recording. When off, |
|||||
| History database | --history-db |
AGENT_ |
history. |
~/ |
0.10.0 |
SQLite history database file. A relative |
|||||
| Retention | --history-retention-days |
AGENT_ |
history. |
14 |
0.9.0 |
Days of usage history to keep. Older rows are deleted on write.
|
|||||
| Dashboard sparkline | --history-chart--no-history-chart |
AGENT_ |
history. |
on | 0.10.0 |
Show or hide the usage-history sparkline on each dashboard card. Never shown while recording is off; |
|||||
Context windows
Corrections to the built-in table of model context windows used for context_window in GET /status.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Context window sizes | — | — | contextWindows |
built-in |
0.10.0 |
Object of model name → token count that adds to, or corrects, the built-in table, e.g. Values set here are reported with |
|||||
{
"contextWindows": {
"gpt-6-astra": 300000,
"gemini-4-argon": 1048576
}
}
Background mode
Start Agent Tank as a detached process: the parent command prints the background PID and log path, then exits.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Background mode | --background--no-background |
AGENT_ |
— | off | 0.9.8 |
Start Agent Tank as a detached background process that prints its PID and log path, then exit the parent command. Cannot be combined with |
|||||
| Background log | — | AGENT_ |
— | temp |
0.9.8 |
Log file for the background child’s stdout and stderr. Defaults to |
|||||
| Startup grace period | — | AGENT_ |
— | 750 |
0.9.8 |
How long the parent waits before reporting background success, in milliseconds; success means the child survived this period. The default is not in the README; it is |
|||||
One-shot output
Fetch usage once, print it and exit, without starting the HTTP server.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Run once | --once |
— | — | off | 0.9.0 |
Fetch usage once and exit, without starting the HTTP server. Auto-refresh and keepalive are off for the run. |
|||||
| JSON output | --json |
— | — | off | 0.9.0 |
Print pure JSON ( |
|||||
General
Loading a config file, and the informational flags.
| Option | CLI flag | Environment variable | Config key | Default | Since |
|---|---|---|---|---|---|
| Config file | --config -c |
— | — | — | 0.9.0 |
Path to a JSON config file. Relative account and history paths inside it are resolved against the file’s directory. |
|||||
| Version | --version-v |
— | — | — | 0.9.3 |
Print the installed Agent Tank version and exit. |
|||||
| Help | --help-h |
— | — | — | 0.9.0 |
Print the option list, environment variables, examples and endpoints, then exit. |
|||||
Full example config file
The config file example from the Agent Tank README, using every documented section:
{
"agents": [
{
"provider": "codex",
"id": "work",
"alias": "Work",
"configPath": "/srv/accounts/codex-work"
},
{
"provider": "codex",
"id": "personal",
"alias": "Personal",
"configPath": "/srv/accounts/codex-personal"
},
{
"provider": "claude",
"id": "client-a",
"alias": "Client A",
"configPath": "./accounts/claude-client-a"
}
],
"port": 8080,
"dockerAccess": true,
"claudeApi": false,
"refreshCooldown": 30,
"autoRefresh": {
"mode": "activity",
"interval": 60,
"activityDebounce": 5000,
"refreshCooldown": 30
},
"keepalive": {
"enabled": true,
"interval": 300
},
"history": {
"enabled": true,
"dbPath": "~/.agent-tank/history.db",
"retentionDays": 14,
"chart": true
},
"contextWindows": {
"gpt-6-astra": 300000
}
}
In 0.10.0, port in the config file has no effect (see Port); pass --port 8080 instead. Keys the example does not show: claude, codex, agy, host, auth.user, auth.pass, auth.token, autoRefresh.enabled, freshProcess.