New pages: - cli/overview — concise intro, install snippet, two-mode summary, flags table - cli/install — install, auth (login, API key, local key), requirements - cli/tui-mode — interactive session, @context, slash commands, resume, tool permissions - cli/headless-mode — -p flag, piping, output options, CI auth, examples - cli/configuration — config resolution, --config, /config, config.yaml, CLI flags, secrets - cli/tool-permissions — permission levels, defaults, flags, patterns, permissions.yaml, precedence, modes Removed: - cli/quick-start — content distributed into mode-specific pages - cli/guides — stale redirect Updated docs.json navigation to match new structure.
77 lines
2 KiB
Text
77 lines
2 KiB
Text
---
|
|
title: "Configuration"
|
|
---
|
|
|
|
`cn` resolves its configuration (models, MCP servers, rules, etc.) from several sources, in this order:
|
|
|
|
1. **`--config` flag** — a file path or hub assistant slug passed at launch
|
|
2. **Saved config** — the last-used configuration, persisted across sessions
|
|
3. **Default** — your first assistant from [Continue](https://continue.dev), or `~/.continue/config.yaml` if you're not logged in
|
|
|
|
## `--config` flag
|
|
|
|
Point `cn` at a local YAML file or a hub assistant:
|
|
|
|
```bash
|
|
# Local file
|
|
cn --config ./my-config.yaml
|
|
|
|
# Hub assistant
|
|
cn --config my-org/my-assistant
|
|
```
|
|
|
|
This overrides any saved preference for the current session.
|
|
|
|
## Switching at runtime
|
|
|
|
Use `/config` inside a TUI session to switch between available configurations:
|
|
|
|
```
|
|
> /config
|
|
```
|
|
|
|
This shows your available assistants and local configs. The selection is saved for next time.
|
|
|
|
## `config.yaml`
|
|
|
|
If you're not logged in to Continue, `cn` looks for `~/.continue/config.yaml`. This file uses the same format as the IDE extensions — see [config.yaml reference](/customize/deep-dives/configuration) for the full schema.
|
|
|
|
## CLI-specific flags
|
|
|
|
Several flags inject configuration at launch without editing a file:
|
|
|
|
```bash
|
|
# Add models from the hub
|
|
cn --model my-org/claude-sonnet
|
|
|
|
# Add MCP servers from the hub
|
|
cn --mcp my-org/github-mcp
|
|
|
|
# Add rules (file path, hub slug, or inline string)
|
|
cn --rule ./rules/style.md
|
|
cn --rule my-org/code-review-rules
|
|
cn --rule "Always use TypeScript strict mode"
|
|
|
|
# Load an agent file from the hub
|
|
cn --agent my-org/pr-reviewer
|
|
```
|
|
|
|
All of these are repeatable — pass them multiple times to add multiple items.
|
|
|
|
## Organization
|
|
|
|
If you belong to multiple organizations on Continue, use `--org` to specify which one:
|
|
|
|
```bash
|
|
cn --org my-team -p "Review this PR"
|
|
```
|
|
|
|
In TUI mode, `/config` lets you switch organizations interactively.
|
|
|
|
## Secrets
|
|
|
|
Store sensitive values (API keys, tokens) in [Continue → Settings → Secrets](https://continue.dev/settings/secrets). Reference them in config with:
|
|
|
|
```yaml
|
|
${{ secrets.MY_API_KEY }}
|
|
```
|