Skip to content

Latest commit

History

13,720 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Codex Infinity

Codex Infinity

npm i -g @codex-infinity/codex-infinity

Codex Infinity is a smarter coding agent that can run forever.

Based on OpenAI Codex CLI with autonomous workflow extensions.


What makes Codex Infinity different?

Three arguments turn Codex into a fully autonomous coding agent:

  • --auto-next-steps -- After each response, automatically continues with the next logical steps (including testing)
  • --auto-next-idea -- Generates and implements new improvement ideas for your codebase
  • --auto-next-goal -- When a /goal completes, generates and starts the next goal automatically
# Autonomous coding -- completes tasks then moves to the next one
codex-infinity --auto-next-steps "fix all lint errors and add tests"# Fully autonomous -- dreams up and implements improvements forever
codex-infinity --auto-next-steps --auto-next-idea
# Goal loop -- finish a goal, then automatically create the next one
codex-infinity --auto-next-goal "/goal improve startup parity with installed Codex"# Full auto mode with autonomous continuation
codex-infinity --full-auto --auto-next-steps

Quickstart

npm install -g @codex-infinity/codex-infinity

Then run codex-infinity to get started.

By default, codex-infinity runs on gpt-5.4. Override it with -m/--model, -c model=..., or your ~/.codex/config.toml.

Authentication

Run codex-infinity and select Sign in with ChatGPT to use your Plus, Pro, Team, Edu, or Enterprise plan.

Or use an API key:

export OPENAI_API_KEY=sk-...
codex-infinity "your prompt"

Model providers (auto-detected)

codex-infinity auto-detects which provider to use from the model slug and the API keys present in your environment — no config.toml edits required. Export a key and select a matching model with -m:

ProviderEnv varExample models
OpenAIOPENAI_API_KEYgpt-5.4, o3
CerebrasCEREBRAS_API_KEYcerebras/gpt-oss-120b, cerebras/zai-glm-4.7
OpenPathsOPENPATHS_API_KEYopenpaths/auto, cerebras/gpt-oss-120b, composer-2.5
OpenRouterOPENROUTER_API_KEYanthropic/claude-opus-4.6, google/gemini-3.5-flash
Google GeminiGEMINI_API_KEYgoogle/gemini-3.5-flash
Z.AI (Zhipu)ZAI_API_KEYglm-4.7, z-ai/glm-5
DeepSeekDEEPSEEK_API_KEYdeepseek/deepseek-v4-flash
CursorCURSOR_API_KEYcursor/composer-2.5
Local (OSS)— (--oss)LM Studio / Ollama models

Cerebras runs the fast open-weight coding models (gpt-oss-120b, zai-glm-4.7). A cerebras/* model prefers a direct Cerebras key (CEREBRAS_API_KEY, https://api.cerebras.ai) and otherwise falls back to OpenPaths (openpaths.io), a router that also serves the Cerebras-hosted models — so a single OPENPATHS_API_KEY is enough to reach them. Override the endpoints with CEREBRAS_BASE_URL / OPENPATHS_BASE_URL if needed.

# Direct Cerebrasexport CEREBRAS_API_KEY=csk-...
codex-infinity -m cerebras/gpt-oss-120b "refactor this module"# Or via OpenPaths (also serves Cerebras models)export OPENPATHS_API_KEY=op-...
codex-infinity -m cerebras/zai-glm-4.7 "explain this bug"

CLI flags

FlagDescription
--auto-next-stepsAuto-continue with next logical steps after each response
--auto-next-ideaAuto-brainstorm and implement new improvement ideas
--auto-next-goalAuto-generate and start a new /goal after the current goal completes
--full-autoLow-friction sandboxed automatic execution
--yoloSkip approvals and sandbox (dangerous)
--yolo2Like yolo + disable command timeouts
--yolo3Like yolo2 + pass full host environment
--yolo4Like yolo3 + stream stdout/stderr directly
-m MODELSelect model (e.g. gpt-5.4, o3)
--ossUse local model provider (LM Studio / Ollama)
--searchEnable live web search
-i FILEAttach image(s) to initial prompt
--cd DIRSet working directory
--profile NAMEUse config profile from config.toml

Examples

# Fix a bug with full autonomy
codex-infinity --full-auto --auto-next-steps "fix the failing test in auth.test.ts"# Refactor with idea generation
codex-infinity --auto-next-steps --auto-next-idea "refactor the API layer"# Keep goal mode running autonomously
codex-infinity --auto-next-goal "/goal improve benchmark coverage"# Quick one-shot with yolo mode
codex-infinity --yolo "add error handling to all API endpoints"# Use a specific model
codex-infinity -m gpt-5.4 --auto-next-steps "optimize database queries"# Use local models
codex-infinity --oss -m llama3 "explain this codebase"

Features

  • Autonomous operation -- --auto-next-steps keeps it working without intervention
  • Idea generation -- --auto-next-idea brainstorms and implements improvements
  • Goal chaining -- --auto-next-goal turns completed /goal work into the next objective
  • AnyLLM -- OpenAI, local models via LM Studio/Ollama, bring your own provider
  • Local execution -- runs entirely on your machine
  • Concise prompts -- stripped-down system prompts for faster, more focused responses
  • Higher reliability -- increased retry limits for long-running autonomous sessions

Development

Build from source (Rust CLI)

cd codex-rs
cargo build --release -p codex-tui
./target/release/codex "your prompt here"

Fast dev builds

The Rust workspace has ~90 crates. Speed up compilation with:

# One-time setup
sudo apt install -y mold # fast linker
cargo install sccache # compile cache# Add to ~/.cargo/config.toml
cat >~/.cargo/config.toml << 'EOF'[build]jobs = 72rustc-wrapper = "sccache"rustflags = ["-C", "link-arg=-fuse-ld=mold"]EOF# Add to shell rcexport SCCACHE_DIR=/path/to/fast/disk/sccache
export SCCACHE_CACHE_SIZE=50G

Profile bottlenecks with cargo build --timings and check cache hits with sccache --show-stats.

Build npm package

cd codex-cli
npm install

Project structure

  • codex-rs/ -- Rust workspace (TUI, core, sandbox, etc.)
  • codex-cli/ -- npm package wrapper
  • sdk/ -- TypeScript SDK

Docs

Based on OpenAI Codex CLI. Licensed under Apache-2.0.

About

infinite coding agent

Topics

Resources

Contributing

Security policy

Stars

93 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages