Skip to main content

vai config

Manage persistent configuration stored in ~/.vai/config.json. Set API keys, default models, MongoDB connection strings, and LLM provider settings.

Synopsis

vai config set <key> [value]
vai config get [key]
vai config delete <key>
vai config path
vai config reset

Description

vai config manages global configuration that persists across sessions. Secrets (API keys, MongoDB URIs) are masked in output. Values can be read from stdin for security (avoids shell history).

Subcommands

SubcommandDescription
set <key> [value]Set a config value (omit value to read from stdin)
get [key]Get a value, or all values if no key is specified
delete <key>Remove a config value
pathShow config file path
resetDelete all configuration

Config Keys

KeyDescription
api-keyVoyage AI API key
mongodb-uriMongoDB Atlas connection string
base-urlVoyage AI API base URL (override for Atlas AI endpoint)
default-modelDefault embedding model
default-dimensionsDefault output dimensions
default-dbDefault MongoDB database for workflows and commands
default-collectionDefault MongoDB collection for workflows and commands
llm-providerLLM provider for chat: anthropic, openai, ollama
llm-api-keyLLM API key
llm-modelLLM model name
llm-base-urlLLM base URL (for Ollama)
show-costShow cost estimates after operations (true/false)
telemetryEnable/disable anonymous usage telemetry (true/false)

Examples

Set your API key securely

vai config set api-key --stdin <<< "your-api-key-here"

Set MongoDB URI

vai config set mongodb-uri "mongodb+srv://user:pass@cluster.mongodb.net"

Set default model

vai config set default-model voyage-4-lite

Set default database and collection

vai config set default-db my_knowledge_base
vai config set default-collection documents

This removes the need to specify --db and --collection on every command. Workflows, vai query, vai store, and other database commands will use these defaults automatically.

View all config

vai config get

Show config file location

vai config path

Tips

  • Use --stdin or pipe values to avoid secrets appearing in shell history.
  • Config values are overridden by environment variables (VOYAGE_API_KEY, MONGODB_URI) and CLI flags.
  • Project-level settings in .vai.json take precedence over global config for project-specific values (model, db, collection).
  • vai init — Create project-level .vai.json config
  • vai ping — Test connectivity with your configured credentials