From 6fc444528f81972d3e0c9633acd716e5cf01e606 Mon Sep 17 00:00:00 2001 From: Het Dave Date: Fri, 3 Jul 2026 13:39:24 +0100 Subject: [PATCH] feat(codex): install via curl script instead of npm Codex was the only shell-installable provider still defaulting to `npm install -g @openai/codex`. OpenAI ships an official install script (the same one referenced by the existing Windows PowerShell installer), so make curl the recommended method on macOS/Linux for consistency with claude, grok, droid, and the other curl-based providers. npm and the homebrew cask remain as fallback options, and updates still resolve through the npm release source. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../core/agents/agent-provider-registry.ts | 2 +- .../plugins/src/agents/impl/codex/index.ts | 61 ++++++++++++++++--- 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts b/apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts index 2658e7cb6a..0e5e987c4f 100644 --- a/apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts +++ b/apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts @@ -107,7 +107,7 @@ export const AGENT_PROVIDERS: AgentProviderDefinition[] = [ description: 'CLI that connects to OpenAI models for project-aware code assistance and terminal workflows.', docUrl: 'https://github.com/openai/codex', - installCommand: 'npm install -g @openai/codex', + installCommand: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh', commands: ['codex'], versionArgs: ['--version'], cli: 'codex', diff --git a/packages/plugins/src/agents/impl/codex/index.ts b/packages/plugins/src/agents/impl/codex/index.ts index c302537c7e..127c6ac12d 100644 --- a/packages/plugins/src/agents/impl/codex/index.ts +++ b/packages/plugins/src/agents/impl/codex/index.ts @@ -6,7 +6,6 @@ import { buildStandardCommand, codexMcpAdapter, homebrewOption, - npmDependency, } from '@emdash/core/agents/plugins/helpers'; import { buildCodexHookConfig } from './hooks'; import { icon } from './icon'; @@ -54,12 +53,40 @@ export const plugin = definePlugin( scope: 'global', supportedEvents: ['notification', 'stop', 'session'], }, - hostDependency: npmDependency({ + hostDependency: { id: 'codex', - package: '@openai/codex', - extraOptions: { - macos: [homebrewOption({ formula: 'codex', cask: true })], - linux: [homebrewOption({ formula: 'codex', cask: true })], + binaryNames: ['codex'], + installCommands: { + macos: [ + { + method: 'curl', + command: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh', + updateCommand: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh', + recommended: true, + }, + { + method: 'npm', + command: 'npm install -g @openai/codex', + updateCommand: 'npm install -g @openai/codex', + uninstallCommand: 'npm uninstall -g @openai/codex', + }, + homebrewOption({ formula: 'codex', cask: true }), + ], + linux: [ + { + method: 'curl', + command: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh', + updateCommand: 'curl -fsSL https://chatgpt.com/codex/install.sh | sh', + recommended: true, + }, + { + method: 'npm', + command: 'npm install -g @openai/codex', + updateCommand: 'npm install -g @openai/codex', + uninstallCommand: 'npm uninstall -g @openai/codex', + }, + homebrewOption({ formula: 'codex', cask: true }), + ], windows: [ { method: 'powershell', @@ -67,10 +94,30 @@ export const plugin = definePlugin( 'powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"', updateCommand: 'powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"', + recommended: true, + }, + { + method: 'npm', + command: 'npm install -g @openai/codex', + updateCommand: 'npm install -g @openai/codex', + uninstallCommand: 'npm uninstall -g @openai/codex', }, ], }, - }), + updates: { + kind: 'supported', + releaseSource: { + kind: 'npm', + package: '@openai/codex', + }, + update: { + kind: 'package-manager', + }, + }, + uninstall: { + kind: 'package-manager', + }, + }, mcp: { kind: 'supported', scope: 'global',