mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
- 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
3.6 KiB
3.6 KiB
Setting up "code" - A Fork of OpenAI Codex
Overview
This document outlines the changes needed to rebrand and publish this fork of OpenAI Codex as "code" under the @just-every npm scope.
Required Changes
1. Binary Renaming
- Rename binary from
codextocodein:codex-rs/cli/Cargo.toml- Change[[bin]] name = "codex"toname = "code"codex-rs/tui/Cargo.toml- Change binary name tocode-tuicodex-rs/exec/Cargo.toml- Change binary name tocode-exec
2. Package Configuration
-
Update
codex-cli/package.json:- Change name from
@openai/codexto@just-every/code - Update repository URL to
https://github.com/just-every/code.git - Update bin field from
"codex": "bin/codex.js"to"code": "bin/code.js" - Set initial version (e.g., "0.1.0")
- Change name from
-
Rename
codex-cli/bin/codex.jstocodex-cli/bin/code.js -
Update the shebang and binary detection logic in
code.js
3. GitHub Actions Updates
-
Modify
.github/workflows/rust-release.yml:- Update artifact names from
codex-*tocode-* - Change npm package staging to use new name
- Add npm publish step after GitHub release
- Update artifact names from
-
Create
.github/workflows/npm-publish.ymlfor automated npm publishing:name: Publish to npm on: release: types: [published] jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' registry-url: 'https://registry.npmjs.org' - name: Download release assets # Download the npm package from release - name: Publish to npm run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4. Rust Code Updates
- Update all references to "codex" in:
- Error messages
- Help text
- Documentation strings
- Environment variables (e.g.,
CODEX_HOME→CODE_HOME)
5. Configuration Updates
- Update config paths from
~/.codex/to~/.code/ - Update environment variable names
- Update default config values
6. Build Scripts
- Update build scripts to produce
codebinaries - Update install scripts to use new binary names
- Update the staging script at
codex-cli/scripts/stage_rust_release.py
7. Documentation
- Update README.md with new project name and installation instructions
- Update all documentation to reference
codeinstead ofcodex - Add attribution to original OpenAI Codex project
GitHub Secrets Required
Add these secrets to your GitHub repository:
NPM_TOKEN: Your npm authentication token for publishing
Release Process
- Update version in
codex-rs/Cargo.toml - Update version in
codex-cli/package.json - Commit changes
- Create and push a tag:
git tag -a v0.1.0 -m "Release 0.1.0" - Push tag:
git push origin v0.1.0 - GitHub Actions will automatically:
- Build binaries for all platforms
- Create GitHub release
- Publish to npm
Testing Locally
# Build the Rust binaries
cd codex-rs
cargo build --release --bin code
# Test the CLI
./target/release/code --version
# Test npm package locally
cd ../codex-cli
npm link
code --version
npm Publishing Setup
- Create npm account if needed
- Create organization @just-every on npm
- Generate npm access token (automation type)
- Add token as GitHub secret NPM_TOKEN
Maintaining the Fork
- Regularly sync with upstream OpenAI Codex for bug fixes
- Keep a clear changelog of fork-specific features
- Maintain compatibility where possible