OpenCodex

OpenCodex is an open-source terminal coding agent harness and orchestrator developed by lidge-jun on GitHub. It provides a lightweight, command-line environment designed to manage code generation tasks, route coding prompts, and execute AI agent workflows directly inside development repositories. Built on top of the Bun runtime ecosystem, OpenCodex functions through a CLI binary interface. Day-to-day development involves initiating agent sessions from the terminal to inspect repository structures, generate patches, and manage prompt execution with integrated session history and provenance tracking. OpenCodex distinguishes itself with its bundled, high-performance Bun runtime architecture and explicit prompt-routing mechanisms that maintain history provenance across task execution. Rather than functioning purely as an opaque wrapper, the project exposes structured workflow tooling, command-line symlink routing, and OAuth authentication flows to manage agent access. The project is free, open-source software distributed via GitHub. It has reached mature release stages with an active commit history and regular semantic version tags.

Tags: API, cli, coding agent, developer tools, OpenSource

Visit OpenCodex

Key features

  • Bun-powered runtime — Bundles and executes tasks on high-performance Bun runtime releases for fast startup and low overhead. - Routed history provenance — Tracks and preserves execution history context across multi-step coding prompts and tool invocations. - CLI binary interface — Provides terminal-native command execution and distribution symlinks for seamless shell workflow integration. - OAuth authentication workflow — Includes dedicated authentication flows for securely linking provider accounts and API services. - Open-source release track — Maintained as an active open-source repository with versioned tags, release artifacts, and structured devlogs.

Use cases

Use Case: Terminal-Based Repository Editing Developers can invoke OpenCodex directly in a terminal workspace to analyze source trees, craft multi-file code modifications, and generate diffs without context-switching to an IDE.

Use Case: Orchestrating Prompt Routing and Provenance Teams managing complex agent workflows can use OpenCodex's routing features to track session histories, maintaining clear traceability over model-generated interventions across the codebase.

Use Case: Automated CI/CD Agent Runs Engineers can embed OpenCodex execution within scripted pipelines or automated build steps to perform automated lint corrections, refactoring passes, or diagnostic inspections.

Who it is for

OpenCodex is suited for software engineers, DevOps specialists, and developers who prefer working directly in the terminal and require a fast, Bun-backed coding agent harness with session provenance tracking. It is less suited for developers seeking graphical user interfaces or plug-and-play non-technical desktop apps.

Install guide

Installation Clone the repository and install dependencies using Bun (inferred standard method based on repository structure): bash git clone https://github.com/lidge-jun/opencodex.git cd opencodex bun install bun run build Alternatively, install via global package linking if supported by your environment: bash bun link

First Run Run the initial setup to configure your authentication and provider credentials: bash opencodex auth login Ensure configuration files or environment API keys are properly exported in your shell session.

Example Session Invoke OpenCodex to inspect a project directory and execute a coding instruction: bash opencodex "Refactor src/runtime/logger.ts to use structured JSON output"

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • cc-router — cc-router is an open-source model router and API gateway orchestrator developed by Finch Xu. Built with a Rust and Tauri…
  • OpenHands — OpenHands (formerly OpenDevin) is an open-source autonomous AI software development agent and orchestration platform. It provides an extensible runtime environment…
  • Continue — Continue is an open-source AI code assistant and agent framework originally developed by the Continue team (continuedev) and recently acquired…
  • Cline — Cline is an open-source autonomous coding agent runtime maintained by Cline Bot Inc. and an active open-source community. Available as…
  • SWE-agent — SWE-agent is an open-source autonomous software engineering agent harness built and maintained by researchers from Princeton University and Stanford University.…
  • OpenCode — OpenCode is an open-source AI coding agent developed by Anomaly that operates across terminal environments, desktop applications, and IDE extensions.…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories