screenpipe/screenpipe · error

install Codex before connecting ChatGPT

Error message

install Codex before connecting ChatGPT

What it means

`connect_provider` starts the provider CLI's first-party login flow. For Codex it first resolves the `codex` binary via `provider_binary`; if the binary is not found on PATH (or the configured location), it throws this error because the ChatGPT sign-in cannot be performed without the Codex CLI installed. Credentials stay in the Codex CLI; screenpipe only checks readiness.

Source

Thrown at crates/screenpipe-core/src/agents/cloud.rs:352

                provider: "cursor",
                available: true,
                configured: cursor_configured,
                detail: if cursor_configured {
                    "connected to your Cursor Cloud Agents".into()
                } else {
                    "add a Cursor API key once".into()
                },
            },
        ]
    }

    /// Starts the provider's first-party account flow. Credentials remain in
    /// the provider CLI; screenpipe only checks whether cloud use is ready.
    pub async fn connect_provider(&self, provider: CloudAgentProvider) -> Result<()> {
        match provider {
            CloudAgentProvider::Codex => {
                let path = Self::provider_binary(provider)
                    .ok_or_else(|| anyhow!("install Codex before connecting ChatGPT"))?;
                let output = Self::run_cli(&path, vec!["login".into()], None).await?;
                if !output.success {
                    return Err(anyhow!("Codex could not complete the ChatGPT sign-in"));
                }
                let (_, chatgpt) = Self::codex_auth_status(&path).await;
                if !chatgpt {
                    return Err(anyhow!(
                        "Codex Cloud requires ChatGPT sign-in; choose ChatGPT in the Codex login flow"
                    ));
                }
            }
            CloudAgentProvider::Claude => {
                let path = Self::provider_binary(provider)
                    .ok_or_else(|| anyhow!("install Claude Code before connecting Claude"))?;
                if !Self::claude_supports_cloud(&path).await {
                    let output = Self::run_cli(&path, vec!["update".into()], None).await?;
                    if !output.success || !Self::claude_supports_cloud(&path).await {
                        return Err(anyhow!(

View on GitHub (pinned to 4ebf712990)

Solutions

  1. Install Codex (e.g. `npm install -g @openai/codex`) and verify with `which codex`
  2. If codex is installed but screenpipe can't find it, launch screenpipe from a shell that has your PATH set, or symlink the binary into a standard PATH dir like /usr/local/bin
  3. Retry `connect_provider` after installation

Example fix

// before (binary missing)
$ which codex  // not found
// after
$ npm install -g @openai/codex
$ which codex  // /usr/local/bin/codex
Defensive patterns

Strategy: validation

Validate before calling

use std::process::Command;
fn codex_installed() -> bool {
    Command::new("codex").arg("--version").output().map(|o| o.status.success()).unwrap_or(false)
}

Try / catch

match manager.connect_provider(CloudAgentProvider::Codex).await {
    Err(e) if e.to_string().contains("install Codex") => {
        eprintln!("install with: npm install -g @openai/codex");
    }
    r => r?,
}

Prevention

When it happens

Trigger: Calling `connect_provider(CloudAgentProvider::Codex)` on a machine where the `codex` executable is not installed or not on PATH.

Common situations: Fresh machine setup before installing Codex; codex installed via a version manager whose PATH is not inherited by the screenpipe process (GUI launch); binary renamed or removed after an upgrade.

Related errors


AI-assisted analysis of screenpipe/screenpipe@4ebf712990 (2026-09-01). Data as JSON: /api/errors/7ae31e9d8b15c3c6. Report an issue: GitHub.