fabro/docs/reference/cli-configuration.mdx
Bryan Helmkamp 1825b61b0e Rename arc agent CLI subcommand to arc exec
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:38:03 -05:00

127 lines
3.4 KiB
Text

---
title: "CLI Configuration"
description: "Configure default settings for the Arc CLI with cli.toml"
---
Arc loads CLI defaults from `~/.arc/cli.toml` so you don't have to pass common flags every time. The file is optional — if it doesn't exist, built-in defaults are used.
## File location
The default path is `~/.arc/cli.toml`. Arc silently skips loading if the file is missing.
## Precedence
CLI flags always take the highest priority:
1. **CLI flags** — always win
2. **`cli.toml`** — used when no flag is provided
3. **Built-in defaults** — used when neither flag nor config is set
## Full example
```toml title="cli.toml"
mode = "server"
[server]
base_url = "https://arc.example.com:3000"
[server.tls]
cert = "~/.arc/tls/client.crt"
key = "~/.arc/tls/client.key"
ca = "~/.arc/tls/ca.crt"
[exec]
provider = "anthropic"
model = "claude-opus-4-6"
permissions = "read-write"
output_format = "text"
[llm]
model = "claude-sonnet-4-5"
```
All fields are optional. You can include just the sections and keys you want to override.
## `[exec]` section
Defaults for `arc exec` sessions.
| Key | Description | Values | Default |
|---|---|---|---|
| `provider` | LLM provider | `"anthropic"`, `"openai"`, `"gemini"`, etc. | `"anthropic"` |
| `model` | Model name | Any model ID from `arc model list` | Per provider |
| `permissions` | Tool permission level | `"read-only"`, `"read-write"`, `"full"` | `"read-write"` |
| `output_format` | Output format | `"text"`, `"json"` | `"text"` |
### Permission levels
- **`read-only`** — auto-approves read tools (`read_file`, `grep`, `glob`, `list_dir`) and subagent tools
- **`read-write`** — adds write tools (`write_file`, `edit_file`, `apply_patch`)
- **`full`** — allows all tools including shell commands
Tools outside the permission level are interactively prompted (if a TTY is present) or denied (with `--auto-approve`).
### Output formats
- **`text`** — human-readable terminal output
- **`json`** — NDJSON event stream
## `[llm]` section
Defaults for `arc llm prompt` and `arc llm chat`.
| Key | Description | Values | Default |
|---|---|---|---|
| `model` | Model name | Any model ID from `arc model list` | Per provider |
<Note>
The `[llm]` section only sets the default model. Use `[exec]` to configure provider, permissions, and output format for `arc exec`.
</Note>
## `mode`
Controls whether commands run in-process or delegate to a running Arc API server.
| Value | Description |
|---|---|
| `"standalone"` | Execute locally (default) |
| `"server"` | Delegate to an Arc API server |
Override with the `--mode` CLI flag:
```bash
arc --mode server models list
```
## `[server]` section
Configuration for server mode.
| Key | Description | Default |
|---|---|---|
| `base_url` | Server URL | `"http://localhost:3000"` |
Override the URL with the `--server-url` CLI flag:
```bash
arc --mode server --server-url https://arc.example.com:3000 models list
```
### `[server.tls]` section
Optional mTLS configuration for authenticating with the server. When present, the CLI presents a client certificate during the TLS handshake.
| Key | Description |
|---|---|
| `cert` | Path to client certificate PEM file |
| `key` | Path to client private key PEM file |
| `ca` | Path to CA certificate PEM file (to verify the server) |
Paths support `~/` expansion. Example:
```toml title="cli.toml"
[server.tls]
cert = "~/.arc/tls/client.crt"
key = "~/.arc/tls/client.key"
ca = "~/.arc/tls/ca.crt"
```