Overview
rousseau chat opens the interactive Bubble Tea TUI (source: internal/cli/chat.go and internal/tui/model.go). It wires together the session store (SQLite at state.path), the tool registry (read, write, edit, grep, bash), the approval policy, and the LLM provider — then hands control to the terminal UI.
This is the primary interactive surface. It is the one subcommand that expects a real user at the keyboard; every other transport subcommand (whatsapp, slack, discord, and friends) is a headless daemon that reuses the same wiring underneath.
Synopsis
rousseau chat [--session <id>] [--title <string>] [--config <path>]
Flags
| Flag | Type | Default | Effect |
|---|---|---|---|
--session |
string | empty | Resume an existing session by id (loads via state.Store.Load). |
--title |
string | "chat <UTC-date>" |
Title assigned when creating a new session. Ignored when --session is set. |
--config |
string | $XDG_CONFIG_HOME/rousseau/config.yaml |
Path to the YAML config file. Persistent flag inherited from the root command. |
There are no other flags on chat. Everything else — provider, log level, approver — is picked up from config, environment, or hard-coded defaults.
Environment variables
rousseau chat inherits every environment variable resolved by config.Load (see internal/config/config.go). The most relevant ones:
| Variable | Effect |
|---|---|
ROUSSEAU_PROVIDER |
Overrides provider. |
ROUSSEAU_LOG_LEVEL |
Overrides log.level (debug, info, warn, error). |
ROUSSEAU_LOG_FORMAT |
Overrides log.format (text or json). |
ROUSSEAU_STATE_PATH |
Overrides the SQLite session store location. |
XDG_CONFIG_HOME |
Config discovery base directory. |
XDG_DATA_HOME |
State discovery base directory. |
| Variable | Effect |
|---|---|
ANTHROPIC_API_KEY |
Read directly by config.Load and injected into anthropic.api_key regardless of provider selection. |
ROUSSEAU_ANTHROPIC_MODEL |
Overrides anthropic.model. |
ROUSSEAU_CLAUDECLI_BINARY |
Overrides claudecli.binary. |
AWS_PROFILE, AWS_REGION |
Consumed by Bedrock via the AWS credential chain. |
GOOGLE_APPLICATION_CREDENTIALS |
Consumed by Vertex if vertex.credentials_file is empty. |
| Variable | Effect |
|---|---|
TERM |
Bubble Tea uses this to select the renderer. Prefer xterm-256color or screen-256color. |
NO_COLOR |
Suppresses ANSI colour. |
HOME |
Resolves default paths for state, config, whatsapp store. |
Provider selection precedence
The provider is resolved in the order flag > env > file > default:
--configYAMLprovider:field.ROUSSEAU_PROVIDERenvironment variable.- Hard-coded default
claudecli(set insetDefaults).
The provider factory (buildProvider in internal/cli/provider.go) is called before the TUI starts; a misconfigured provider aborts the command with a non-zero exit code before the screen switches to alt-screen mode.
Session-store interaction
- The store is opened at
state.path(default~/.local/share/rousseau/sessions.db). Missing parent directories are created with mode0755. --session <id>callsstore.Load(ctx, id). An unknown id returns an error.- Without
--session, a freshagent.Sessionis created and immediately persisted so subsequentrousseau session listcalls see it. - Every message committed inside the TUI is saved via
store.Save. The store closes on TUI exit (best-effort).
Exit codes
| Code | Meaning |
|---|---|
| 0 | Clean exit (Ctrl+C, :q, or provider EOF). |
| 1 | Configuration, provider, or store error before TUI startup. |
| 130 | SIGINT while inside the TUI (Bubble Tea exits with 130 by convention). |
Worked examples
# 1. Default: start a fresh session with an auto-generated title
rousseau chat
# 2. Resume yesterday's session (find the id with `rousseau session list`)
rousseau chat --session 3f4b1c9e-…
# 3. Named session, structured JSON logs to a file
ROUSSEAU_LOG_FORMAT=json rousseau chat --title "auth refactor" 2>chat.log
# 4. Point at a project-scoped config
rousseau chat --config ./ops/rousseau.yaml
Common failure modes
claudecli: exec: "claude": executable file not found— the default provider needs theclaudeCLI on$PATH. Either install Claude Code or setprovider: anthropicwith an API key. See Providers: claudecli.state: open …/sessions.db: unable to open database file— the parent directory is not writable. Runrousseau doctorfor the resolved path.session not found— the id passed to--sessiondoes not exist. Userousseau session listto discover valid ids.
Related pages
- Reference: CLI Commands — the full command tree table.
- Reference: Config Schema — every YAML key.
- Reference: Session Store — the SQLite schema.
- User Guide: TUI — keybindings and interaction model.
- User Guide: Tools — the built-in tool schemas.
- Providers: claudecli — default provider setup.