Commit Graph
40 Commits
Author SHA1 Message Date
zeekay eb49cac620 name the env after the product, and the key after the stack it opens
457 sites carried an upstream prefix into every surface a user reaches — shell
exports, docs, CI, the SDK. CODEX_ is not our name and it was never going to
stop arriving on its own: it is what upstream writes, and every sync brings more.

Two namespaces, because they answer different questions.

  DEV_*            the app's own configuration — DEV_HOME, DEV_PROFILE, the rest
  HANZO_API_KEY    a credential for the Hanzo stack, which is not app config

CODEX_API_KEY held the literal string "CODEX_API_KEY", so the rename moves the
value and not just the constant. It becomes HANZO_API_KEY, which is what
create_hanzo_provider already reads through HANZO_MACHINE_ENV_KEYS — one name
for one credential instead of two spellings of it.

vendor/ is untouched, which is the point of vendor/: upstream code keeps
upstream names, and the boundary is a path rather than a habit.
2026-08-08 09:14:56 -07:00
zeekayandHanzo Dev 6cbbea2d03 merge: just-every/code v0.6.169 (e4fe007150) — keep Hanzo identity
Our history is just-every's with author emails rewritten, so the graphs are
disjoint and git finds no merge base. Supplied one by hand: d1f1f51a41, the
just-every commit matching our Oct-2025 fork point (22 files apart). 9618
upstream commits, 7004 files, +1.81M/-159k, 37 conflicts.

Resolution:
- Upstream code where our side was the Oct-2025 prototype of a feature they
  have since reimplemented 3-5x larger (agent_runs, browser_sessions,
  history_cell/{agent,browser}, the vt100 harness and its snapshots).
- Upstream's config.rs module split (builder/defaults/sources/validation)
  kept; zen5-coder and the provider-follows-model rule re-applied on top.
- Ours where the file IS the identity: README, package.json, postinstall,
  release notes pipeline, integration-zed.
- Hybrid where upstream improved a file we had branded: updates.rs (their
  release-repo migration, our hanzoai/dev), release.yml (their fail-fast npm
  auth check, our package name), chatwidget.rs (their turn handling, our
  HANZO_USER_KEY hint), exec human output (their 237 lines, our banner).

Superseded and dropped deliberately: our resume_command_name() coder-alias
hack — upstream's derive_resume_command_name() reads the invocation basename
generically, which yields "dev" for us.

LLM.md now records the real topology and the sync point; AGENTS.md and
CLAUDE.md are symlinks to it again. Single parent on purpose: adopting
jecode/main as a second parent would re-import 13,742 commits carrying the
upstream author emails a prior rewrite deliberately removed.

Version 0.2.188 -> 0.2.189.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-05 23:09:12 -07:00
zeekayandHanzo Dev d3d1dfa1d3 dev is ours: the Hanzo Cloud by default, a binary named dev, our namespaces
hanzoai/dev went public defaulting to someone else's cloud. Four things were
wrong, and all four now have a test that fails if they come back.

DEFAULT PROVIDER AND MODEL. built_in_model_providers() gains `hanzo` -- the
Hanzo Cloud at api.hanzo.ai/v1, Responses wire, bearer from HANZO_USER_KEY --
and it is the default. The default model is zen5-coder. This was not cosmetic:
the old default is not in the gateway catalog, so it 400s against our own
cloud. Measured, not assumed:

  POST api.hanzo.ai/v1/responses model=gpt-5-codex -> 400 "model is not
      available. Use GET /v1/models to list available models"
  POST api.hanzo.ai/v1/responses model=zen5-coder  -> 200, clean output

Our own CLI already documented the bug from the other side -- dev.rs says
"Name the model too -- codex's built-in default is not in the gateway catalog
and would 400" and passes `-c model=` on every launch to work around it. It
also asserts that on the native gateway NO model_provider override is needed,
which is only true once `hanzo` is the built-in default. It is now.

