docs: document auth profile selection

This commit is contained in:
Peter Steinberger
2026-01-09 14:17:49 +00:00
parent 407a3c2c10
commit 7cb9e95a53
2 changed files with 49 additions and 0 deletions

View File

@@ -67,6 +67,24 @@ clawdbot models status
clawdbot doctor
```
## Controlling which credential is used
### Per-session (chat command)
Use `/model <alias-or-id>@<profileId>` to pin a specific provider credential for the current session (example profile ids: `anthropic:claude-cli`, `anthropic:default`). Use `/model status` to see candidates + which one is next.
### Per-agent (CLI override)
Set an explicit auth profile order override for an agent (stored in that agents `auth-profiles.json`):
```bash
clawdbot models auth order get --provider anthropic
clawdbot models auth order set --provider anthropic anthropic:claude-cli
clawdbot models auth order clear --provider anthropic
```
Use `--agent <id>` to target a specific agent; omit it to use the configured default agent.
## How sync works
1. **Claude Code** stores credentials in `~/.claude/.credentials.json` (or

View File

@@ -280,6 +280,15 @@ Use the `/model` command as a standalone message:
You can list available models with `/model`, `/model list`, or `/model status`.
You can also force a specific auth profile for the provider (per session):
```
/model opus@anthropic:claude-cli
/model opus@anthropic:default
```
Tip: `/model status` shows which agent is active, which `auth-profiles.json` file is being used, and which auth profile will be tried next.
### Why do I see “Model … is not allowed” and then no reply?
If `agents.defaults.models` is set, it becomes the **allowlist** for `/model` and any
@@ -413,6 +422,28 @@ Clawdbot uses providerprefixed IDs like:
Yes. Config supports optional metadata for profiles and an ordering per provider (`auth.order.<provider>`). This does **not** store secrets; it maps IDs to provider/mode and sets rotation order.
You can also set a **per-agent** order override (stored in that agents `auth-profiles.json`) via the CLI:
```bash
# Defaults to the configured default agent (omit --agent)
clawdbot models auth order get --provider anthropic
# Lock rotation to a single profile (only try this one)
clawdbot models auth order set --provider anthropic anthropic:claude-cli
# Or set an explicit order (fallback within provider)
clawdbot models auth order set --provider anthropic anthropic:claude-cli anthropic:default
# Clear override (fall back to config auth.order / round-robin)
clawdbot models auth order clear --provider anthropic
```
To target a specific agent:
```bash
clawdbot models auth order set --provider anthropic --agent main anthropic:claude-cli
```
### OAuth vs API key: whats the difference?
Clawdbot supports both: