Skip to main content

Configuration

Environment variables

VariableDescriptionDefault
ANTHROPIC_API_KEYAPI key for Anthropic models.required for Anthropic
OPENAI_API_KEYAPI key for OpenAI models.optional
GOOGLE_API_KEYAPI key for Google Gemini models.optional
AI_PROVIDERPreferred provider (anthropic, openai, google).first available
AI_MODELDefault model identifier for the selected provider.provider-specific
AI_TEMPERATURETemperature applied to chat completions.0.2
AI_MAX_STEPSMaximum tool steps per request.10
AI_MAX_TOKENSOptional output token budget.unset

Read and write logic lives in src/services/ConfigService.ts.

Persisted keys

Stored under ~/.cliq/storage/.

NamespaceKeysDescription
configprovider.json, model.jsonCurrent provider/model set via /model.
session{sessionId}.jsonSession metadata (directory, title, timestamps).
message/{sessionId}{messageId}.jsonIndividual message entries for the session.

Persistence uses FileKeyValueStore (src/persistence/FileKeyValueStore.ts).

Rotate secrets safely

Instead of editing files in ~/.cliq/storage/ by hand, use /model or update environment variables and restart the CLI. ConfigService will regenerate the combined configuration automatically.