zen5-coder over enso because dev is a coding agent and because enso returns
system-prompt text on the Responses wire that dev actually speaks; zen5-coder
returns the answer. Model ids were read from GET /v1/models with a bearer, not
guessed. Other providers stay fully configurable -- this is the default, not
the only choice.

THE LOGIN COMMAND. Messages said `code login` / `codex login`. The real command
is `hanzo auth login` (`hanzo login` is not a command -- it is swallowed as an
AI task). It now lives once, as auth::LOGIN_COMMAND, so no message can drift
into naming a command that does not exist. References to this binary's own
subcommand became `dev login`.

A BINARY NAMED dev. HEAD built `code` and `codex` and nothing named `dev`, so a
release cut today would ship no `dev` -- and `hanzo code` launches a bare `dev`
off PATH, so every new install would break. `dev` is now the canonical bin,
declared first; `code` remains as an alias to the same program, never the
reverse. The CLI identifies as `dev` / "Hanzo Dev", not "OpenAI Codex".

OUR NAMESPACES. The pipeline published to @just-every/* on npm and pushed
formulae to just-every/homebrew-tap. Both of ours already exist and are already
populated at v0.6.91 -- @hanzo/dev plus all five @hanzo/dev-<target> packages,
and hanzoai/homebrew-tap's Formula/hanzo-dev.rb, which installs `dev` and
expects assets named dev-<triple>. Nothing here is squatted; this is our own
distribution, reclaimed. Assets are renamed to match the formula.

Two live supply-chain bugs fell out of that, both worse than a naming problem:
postinstall.js (runs on every npm install) and the tui auto-updater fetched
from a third party's releases -- the updater also told our users to
`npm install -g @just-every/code@latest`. Worse, a shadowed `isWSL` const put
the two fast paths in the temporal dead zone, so their catch blocks swallowed
the error and EVERY install fell through to that download: the five published
platform packages were never used, and the third-party fetch was not an edge
case but the only path that ran. Fixed and exercised in a sandbox across all
three paths. codex-cli/.pack/ -- a committed `npm pack` artifact CI
regenerates, and the reason the bad URL had two homes -- is now untracked.

DURABILITY, because upstream-merge.yml merges openai/codex every 30 minutes.
A one-time edit to a default is a suggestion that survives until the next
merge. Two mechanisms:

  - .github/merge-policy.json prefer_ours_globs listed only codex-rs/** while
    the workspace that SHIPS is code-rs/**, so it protected nothing that
    ships. The identity-bearing code-rs files are now listed.
  - code-rs/core/tests/hanzo_identity.rs asserts all four properties -- the
    provider, a Zen default, a bin named dev, and no third-party publish
    target. Upstream has no such file, so a merge cannot conflict with it or
    carry the guard away with the thing it guards. Policy can be edited;
    a red build cannot be ignored.

The gate is not decorative: it failed on the un-retargeted pipeline
("release.yml still references `@just-every/`") and went green only when the
pipeline was actually fixed.

Verified: cargo build --bin dev clean; hanzo_identity 4/4; code-core lib
332 passed, 1 failed -- git_info::test_collect_git_info_with_remote, which
fails identically on a clean origin/main checkout here because this machine
has a global [email protected]:.insteadof rewrite. Pre-existing and
environmental, not from this change.

  $ dev exec "say OK"        # fresh profile, no config
  Hanzo Dev v0.0.0
  model: zen5-coder
  provider: hanzo

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-01 14:05:00 -07:00
James Peter 093fb65073 feat(process-hardening): share hardening crate and update proxy 2025-09-30 08:23:01 +10:00
just-every-code 091a28bab6 merge(upstream): merge upstream/main into upstream-merge (by-bucket)\n\n- Keep ours: codex-cli (resolve package.json, drop upstream rg/installer scripts)\n- Keep ours: workflows (ci.yml, rust-release.yml remain deleted)\n- Adopt upstream elsewhere; no core/tooling regressions\n\nBuild: verify.sh build_fast=ok api_check=ok 2025-09-24 06:36:58 +00:00
Michael BolinandGitHub 768a6075ef fix: vendor ripgrep in the npm module (#3660)
We try to ensure ripgrep (`rg`) is provided with Codex.

- For `brew`, we declare it as a dependency of our formula:

https://github.com/Homebrew/homebrew-core/blob/08d82d8b006a19efbe234477bc8b18d35b5fef50/Formula/c/codex.rb#L24
- For `npm`, we declare `@vscode/ripgrep` as a dependency, which
installs the platform-specific binary as part of a `postinstall` script:

https://github.com/openai/codex/blob/2804e9b73eca536fdd56b4bc0725207076c69234/codex-cli/package.json#L22
- Users who download the CLI directly from GitHub Releases are on their
own.

In practice, I have seen `@vscode/ripgrep` fail on occasion. Here is a
trace from a GitHub workflow:

```
npm error code 1
npm error path /Users/runner/hostedtoolcache/node/20.19.5/arm64/lib/node_modules/@openai/codex/node_modules/@vscode/ripgrep
npm error command failed
npm error command sh -c node ./lib/postinstall.js
npm error Finding release for v13.0.0-13
npm error GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v13.0.0-13
npm error Deleting invalid download cache
npm error Download attempt 1 failed, retrying in 2 seconds...
npm error Finding release for v13.0.0-13
npm error GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v13.0.0-13
npm error Deleting invalid download cache
npm error Download attempt 2 failed, retrying in 4 seconds...
npm error Finding release for v13.0.0-13
npm error GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v13.0.0-13
npm error Deleting invalid download cache
npm error Download attempt 3 failed, retrying in 8 seconds...
npm error Finding release for v13.0.0-13
npm error GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v13.0.0-13
npm error Deleting invalid download cache
npm error Download attempt 4 failed, retrying in 16 seconds...
npm error Finding release for v13.0.0-13
npm error GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v13.0.0-13
npm error Deleting invalid download cache
npm error Error: Request failed: 403
```

To eliminate this error, this PR changes things so that we vendor the
`rg` binary into https://www.npmjs.com/package/@openai/codex so it is
guaranteed to be included when a user runs `npm i -g @openai/codex`.

The downside of this approach is the increase in package size: we
include the `rg` executable for six architectures (in addition to the
six copies of `codex` we already include). In a follow-up, I plan to add
support for "slices" of our npm module, so that soon users will be able
to do:

```
npm install -g @openai/codex@aarch64-apple-darwin
```

Admittedly, this is a sizable change and I tried to clean some things up
in the process:

- `install_native_deps.sh` has been replaced by `install_native_deps.py`
- `stage_release.sh` and `stage_rust_release.py` has been replaced by
`build_npm_package.py`

We now vendor in a DotSlash file for ripgrep (as a modest attempt to
facilitate local testing) and then build up the extension by:

- creating a temp directory and copying `package.json` over to it with
the target value for `"version"`
- finding the GitHub workflow that corresponds to the
`--release-version` and copying the various `codex` artifacts to
respective `vendor/TARGET_TRIPLE/codex` folder
- downloading the `rg` artifacts specified in the DotSlash file and
copying them over to the respective `vendor/TARGET_TRIPLE/path` folder
- if `--pack-output` is specified, runs `npm pack` on the temp directory

To test, I downloaded the artifact produced by this CI job:


https://github.com/openai/codex/actions/runs/17961595388/job/51085840022?pr=3660

and verified that `node ./bin/codex.js 'which -a rg'` worked as
intended.
2025-09-23 23:00:33 -07:00
James Peter 391db9393f fix(cli/windows): stop appending second .exe in cache/platform paths (use exact targetTriple name) 2025-09-11 22:59:26 +10:00
James Peter f3385da970 fix(cli/windows): robust unzip in runtime bootstrap (powershell full-path, pwsh, tar fallback; extract to user cache) 2025-09-11 22:35:17 +10:00
James Peter 9132e2bfc1 fix(cli/windows): always print bootstrap error; remove debug gate
Also:
- chore(release): delete legacy stage_release.sh and remove references
- ci(release): add ESM integrity guard for bin/coder.js in npm pack tarball
- docs(npm): clarify prepublishOnly guidance
2025-09-11 22:18:38 +10:00
James Peter 09fdd2fd43 fix(codex-cli/bin): coder.js is pure ESM — replace internal require() with ESM fs APIs; avoid require in isWSL() 2025-09-11 20:02:17 +10:00
James Peter 6a0befcd2b fix(cli/windows): avoid EBUSY/EPERM on global upgrades by keeping native .exe in per-user cache; launcher prefers cache\n\n- Postinstall: on Windows, install binary to %LocalAppData%\just-every\code\<version> and do not leave a copy in node_modules.\n- Launcher: run from cache when available; mirror into node_modules only on Unix.\n- Outcome: global npm upgrades no longer fail when the CLI is running. 2025-09-11 10:06:49 +10:00
James Peter 08609e46c7 merge: integrate upstream/main (prefer ours); keep TUI fork, drop legacy vt100 tests, retain local common.rs 2025-09-03 19:49:35 +10:00
Michael BolinandGitHub b720b45461 fix: include arm64 Windows executable in npm module (#3067)
This is in support of https://github.com/openai/codex/issues/2979.

Tested by running:

```
./codex-cli/scripts/install_native_deps.sh --workflow-url https://github.com/openai/codex/actions/runs/17416421450
```
2025-09-02 15:43:42 -07:00
James Peter 8a0251e908 fix(cli/coder): de-duplicate validateBinary to avoid ESM redeclare error under Bun/Node 23 2025-08-30 14:15:21 +10:00
James Peter d4c65fc01f fix(cli/coder): make bootstrap helper async; fix Bun global install when postinstall is blocked\n\nBun can block postinstall; our coder entry bootstraps the native binary.\nIt used an await inside a non-async function, causing a syntax error under Node.\nNow the helper is async and the top-level call awaits it correctly. 2025-08-30 13:59:41 +10:00
James Peter 3da2934f7d fix(cli/install): bootstrap native binary on first run; drop unpublished win optional dep\n\n- Add self-bootstrap in bin/coder.js to fetch validated platform binary when postinstall is blocked (e.g., Bun global)\n- Prefer cached binary, then optional platform pkg, then GitHub release download\n- Remove @just-every/code-win32-x64 from optionalDependencies to avoid Bun 404 noise on non-Windows installs\n- Build verified with ./build-fast.sh 2025-08-30 13:39:39 +10:00
James Peter a8c4832940 fix(cli/bin): stop delegating to system 'code' (VS Code) when invoked via npm/npx; always run bundled binary and show path\n\n- Remove fragile delegation heuristic that caused to open VS Code\n- Print a concise notice under npx showing the exact binary path in use\n- Keep postinstall collision handling for global installs unchanged\n\nThis restores expected behavior and makes collisions visible during npx runs. 2025-08-29 15:44:56 +10:00
James Peter f25c5f3199 chore: commit local work (CLI + core + TUI) 2025-08-29 14:20:24 +10:00
James Peter 7f7f3f6bd9 cli(downloads): verify Content-Length, add retries/timeouts; improve WSL guidance\n\n- postinstall: bytes count vs Content-Length, inactivity/absolute timeouts, retry with backoff\n- coder.js: WSL detection + tailored guidance when binaries missing/invalid 2025-08-20 07:46:25 +10:00
James Peter e6646c4d72 cli(windows): guard against corrupt/empty downloads and improve spawn errors\n\n- postinstall: robust download + header validation (MZ/ELF/Mach-O), delete on failure\n- coder.js: pre-spawn binary header check; clearer EFTYPE/ENOEXEC/EACCES guidance\n- reduces confusing Windows EFTYPE crashes from partial downloads 2025-08-19 13:51:46 +10:00
James Peter fc17d512b7 refactor(naming): switch binaries and artifacts from 'coder' to 'code'; keep 'coder' as fallback alias only. Update workflows, scripts, and postinstall. 2025-08-17 20:45:10 +10:00
James Peter e1f9079b50 chore: commit pending changes on main (CLI, TUI, core, docs) 2025-08-17 18:55:58 +10:00
James Peter 434f13571f chore(rebrand): rename user-facing Coder → Code; update links to new repo
- Update TUI titles, labels, messages
- Update onboarding copy and links
- Update MCP titles and human-output banner
- Update README branding and URLs
- postinstall: switch release URL to just-every/code; offer optional 'code' alias without collisions
- package.json repository URL updated

Note: CLI command remains 'coder' to avoid VS Code collision; optional alias offered interactively.
2025-08-16 12:10:29 +10:00
James Peter b67a0da2b1 Merge upstream changes from openai/codex
Successfully merged all upstream changes while preserving our custom functionality:
- Kept our browser integration and screenshot features
- Preserved agent tracking and multi-agent support
- Maintained our live ring widget and custom UI components
- Integrated upstream's streaming improvements and new conversation manager
- Combined both versions' protocol updates and event handling

All conflicts resolved with preference for our functionality where there were genuine differences.
2025-08-14 08:16:36 +10:00
DylanandGitHub 06283e2694 [codex-cli] Add ripgrep as a dependency for node environment (#2237)
## Summary
Ripgrep is our preferred tool for file search. When users install via
`brew install codex`, it's automatically installed as a dependency. We
want to ensure that users running via an npm install also have this
tool! Microsoft has already solved this problem for VS Code - let's not
reinvent the wheel.

This approach of appending to the PATH directly might be a bit
heavy-handed, but feels reasonably robust to a variety of environment
concerns. Open to thoughts on better approaches here!

## Testing
- [x] confirmed this import approach works with `node -e "const { rgPath
} = require('@vscode/ripgrep'); require('child_process').spawn(rgPath,
['--version'], { stdio: 'inherit' })"`
- [x] Ran codex.js locally with `rg` uninstalled, asked it to run `which
rg`. Output below:

```
⚡ Ran command which rg; echo $?
  ⎿ /Users/dylan.hurd/code/dh--npm-rg/node_modules/@vscode/ripgrep/bin/rg
    0

codex
Re-running to confirm the path and exit code.

- Path: `/Users/dylan.hurd/code/dh--npm-rg/node_modules/@vscode/ripgrep/bin/rg`
- Exit code: `0`
```
2025-08-13 13:49:27 -07:00
James Peter d1641caa42 fix: handle permission errors for binaries on Linux/WSL
- Add automatic chmod +x when running coder.js on Unix systems
- Fix postinstall script to use octal notation for chmod (0o755)
- Add better error messages when binary is not executable
- Always try to fix permissions for existing binaries
- Bump version to 0.1.2 for hotfix release
2025-08-12 06:55:01 +10:00
James Peter 596944c64b fix: remove dangling symlinks from codex-cli/bin and update gitignore
- Remove tracked symlinks that were causing build failures
- Add gitignore patterns to prevent binary symlinks from being tracked
- Fixes 'cp: not writing through dangling symlink' error in release workflow
2025-08-11 22:29:50 +10:00
James Peter e88aebf24f feat: add coder fork enhancements - mouse scrolling, glitch animation, and improved TUI 2025-08-11 21:51:46 +10:00
James Peter 279e211228 feat: set up code fork with rebranding and npm publishing
- Rename binaries from codex to code across all Cargo.toml files
- Create @just-every/code npm package with generic build scripts
- Add CODE_HOME environment variable support (falls back to CODEX_HOME)
- Create GitHub Actions workflow for automated npm releases
- Update JavaScript wrapper from codex.js to code.js
- Add FORK_SETUP.md documentation
- Configure dual-branch strategy for fork management
2025-08-10 15:57:12 +10:00
Michael BolinandGitHub f82bb30dba feat: include Windows binary of the CLI in the npm release (#2040)
To date, the build scripts in `codex-cli` still supported building the
old TypeScript version of the Codex CLI to give Windows users something
they can run, but we are just going to have them use the Rust version
like everyone else, so:

- updates `codex-cli/bin/codex.js` so that we run the native binary or
throw if the target platform/arch is not supported (no more conditional
usage based on `CODEX_RUST`, `use-native` file, etc.)
- drops the `--native` flag from `codex-cli/scripts/stage_release.sh`
and updates all the code paths to behave as if `--native` were passed
(i.e., it is the only way to run it now)

Tested this by running:

```
./codex-cli/scripts/stage_rust_release.py --release-version 0.20.0-alpha.2
```
2025-08-08 14:44:35 -07:00
d2a6586738 check for updates (#1764)
1. Ping https://api.github.com/repos/openai/codex/releases/latest (at
most once every 20 hrs)
2. Store the result in ~/.codex/version.jsonl
3. If CARGO_PKG_VERSION < latest_version, print a message at boot.

---------

Co-authored-by: Hanzo Dev <[email protected]>
2025-08-02 00:31:38 +00:00
Michael BolinandGitHub 4fe6720622 fix: update bin/codex.js so it listens for exit on the child process (#1590)
When Codex CLI is installed via `npm`, we use a `.js` wrapper script to
launch the Rust binary.

- Previously, we were not listening for signals to ensure that killing
the Node.js process would also kill the underlying Rust process.
- We also did not have a proper `exit` handler in place on the child
process to ensure we exited from the Node.js process.

This PR fixes these things and hopefully addresses
https://github.com/openai/codex/issues/1570.

This also adds logic so that Windows falls back to the TypeScript CLI
again, which should address https://github.com/openai/codex/issues/1573.
2025-07-16 16:35:29 -07:00
pchuriandGitHub 80b8bb822a Add Android platform support for Codex CLI (#1488)
## Summary
Add Android platform support to Codex CLI

## What?
- Added `android` to the list of supported platforms in
`codex-cli/bin/codex.js`
- Treats Android as Linux for binary compatibility

## Why?
- Fixes "Unsupported platform: android (arm64)" error on Termux
- Enables Codex CLI usage on Android devices via Termux
- Improves platform compatibility without affecting other platforms

## How?
- Modified the platform detection switch statement to include `case
"android":`
- Android falls through to the same logic as Linux, using appropriate
ARM64 binaries
- Minimal change with no breaking effects on existing functionality

## Testing
- Tested on Android/Termux environment
- Verified the fix resolves the platform detection error
- Confirmed no impact on other platforms

## Related Issues
Fixes the "Unsupported platform: android (arm64)" error reported by
Termux users
2025-07-09 22:06:55 -07:00
Michael BolinandGitHub a7a21aece3 fix: use aarch64-unknown-linux-musl instead of aarch64-unknown-linux-gnu (#1228)
Now that we have published a GitHub Release that contains arm64 musl
artifacts for Linux, update the following scripts to take advantage of
them:

- `dotslash-config.json` now uses musl artifacts for the `linux-aarch64`
target
- `install_native_deps.sh` for the TypeScript CLI now includes
`codex-linux-sandbox-aarch64-unknown-linux-musl` instead of
`codex-linux-sandbox-aarch64-unknown-linux-gnu` for sandboxing
- `codex-cli/bin/codex.js` now checks for `aarch64-unknown-linux-musl`
artifacts instead of `aarch64-unknown-linux-gnu` ones
2025-06-05 22:45:45 -07:00
Michael BolinandGitHub 28a7b51a43 fix: for the @native release of the Node module, use the Rust version by default (#1084)
Added logic so that when we run `./scripts/stage_release.sh --native`
(for the `@native` version of the Node module), we drop a `use-native`
file next to `codex.js`. If present, `codex.js` will now run the Rust
CLI.

Ran `./scripts/stage_release.sh --native` and verified that when the
running `codex.js` in the staged folder:

```
$ /var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.efvEvBlSN6/bin/codex.js --version
codex-cli 0.0.2505220956
```

it ran the expected Rust version of the CLI, as desired.

While here, I also updated the Rust version to one that I cut today,
which includes the new shell environment policy config option:
https://github.com/openai/codex/pull/1061. Note this may "break" some
users if the processes spawned by Codex need extra environment
variables. (We are still working to determine what the right defaults
should be for this option.)
2025-05-22 13:42:55 -07:00
Michael BolinandGitHub 49f65c5532 chore: introduce new --native flag to Node module release process (#844)
This PR introduces an optional build flag, `--native`, that will build a
version of the Codex npm module that:

- Includes both the Node.js and native Rust versions (for Mac and Linux)
- Will run the native version if `CODEX_RUST=1` is set
- Runs the TypeScript version otherwise

Note this PR also updates the workflow URL to
https://github.com/openai/codex/actions/runs/14872557396, as that is a
build from today that includes everything up through
https://github.com/openai/codex/pull/843.

Test Plan:

In `~/code/codex/codex-cli`, I ran:

```
pnpm stage-release --native
```

The end of the output was:

```
Staged version 0.1.2505121317 for release in /var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.xd2p5ETYGN
Test Node:
    node /var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.xd2p5ETYGN/bin/codex.js --help
Test Rust:
    CODEX_RUST=1 node /var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.xd2p5ETYGN/bin/codex.js --help
Next:  cd "/var/folders/wm/f209bc1n2bd_r0jncn9s6j_00000gp/T/tmp.xd2p5ETYGN" && npm publish --tag native
```

I verified that running each of these commands ran the expected version
of Codex.

While here, I also added `bin` to the `files` list in `package.json`,
which should have been done as part of
https://github.com/openai/codex/pull/757, as that added new entries to
`bin` that were matched by `.gitignore` but should have been included in
a release.
2025-05-12 13:38:10 -07:00
Fouad MatinandGitHub dffa632ead fix: /bug report command, thinking indicator (#381)
- Fix `/bug` report command
- Fix thinking indicator
2025-04-18 18:13:34 -07:00
PramaandGitHub df8cfb62d8 fix: Improper spawn of sh on Windows Powershell (#318)
# Fix CLI launcher on Windows by replacing `sh`-based entrypoint with
cross-platform Node script

## What's changed

* This PR attempts to replace the sh-based entry point with a node
script that works on all platforms including Windows Powershell and CMD

## Why 

* Previously, when installing Codex globally via `npm i -g
@openai/codex`, Windows resulted in a broken CLI issue due to the `ps1`
launcher trying to execute `sh.exe`.

* If users don't have Unix-style shell, running the command will fail as
seen below since `sh.exe` can't be found

* Output:
 ``` 
& : The term 'sh.exe' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is
correct and try again.
At C:\Users\{user}\AppData\Roaming\npm\codex.ps1:24 char:7
+     & "sh$exe"  "$basedir/node_modules/@openai/codex/bin/codex" $args
+       ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (sh.exe:String) [],
CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
```



## How
* By using a Node based entry point that resolves the path to the compiled ESM bundle and dynamically loads it using native ESM

* Removed dependency on platform-specific launchers allowing a single entrypoint to work everywhere Node.js runs.


## Result

Codex CLI now supports cross-platform and launches correctly via:
* macOS / Linux
* Windows PowerShell
* GitBash
* CMD
* WSL

Directly addresses #316 

![image](https://github.com/user-attachments/assets/85faaca4-24bc-47c9-8160-4e30df6da4c3)


![image](https://github.com/user-attachments/assets/a13f7adc-52c1-4c0e-af02-e35a35dc45d4)
2025-04-18 11:35:51 -07:00
Fouad MatinandGitHub 03146fbfb1 add: changelog (#308)
- Release `@openai/[email protected]`
- Add changelog
2025-04-17 23:34:05 -07:00
Sam VerhasseltandGitHub 2822d68fe4 feat(bin): support bun fallback runtime for codex CLI (#282)
This PR adds a shell wrapper in `codex-cli/bin/codex` to detect node or
bun as the runtime.

It updates:
- `package.json` bin entry
- published files list to include bin/
- README install instructions to include `bun install -g @openai/codex`
2025-04-17 17:32:19 -07:00