Skip to content

feat(codex): install via curl script instead of npm#2758

Open
hetdv wants to merge 1 commit into
generalaction:mainfrom
hetdv:emdash/codex-curl-aulac
Open

feat(codex): install via curl script instead of npm#2758
hetdv wants to merge 1 commit into
generalaction:mainfrom
hetdv:emdash/codex-curl-aulac

Conversation

@hetdv

@hetdv hetdv commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Codex was the only shell-installable provider still defaulting to npm install -g @openai/codex. OpenAI ships an official install script — the same one already referenced by the existing Windows PowerShell installer (chatgpt.com/codex/install.ps1) — so this makes curl the recommended install method on macOS/Linux, consistent with claude, grok, droid, and the other curl-based providers.

Changes

  • packages/plugins/src/agents/impl/codex/index.ts — replaced the npmDependency(...) helper with an explicit hostDependency descriptor (mirroring the grok pattern):
    • macOS/Linux: curl -fsSL https://chatgpt.com/codex/install.sh | sh (recommended), with npm and the homebrew cask kept as fallbacks
    • Windows: existing PowerShell installer now marked recommended, with npm fallback
    • updates continue to resolve through the npm release source (@openai/codex)
  • apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts — updated the flat installCommand metadata string to the curl command.

Checks run

  • @emdash/plugins typecheck ✅ and tests ✅ (101 passed, incl. the generic install-command validation suite)
  • @emdash/emdash-desktop typecheck ✅
  • @emdash/core host-dependencies tests ✅ (80 passed)
  • Desktop dependencies tests ✅ (34 passed; the install-runner suite was skipped locally only because Electron's binary wasn't downloaded in this sandbox — unrelated to the change)

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR changes the Codex CLI install recommendation from npm install -g @openai/codex to curl -fsSL https://chatgpt.com/codex/install.sh | sh, aligning Codex with the curl-first pattern already used by claude, grok, and other providers. Both the plugin descriptor and the flat installCommand metadata in the desktop registry are updated.

  • packages/plugins/src/agents/impl/codex/index.ts: Replaces the npmDependency() helper with an explicit hostDependency object; curl is now the recommended install method on macOS/Linux, PowerShell on Windows, with npm and Homebrew kept as fallbacks. Version update resolution is preserved via the npm release source.
  • apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts: Updates the flat installCommand string to the curl command, keeping it consistent with the plugin definition.

Confidence Score: 4/5

The install-method change is straightforward and the curl URL mirrors the existing Windows PowerShell installer already in the codebase. The uninstall path for curl-installed users is broken but does not affect installation, update, or normal usage.

The curl and npm fallback install options are correctly structured. However, uninstall: { kind: 'package-manager' } is declared while the recommended curl option carries no uninstallCommand, so any user who installed via curl will encounter a runtime no-uninstall-command error when they attempt to uninstall through the app. The analogous grok plugin avoids this by omitting the uninstall field entirely.

packages/plugins/src/agents/impl/codex/index.ts — the uninstall declaration needs attention; apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts is fine.

Important Files Changed

Filename Overview
packages/plugins/src/agents/impl/codex/index.ts Migrates hostDependency from npmDependency() helper to an explicit curl-first descriptor mirroring grok, but carries over uninstall: { kind: 'package-manager' } without an uninstallCommand on the curl option, leaving curl-installed users with a broken uninstall path
apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts Single-line update to flat installCommand metadata string from npm to curl — consistent with the plugin change

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User triggers Uninstall for Codex] --> B{Detect install method}
    B -->|method = curl recommended path| C[Look up curl InstallOption]
    C --> D{uninstallCommand present?}
    D -->|No — missing on curl option| E[resolveUpdatePlan returns kind: none]
    E --> F[Runtime returns err: no-uninstall-command]
    F --> G[UI shows error to user]
    B -->|method = npm fallback path| H[Look up npm InstallOption]
    H --> I{uninstallCommand present?}
    I -->|Yes: npm uninstall -g @openai/codex| J[Run uninstall command]
    J --> K[Uninstall succeeds]
    B -->|method = undefined no prior probe| L[Fall back to recommended = curl]
    L --> D
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User triggers Uninstall for Codex] --> B{Detect install method}
    B -->|method = curl recommended path| C[Look up curl InstallOption]
    C --> D{uninstallCommand present?}
    D -->|No — missing on curl option| E[resolveUpdatePlan returns kind: none]
    E --> F[Runtime returns err: no-uninstall-command]
    F --> G[UI shows error to user]
    B -->|method = npm fallback path| H[Look up npm InstallOption]
    H --> I{uninstallCommand present?}
    I -->|Yes: npm uninstall -g @openai/codex| J[Run uninstall command]
    J --> K[Uninstall succeeds]
    B -->|method = undefined no prior probe| L[Fall back to recommended = curl]
    L --> D
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/plugins/src/agents/impl/codex/index.ts:117-119
**Uninstall declared but broken for the recommended curl install path**

`uninstall: { kind: 'package-manager' }` tells the runtime to run the `uninstallCommand` for whichever method was used to install. The `curl` option (the recommended one) has no `uninstallCommand`, so any user who installed via curl will see an "Uninstall" button in the UI but get a `no-uninstall-command` runtime error when they click it (`host-dependency-manager.ts` line 851). The `grok` plugin — which follows the same curl-first pattern — avoids this by omitting the `uninstall` field entirely, which signals "uninstall not supported" and hides the UI button altogether.

Reviews (1): Last reviewed commit: "feat(codex): install via curl script ins..." | Re-trigger Greptile

Comment on lines +117 to +119
uninstall: {
kind: 'package-manager',
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Uninstall declared but broken for the recommended curl install path

uninstall: { kind: 'package-manager' } tells the runtime to run the uninstallCommand for whichever method was used to install. The curl option (the recommended one) has no uninstallCommand, so any user who installed via curl will see an "Uninstall" button in the UI but get a no-uninstall-command runtime error when they click it (host-dependency-manager.ts line 851). The grok plugin — which follows the same curl-first pattern — avoids this by omitting the uninstall field entirely, which signals "uninstall not supported" and hides the UI button altogether.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/plugins/src/agents/impl/codex/index.ts
Line: 117-119

Comment:
**Uninstall declared but broken for the recommended curl install path**

`uninstall: { kind: 'package-manager' }` tells the runtime to run the `uninstallCommand` for whichever method was used to install. The `curl` option (the recommended one) has no `uninstallCommand`, so any user who installed via curl will see an "Uninstall" button in the UI but get a `no-uninstall-command` runtime error when they click it (`host-dependency-manager.ts` line 851). The `grok` plugin — which follows the same curl-first pattern — avoids this by omitting the `uninstall` field entirely, which signals "uninstall not supported" and hides the UI button altogether.

How can I resolve this? If you propose a fix, please make it concise.

@arnestrickmann

Copy link
Copy Markdown
Contributor

Thanks for your interest in contributing, @hetdv - back with proper feedback soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants