Thanks to visit codestin.com
Credit goes to github.com

Skip to content

earthwuyang/codex

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Codex

AI-powered coding assistant in your terminal

License Version Rust

Installation โ€ข Features โ€ข Usage โ€ข Documentation


๐Ÿš€ zapabob/codex Enhanced Features

๐Ÿค– Sub-Agent System (NEW!)

Delegate specialized tasks to AI sub-agents with fine-grained permissions:

# Single agent execution
codex delegate code-reviewer --scope ./src --budget 40000

# Parallel execution (NEW!)
codex delegate-parallel code-reviewer,test-gen,sec-audit \
  --goals "Review code,Generate tests,Security audit" \
  --scopes ./src,./tests,./package.json \
  --budgets 40000,30000,20000

# Custom agent from prompt (NEW!)
codex agent-create "Find all TODO comments and create a summary report" \
  --budget 50000

Available Sub-Agents

Agent Purpose Token Budget
code-reviewer Security, performance, best practices analysis 40,000
test-gen Unit/Integration/E2E test generation (80%+ coverage) 30,000
sec-audit CVE scanning, dependency audit, patch recommendations 50,000
researcher Deep research with citations and cross-validation 60,000

New Capabilities

  • Parallel Execution: Run multiple agents simultaneously for 3x faster completion
  • Custom Agents: Create agents from natural language prompts with LLM-powered generation
  • Process Isolation: Each agent runs in a separate process for enhanced security

Quick Start: See SUBAGENTS_QUICKSTART.md and PARALLEL_CUSTOM_AGENT_GUIDE.md


๐Ÿ” Deep Research (Enhanced)

Multi-source research with citation and contradiction detection:

codex research "Rust async programming best practices" --depth 3

Features:

  • DuckDuckGo HTML scraping (no API key required)
  • Smart sub-query generation
  • Cross-source validation
  • Cited reports with confidence scores

๐Ÿ”ง Codex MCP Integration (In Progress)

New: Codex itself as an MCP server for sub-agents!

# .codex/agents/my-agent.yaml
tools:
  mcp:
    - codex_read_file       # Full Codex file reading
    - codex_grep            # Full Codex grep
    - codex_codebase_search # Semantic search

Status: ๐Ÿšง Implementation in progress Design: _docs/2025-10-11_CodexMCPๅŒ–่จญ่จˆๆ›ธ.md


๐Ÿ“‹ For Contributors

This fork maintains dual compatibility with:

  • โœ… OpenAI official repository
  • โœ… zapabob enhancements

Development Guide: .codex/META_PROMPT_CONTINUOUS_IMPROVEMENT.md

CI/CD Pipeline

  • Continuous Integration: Automated testing on every PR

    • 3 platforms (Ubuntu, Windows, macOS)
    • Clippy lint + Rustfmt check
    • Agent definition validation
    • Integration tests (Deep Research + Sub-Agent)
    • Security audit (cargo-audit)
  • Continuous Delivery: Automated releases on tag push

    • Multi-platform binaries (Linux x64, Windows x64, macOS x64/ARM64)
    • npm package generation
    • GitHub Release creation
    • Auto-generated release notes

CI/CD Guide: CI_CD_SETUP_GUIDE.md


๐ŸŽฏ What is Codex?

Codex is an AI-powered coding assistant that runs in your terminal. It helps you write, understand, and improve code through natural conversation.

โœจ Features

  • Interactive Chat: Natural language conversations about your code
  • Code Understanding: Analyze, explain, and refactor existing code
  • File Operations: Read, write, and modify files with AI assistance
  • Shell Integration: Execute commands safely with sandboxing
  • MCP Support: Extensible via Model Context Protocol
  • Multi-Model: Support for GPT-4, Claude, and local models

๐Ÿ“ฆ Installation

npm (Recommended)

npm install -g @openai/codex

From Source

git clone https://github.com/zapabob/codex.git
cd codex/codex-rs
cargo build --release -p codex-cli
npm install -g ./codex-cli

Building on macOS Apple Silicon

Important: If you're building on Apple Silicon (ARM64) Macs, follow these additional steps:

Issue: The default configuration in codex-rs/.cargo/config.toml forces target-cpu=x86-64 globally, causing build errors on ARM64 Macs:

error: 'x86-64' is not a recognized processor for this target (ignoring processor)

Complete Build Steps for Apple Silicon:

  1. Edit the config file: Remove or comment out the [build] section in codex-rs/.cargo/config.toml:
# Remove or comment out these lines:
# [build]
# # Use generic x86-64 instruction set to avoid ILLEGAL_INSTRUCTION errors
# rustflags = ["-C", "target-cpu=x86-64"]
  1. Build the project:
cd codex/codex-rs
cargo build --release -p codex-cli
  1. Copy binary to npm vendor directory:
cd ..
mkdir -p codex-cli/vendor/aarch64-apple-darwin/codex
cp codex-rs/target/release/codex codex-cli/vendor/aarch64-apple-darwin/codex/codex
chmod +x codex-cli/vendor/aarch64-apple-darwin/codex/codex
  1. Install globally:
npm install -g ./codex-cli
  1. Verify installation:
codex --version

๐ŸŽฎ Usage

Basic Commands

# Start interactive session
codex

# Non-interactive execution
codex exec "Add error handling to main.rs"

# Deep research
codex research "Topic to research"

# Delegate to sub-agent
codex delegate code-reviewer --scope ./src

# Resume previous session
codex resume

Configuration

# Login
codex login

# View status
codex login status

# Configure model
codex -c model="gpt-4" "Your prompt"

๐Ÿ“š Documentation

Official Documentation

Enhanced Features (zapabob)


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           Codex CLI (Node.js)           โ”‚
โ”‚  codex, codex exec, codex delegate      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚      Codex Core (Rust)                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚ AgentRuntime โ”‚  โ”‚ ModelClient     โ”‚ โ”‚
โ”‚  โ”‚  Sub-Agents  โ”‚  โ”‚  LLM Interface  โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚ Deep Researchโ”‚  โ”‚ MCP Integration โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค Contributing

We welcome contributions! Please see:


๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • OpenAI - Original Codex project
  • Anthropic - Claude model support
  • Contributors - All contributors to the project

๐Ÿ“ž Support


Made with โค๏ธ by the Codex community

Version: 0.47.0-alpha.1
Last Updated: 2025-10-11

About

Lightweight coding agent that runs in your terminal

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 90.1%
  • PowerShell 2.8%
  • Python 2.8%
  • HTML 2.7%
  • TypeScript 1.1%
  • JavaScript 0.3%
  • Other 0.2%