Skip to main content

setup_primary_client

Function setup_primary_client 

Source
pub fn setup_primary_client(config: &AppConfig) -> Result<AiClient>
Expand description

Sets up the primary AI client with credential resolution.

For the Anthropic provider, attempts to use Claude OAuth credentials in this order:

  1. Existing token in OS keyring
  2. ~/.claude/credentials.json file
  3. Environment variable (fallback)

For other providers, uses the standard environment variable path.

ยงErrors

Returns an error if client creation fails.