Skip to content

Rawi (راوي) Documentation | Configure

The Rawi Command Line Interface (Rawi CLI) uses configuration settings to determine how it interacts with AI providers and manages your sessions. These settings include:

  • Credentials: Identify who is calling the API. API keys or tokens are used to authenticate your requests and determine your access permissions.
  • Provider and Model: Specify which AI provider and model to use for your requests.
  • Other options: Such as default profile, output format, and custom endpoints.

Rawi CLI reads configuration and credentials from several locations, in the following order of precedence:

  1. Command line options – Overrides all other settings. Example: --provider, --model, --api-key, --profile.
  2. Environment variables – Set variables like OPENAI_API_KEY or RAWI_PROFILE in your shell.
  3. Profile configuration files – Stored in ~/.rawi/credentials and ~/.rawi/config.
  4. Default profile – Used if no profile is specified.
  1. Set up your credentials and default provider:

    Terminal window
    rawi configure
    # Example prompts:
    # Provider [openai]: openai
    # Model [gpt-4o]: gpt-4o
    # API Key [None]: sk-...
  2. Configure a named profile:

    Terminal window
    rawi configure --profile work
    # Provider [openai]: openai
    # Model [gpt-4o]: gpt-4o
    # API Key [None]: sk-...
  • Linux/macOS: ~/.rawi/credentials
  • Windows: %USERPROFILE%\.rawi\credentials

For more details, see the Troubleshooting Guide or run rawi configure --help.