Skip to content

Rawi (راوي) Documentation | Configure Settings

Configuration and Credential File Settings in Rawi CLI

Section titled “Configuration and Credential File Settings in Rawi CLI”

Rawi CLI allows you to save your frequently used configuration settings and credentials in files managed by the CLI. These files are organized into profiles, making it easy to switch between different environments or accounts.

  • Credentials are stored in a file named credentials in the ~/.rawi/ directory.
  • Configuration options are stored in a file named config in the same directory.

You can override the default location by setting environment variables (e.g., RAWI_CONFIG_FILE, RAWI_CREDENTIALS_FILE).

  1. Use a different profile for a single command:

    Terminal window
    rawi ask --profile work "What is the weather today?"

Rawi CLI stores all credentials and provider settings in a single JSON file at ~/.rawi/credentials.

Each top-level key is a profile name (e.g., default, openai, gemini, etc.), and the value is an object containing provider, model, API key, and any provider-specific settings.

Example: ~/.rawi/credentials

{
"default": {
"provider": "qwen",
"model": "qwen-plus",
"apiKey": "test_api_key",
"temperature": 0.7,
"maxTokens": 2048,
"language": "english",
"providerSettings": {
"baseURL": "https://custom.qwen.endpoint.com/v1"
}
},
"openai": {
"provider": "openai",
"model": "o3-mini",
"temperature": 0.7,
"maxTokens": 2048,
"language": "english",
"apiKey": "sk-proj-..."
}
// ...other profiles...
}

There is no ~/.rawi/config file by default. All configuration is managed through the credentials JSON file.

  1. Set up your configuration interactively:

    Terminal window
    rawi configure
  • provider: The AI provider (e.g., openai, anthropic, google, ollama, etc.)
  • model: The model to use (e.g., gpt-4o, claude-3-sonnet-20240229)
  • output: Output format (json, text, markdown)
  • api_key: Your API key (store in credentials file)
  • base_url: (Optional) Custom API endpoint
  • profile: Profile name

Settings are resolved in the following order:

  1. Command line options (e.g., --provider, --model)
  2. Environment variables (e.g., RAWI_PROVIDER, RAWI_API_KEY)
  3. Profile in config/credentials files
  4. Default profile
  1. Switch and use a profile in one command: bash rawi configure --profile work --provider anthropic --model claude-3-sonnet-20240229 --api-key sk-ant-yyyyyy rawi ask --profile work "Summarize this document."
  • Keep your API keys secure. Do not share your ~/.rawi/credentials file.
  • For troubleshooting configuration issues, see the Troubleshooting Guide.

This format provides clear, AWS CLI-style documentation for your users, making it easy to understand and manage Rawi CLI configuration.