Skip to main content

sync_codex_auth_from_codex_cli

Function sync_codex_auth_from_codex_cli 

Source
pub fn sync_codex_auth_from_codex_cli(
    cfg: &mut ProxyConfig,
    options: SyncCodexAuthFromCodexOptions,
) -> Result<SyncCodexAuthFromCodexReport, Error>
Expand description

Sync Codex auth env vars from ~/.codex/config.toml + auth.json without changing routing config.

Default behavior:

  • Only updates upstreams that are strongly associated with a Codex CLI provider:
    • config key equals provider_id; or
    • upstream.tags.provider_id equals provider_id.
  • Does NOT change active / enabled / level unless options.set_active = true.
  • Does NOT write secrets to disk; only syncs env var names (e.g. OPENAI_API_KEY).