Configuration
Where the CLI reads settings from, environment variables that override them, output formats, and how to opt out of telemetry.
Config file
~/.dock/config.jsonFile mode 0600 (owner read/write only). Tracks signed-in accounts + defaults. Don't commit this file.
{
"default": "vector-build",
"format": "table",
"telemetry": true,
"accounts": {
"vector-build": { "user": "you@vector.build", ... }
}
}The auth token is stored under the field name accessToken. Agent scripts that read the file directly should reach for that field, not api_key or other XDG conventions. The CLI does not write to ~/.config/dock/credentials.json: that path is a deprecated read-only fallback for older agent onboarding docs; the canonical path above is the one to script against.
Environment variables
| Var | Description |
|---|---|
DOCK_API_KEY | Bearer token. Overrides the OAuth token in the config file. Use for headless / CI / agent contexts. |
DOCK_ORG | Force operations to a specific org slug regardless of the config-file default. Useful for scripts that should be unambiguous. |
DOCK_BASE_URL | Defaults to https://trydock.ai. Override for staging or local dev. |
DOCK_FORMAT | Default output format: table · json · csv · markdown. Overrides the config file. Per-command --format flag overrides this. |
DOCK_NO_TELEMETRY | Set to any non-empty value to opt out of anonymous usage telemetry. See below. |
NO_COLOR | Set to disable colored output. Standard cross-tool env var. |
Output formats
table(default): ASCII table for human reading. Auto-truncates wide columns.json: machine- readable. Pipe intojqfor further processing.csv: spreadsheet- ready. Includes a header row.markdown: GitHub-flavored markdown table. Useful for piping into email or chat.
Telemetry
The CLI sends anonymous usage data on each invocation:
- Command name (e.g.
workspaces.list) - Exit code (0 / non-0)
- Duration (ms bucket)
- CLI version + Node version + OS
We do NOT send: command arguments, workspace names, row contents, your email, your IP, or anything else identifying. The full source is open at github.com/try-dock-ai/cli.
Opt out: DOCK_NO_TELEMETRY=1 or dock telemetry off.
Frequently asked questions
- Where is the Dock CLI config file?
- `~/.dock/config.json` (mode 0600). Holds the API token, default org, output preferences, telemetry opt-out. Override per-call via env vars or flags; the file is the persistent default.
- How do I set my default Dock org for the CLI?
- `dock org switch <slug>`, or edit `~/.dock/config.json` under `defaultOrg`. Subsequent commands use this org without `--org` flag. Useful when you mostly work in one org but occasionally cross over.
- How do I configure the Dock CLI output format?
- Three formats: `--output table` (default, human-readable), `--output json` (machine-readable), `--output csv` (spreadsheet-friendly). Set persistently in config.json under `output: 'json'` to default to JSON for scripting.
- Can I disable color output in the Dock CLI?
- Yes. Set `NO_COLOR=1` env var (standards-compliant), or `--no-color` flag, or `color: false` in config.json. Useful for CI logs that strip ANSI codes or for screen readers.
- How do I make the Dock CLI quieter for scripting?
- `--quiet` flag suppresses non-error output. Combine with `--output json` for grep-friendly results. Or pipe through `jq -r` to extract specific fields.
- How do I disable Dock CLI telemetry?
- `DOCK_NO_TELEMETRY=1` env var, or `telemetry: false` in config.json. Telemetry collects anonymized command names + exit codes only; no workspace data, no file paths.
- How do I use a custom Dock instance URL with the CLI?
- `DOCK_API_URL=https://your-instance/api` env var, or `apiUrl` in config.json. Defaults to `https://trydock.ai/api`. For self-hosted Dock instances or staging environments, override here.
- How do I check the Dock CLI version?
- `dock --version` prints the installed version + build commit. Upgrade via your package manager (`npm i -g @trydock/cli`).
- Can I override Dock CLI config per-project?
- Yes. The CLI reads `.dockrc` in the current directory before falling back to `~/.dock/config.json`. Useful for project-scoped settings: a different default org or output format per repo.
- What happens to my Dock CLI config when I update the CLI?
- Preserved. Config schema is forward-compatible; new versions read old configs without migration. New config keys default sensibly. Major version bumps may add a one-time migration prompt; never silent loss.
Related
- Authentication: credential storage detail.
- Examples: uses these env vars in CI / cron contexts.