Metadata-Version: 2.4
Name: coder2api
Version: 0.1.2
Summary: Turn Gemini-CLI, Claude Code, and Codex into a local OpenAI-compatible API endpoint.
License: GPL-3.0-or-later
License-File: LICENSE
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Requires-Python: >=3.13
Requires-Dist: aiofiles>=23.0.0
Requires-Dist: aiosqlite>=0.19.0
Requires-Dist: alembic>=1.13.0
Requires-Dist: asyncio-mqtt>=0.16.0
Requires-Dist: certifi>=2024.0.0
Requires-Dist: click>=8.0.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: flask>=3.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: idna>=3.0
Requires-Dist: itsdangerous>=2.0.0
Requires-Dist: jinja2>=3.0.0
Requires-Dist: litestar>=2.12.0
Requires-Dist: markupsafe>=2.0.0
Requires-Dist: openai>=1.0.0
Requires-Dist: passlib[bcrypt]>=1.7.4
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: requests>=2.31.0
Requires-Dist: rich>=13.9.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: structlog>=23.0.0
Requires-Dist: typer>=0.12.0
Requires-Dist: urllib3>=2.0.0
Requires-Dist: uvicorn>=0.32.0
Requires-Dist: werkzeug>=3.0.0
Description-Content-Type: text/markdown

# coder2api

A unified wrapper for [Gemini CLI Proxy](coders/gemini-cli-proxy), [Claude Code API](coders/claude-code-api), and [ChatMock](coders/ChatMock).

This tool provides a single entry point to run and manage these local coding agent proxies, exposing them via a unified API endpoint.

## Installation

This project uses `uv` for dependency management.

```bash
uv sync
```

Because `coder2api` includes a Hatch build hook, running `uv sync` (or `pip install`) will automatically:
1.  Install Python dependencies.
2.  Run `npm install` and `npm run build` for the Gemini CLI Proxy (Node.js).

*Note: You must have Node.js and npm installed on your system.*

## Usage

### Unified Server

Start all services and the unified proxy:

```bash
uv run coder2api serve
```

This will start:
- **Gemini CLI Proxy** on port `3001`
- **ChatMock** on port `3002`
- **Claude Code API** on port `3003`
- **Unified Proxy** on port `8069`

You can access the APIs via the proxy:
- **Codex (ChatMock)**: `http://localhost:8069/codex/v1/...`
- **Claude Code**: `http://localhost:8069/cc/v1/...`
- **Gemini**: `http://localhost:8069/gemini/openai/...` or `http://localhost:8069/gemini/anthropic/...`

### CLI Wrappers

You can also use the CLI wrappers for individual tools:

**ChatMock (Codex):**
```bash
uv run coder2api codex --help
uv run coder2api codex login
```

**Claude Code API:**
```bash
uv run coder2api cc
```

**Gemini CLI Proxy:**
```bash
uv run coder2api gemini -- --help
```

## Logs

Logs for the background services are written to the `logs/` directory when running `serve`.

## License

This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
