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

Skip to content

ShunsukeHayashi/codex

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Codex Agentic

AI Agent Orchestration Platform - Where Local Intelligence Meets Autonomous Collaboration

License: Apache-2.0 Rust TypeScript


🎯 What is Codex Agentic?

Codex Agentic integrates Codex CLI (OpenAI's local coding agent) with Miyabi (autonomous development framework) to create a next-generation AI agent orchestration platform.

Integration Value

Codex CLI (Rust)          +          Miyabi (TypeScript)
Local Coding Agent                Multi-Agent Framework
                                  GitHub Integration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                          ↓
            Codex Agentic Platform
      Local + Cloud Collaborative AI Agents
         Issue β†’ PR Complete Automation
     Hierarchical Agent Organization

Core Features

πŸ€– Multi-Agent Collaboration

  • 7 Specialized Agents: Coordinator, Issue Analysis, Code Generation, Review, PR Creation, Deployment, Testing
  • Parallel Execution Engine: DAG-based dependency resolution
  • 5 Organizational Principles: Clear responsibility, authority, hierarchy, results, and unambiguity

πŸ”— Complete GitHub Integration

  • Projects V2: Real-time progress management
  • 53 Label System: State-based workflow management
  • 26 GitHub Actions: Complete automation workflows

πŸ› οΈ Developer Experience

  • Rust + TypeScript: Hybrid architecture
  • MCP Protocol: Model Context Protocol integration
  • Ratatui TUI: Beautiful terminal interface

πŸ“Š Automation

  • Issue β†’ Code Generation β†’ Review β†’ PR Creation β†’ Deployment
  • Auto-documentation generation (TypeScript/JavaScript AST analysis)
  • KPI dashboard & weekly report generation

πŸš€ Quick Start

Installation

# via npm (recommended)
npm install -g @openai/codex

# or Homebrew
brew install codex

# Run
codex

Using Miyabi Features

# GitHub Issue Analysis
codex "Analyze GitHub issue #42 and suggest labels"

# Issue β†’ PR Automation
codex "Create PR for issue #42 with automated code generation"

# Project Status Check
codex "Show GitHub project status with KPI metrics"

TypeScript SDK Usage

import { Codex } from "@openai/codex-sdk";
import { MiyabiAgents } from "@openai/codex-sdk/miyabi";

const codex = new Codex();
const miyabi = new MiyabiAgents({
  githubToken: process.env.GITHUB_TOKEN!,
});

// Issue analysis
const analysis = await miyabi.analyzeIssue(42);
console.log(`Labels: ${analysis.labels.join(", ")}`);

// Parallel agent execution
const result = await miyabi.runParallel({
  issue: 42,
  agents: ["codegen", "review", "pr"],
  concurrency: 3,
});

console.log(`PR created: ${result.pr_url}`);

πŸ“š Documentation

Integration Documentation (New)

Codex CLI (Existing)

For Developers


πŸ—οΈ Architecture

Hybrid Structure

codex/
β”œβ”€β”€ codex-rs/                    # Rust core (existing)
β”‚   β”œβ”€β”€ cli/                     # Main CLI
β”‚   β”œβ”€β”€ core/                    # Business logic
β”‚   β”œβ”€β”€ tui/                     # Ratatui TUI
β”‚   β”œβ”€β”€ exec/                    # Headless execution
β”‚   β”œβ”€β”€ mcp-client/              # MCP client
β”‚   └── mcp-server/              # MCP server
β”‚
β”œβ”€β”€ codex-miyabi/                # Miyabi integration (new)
β”‚   β”œβ”€β”€ packages/
β”‚   β”‚   β”œβ”€β”€ miyabi-mcp-server/  # MCP server implementation
β”‚   β”‚   β”œβ”€β”€ miyabi-agent-sdk/   # Agent SDK
β”‚   β”‚   β”œβ”€β”€ github-integration/ # GitHub API integration
β”‚   β”‚   └── doc-generator/      # Documentation generator
β”‚   β”œβ”€β”€ agents/                  # 7 specialized agents
β”‚   └── scripts/                 # Operation scripts
β”‚
└── sdk/typescript/              # TypeScript SDK (existing)
    └── src/miyabi/              # Miyabi API wrapper (new)

MCP Integration

Codex CLI (Rust)
    ↓
Codex Core
    ↓
MCP Client ─────[MCP Protocol]────→ Miyabi MCP Server
                                        ↓
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        CoordinatorAgent    GitHub API
                              ↓
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              IssueAgent  CodeGenAgent  ReviewAgent
                              ↓
                          PRAgent

πŸ€– Agent System

Hierarchical Agent Architecture

πŸ”΄ Coordinator Layer (Decision Authority)
  └─ CoordinatorAgent
     β”œβ”€ Task decomposition
     β”œβ”€ Agent selection
     └─ Execution monitoring

πŸ”΅ Specialist Layer (Execution Authority)
  β”œβ”€ IssueAgent        # Issue analysis & labeling
  β”œβ”€ CodeGenAgent      # Code generation
  β”œβ”€ ReviewAgent       # Code review
  β”œβ”€ PRAgent           # PR creation
  β”œβ”€ DeploymentAgent   # Deployment management
  β”œβ”€ TestAgent         # Test execution
  └─ GitHubAgent       # GitHub operations

🟒 Support Layer (Assistance)
  └─ DocAgent          # Documentation generation

Agent Execution Examples

# Issue Analysis (IssueAgent)
codex "Analyze issue #42"
# β†’ Auto-label with 53 label system
# β†’ Determine priority, type, and phase

# Code Generation (CodeGenAgent)
codex "Generate code for issue #42"
# β†’ Task decomposition
# β†’ Dependency analysis
# β†’ Code generation

# Quality Review (ReviewAgent)
codex "Review PR #123"
# β†’ Static analysis (ESLint/Clippy)
# β†’ Security scanning
# β†’ Quality scoring (0-100)

# Parallel Execution (CoordinatorAgent)
codex "Process issue #42 with all agents in parallel"
# β†’ DAG-based dependency resolution
# β†’ Parallel execution (max 3 concurrent)
# β†’ Result aggregation

πŸŽ“ Usage Examples

Example 1: Complete Issue β†’ PR Automation

# Single command
codex "Process GitHub issue openai/codex#42 from analysis to PR"

# Internal flow:
# 1. IssueAgent: Analyze & label
# 2. CoordinatorAgent: Task decomposition
# 3. CodeGenAgent: Code generation (parallel)
# 4. ReviewAgent: Code review (parallel)
# 5. PRAgent: Create draft PR
# 6. TUI: Real-time progress display

Example 2: Auto-Documentation Generation

# Generate documentation from TypeScript/JavaScript code
codex "Generate API documentation for ./src directory"

# Output:
# - API.md (Markdown)
# - Training materials (for AI)
# - GitHub Discussions post

Example 3: Project Management

# GitHub Projects V2 status check
codex "Show project status for 'Codex Development'"

# TUI display:
# β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
# β”‚ Codex Development Status    β”‚
# β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
# β”‚ ⏳ Pending:       5 issues  β”‚
# β”‚ ⚑ In Progress:   3 issues  β”‚
# β”‚ πŸ” Review:        2 issues  β”‚
# β”‚ βœ… Done:         42 issues  β”‚
# β”‚                             β”‚
# β”‚ πŸ“Š Quality Score: 85/100    β”‚
# β”‚ πŸ§ͺ Coverage:      83%       β”‚
# β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

βš™οΈ Configuration

MCP Server Configuration

# ~/.codex/config.toml

[[mcp_servers]]
name = "miyabi"
command = "node"
args = [
  "/path/to/codex/codex-miyabi/packages/miyabi-mcp-server/dist/index.js"
]
env = {
  GITHUB_TOKEN = "ghp_xxx",
  ANTHROPIC_API_KEY = "sk-ant-xxx"
}

Miyabi Configuration

[miyabi]
enabled = true
monthly_budget_usd = 500

[miyabi.thresholds]
warning = 0.8      # 80% warning
emergency = 1.5    # 150% emergency stop

[miyabi.agents]
parallel_concurrency = 3
default_agents = ["issue", "codegen", "review", "pr"]

πŸ” Security

Sandbox Execution

Codex CLI executes all commands in a sandboxed environment:

  • macOS: Seatbelt (Apple Sandbox)
  • Linux: Landlock LSM

Details: Sandbox & approvals

Security Scanning

Miyabi integration enables automatic:

  • Gitleaks: Secret scanning
  • CodeQL: Vulnerability detection
  • npm audit: Dependency checking
  • SBOM Generation: CycloneDX format

πŸ› οΈ Development

Build

# Rust part
cd codex-rs
cargo build --release

# TypeScript part
cd codex-miyabi
pnpm install
pnpm run build

# All
pnpm run build

Testing

# Rust
cd codex-rs
cargo test --all-features

# TypeScript
cd codex-miyabi
pnpm run test

# Coverage
pnpm run test:coverage

Coding Standards

  • Rust: cargo fmt -- --config imports_granularity=Item
  • TypeScript: ESM format, Conventional Commits
  • Details: CLAUDE.md

πŸ“Š Project Statistics

Integration Scale

Component Language Crates/Packages
Codex Core Rust 35+ crates
Miyabi Integration TypeScript 7 packages
Agents TypeScript 7 agents

Feature Coverage

Feature Codex CLI + Miyabi
Local Coding βœ… βœ…
TUI βœ… βœ… (enhanced)
MCP Client βœ… βœ…
MCP Server βœ… βœ… (Miyabi)
GitHub Integration ⚠️ Basic βœ… Complete
Multi-Agent ❌ βœ…
Auto-Documentation ❌ βœ…
Projects V2 ❌ βœ…

🀝 Contributing

Contribution Policy

External contributions are primarily accepted for bug fixes and security fixes.

For new features or behavior changes, please create an issue first and get approval from OpenAI team members. Unapproved contributions may be closed if they don't align with the roadmap.

Details: CONTRIBUTING.md

Development Workflow

  1. Create an Issue (or comment on existing)
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes (Conventional Commits)
  4. Run tests & linting
  5. Create Pull Request

CLA (Contributor License Agreement)

All contributors must accept the CLA:

I have read the CLA Document and I hereby sign the CLA

πŸ“œ License

Codex CLI (Original Work)

Copyright 2025 OpenAI

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Miyabi Integration (Derivative Work)

Copyright 2025 Shunsuke Hayashi

Licensed under the Apache License, Version 2.0 (the "License").

This work includes Derivative Works based on:
- Codex CLI by OpenAI (Apache-2.0)
- Autonomous-Operations (Miyabi) by Shunsuke Hayashi (MIT)

Modification Notice: This repository is a derivative work that integrates Miyabi (autonomous development framework) into OpenAI's Codex CLI.

Modified files:

  • README.md - Updated for integration project
  • pnpm-workspace.yaml - Added Miyabi packages
  • CLAUDE.md - Added Miyabi integration notes
  • New additions: codex-miyabi/, INTEGRATION_PLAN_MIYABI.md, AGENTS_OPERATION_PLAN.md

Original work's attribution and license are preserved in the LICENSE file.


🌟 Acknowledgments

This project builds upon:

  • OpenAI - Codex CLI development
  • Anthropic - Claude AI
  • Organizational Design Principles - Agent architecture foundation
  • Rust Community - Ratatui, Tokio, and other dependencies
  • TypeScript Community - All dependencies
  • Open Source Community - All contributors

πŸ”— Links


🌸 Codex Agentic - Where AI Agents Collaborate

"Where Local Intelligence Meets Cloud Collaboration"

GitHub Stars License: Apache-2.0

Install β€’ Documentation β€’ Contribute


Generated: 2025-10-10 Version: 0.1.0 (Miyabi Integration) Based on: Codex CLI + Autonomous-Operations (Miyabi)

About

Codex CLI + Miyabi Autonomous Agent SDK - AI-powered coding agent with 100% cost reduction mode

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 91.0%
  • TypeScript 6.1%
  • Python 1.6%
  • JavaScript 0.7%
  • Shell 0.2%
  • HTML 0.2%
  • Other 0.2%