Metadata-Version: 2.4
Name: codrninja
Version: 1.2.6
Summary: Terminal coding assistant with TypeScript TUI — multi-provider, session-based
Author: 20ZollCoder
License: MIT
Project-URL: Homepage, https://github.com/20ZollCoder/codrninja
Project-URL: Repository, https://github.com/20ZollCoder/codrninja
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Requires-Dist: prompt_toolkit>=3.0.0
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: rich>=10.0.0
Requires-Dist: textual>=0.50.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn>=0.20.0
Requires-Dist: sse-starlette>=1.6.0
Requires-Dist: pydantic>=2.0.0
Dynamic: license-file

# 🥷 codrninja

A terminal coding assistant with a TypeScript TUI — powered by the AI provider of your choice.

## Providers

| Provider | Setup | Notes |
|----------|-------|-------|
| **claude-cli** | Claude Code installed | Uses your Claude Code subscription — no API key needed |
| **OpenAI** | OAuth or API key | gpt-4o, gpt-5, codex models |
| **Anthropic** | OAuth or API key | claude-sonnet, claude-opus |
| **Ollama** | Local server | Any local model |
| **OpenRouter** | API key | Access to all major models |

## Install

```bash
pip3 install codrninja
```

Then start the TUI:

```bash
codrninja
```

The server starts automatically in the background. On first run, configure your provider via `/provider`.

### TypeScript TUI (recommended)

codrninja uses a TypeScript TUI built with Ink. On first launch it looks for the TUI at `~/codrninja-tui`. If not found it falls back to the built-in Textual TUI.

To use the full TUI, clone it next to your home directory:

```bash
git clone https://github.com/20ZollCoder/codrninja-tui ~/codrninja-tui
cd ~/codrninja-tui && npm install
```

## Quick Start

```bash
# Install
pip3 install codrninja

# Start
codrninja

# Inside the TUI — configure a provider:
/provider

# Select claude-cli to use your Claude Code subscription (no API key needed)
# Or select openai / anthropic and authenticate via OAuth or API key
```

## TUI Slash Commands

| Command | Description |
|---------|-------------|
| `/provider` | Switch or configure AI provider |
| `/model` | Change model for this session |
| `/exec <cmd>` | Run a shell command |
| `/search <query>` | Web search |
| `/fetch <url>` | Fetch a web page |
| `/commit <msg>` | Git add -A and commit |
| `/diff` | Show current git diff |
| `/test` | Run tests |
| `/build <task>` | Run build agent |
| `/plan <task>` | Run plan agent |
| `/clear` | Clear the conversation |
| `/undo` | Remove the last message pair |
| `/session` | Show session info |
| `/status` | Show provider / model status |
| `/help` | Show all commands |
| `/exit` | Quit |

## Sessions

codrninja organises work into named sessions. Each session has its own conversation history and can have its own model and provider.

```bash
# Open a specific session directly
codrninja my-project

# Or use the CODRNINJA_SESSION env var
CODRNINJA_SESSION=my-project codrninja
```

## Configuration

Provider and model settings are stored in `~/.config/codrninja/config.json` and can be changed at any time from within the TUI via `/provider` and `/model`.

The server runs on port `7384` by default. Override with:

```bash
codrninja serve --port 8000
CODRNINJA_SERVER=http://127.0.0.1:8000 codrninja
```

## Links

- **GitHub:** https://github.com/20ZollCoder/codrninja
- **Issues:** https://github.com/20ZollCoder/codrninja/issues

## License

MIT
