Metadata-Version: 2.4
Name: novacode-tui
Version: 0.1.7
Summary: The most powerful TUI AI Coding Agent — surpasses Claude Code & OpenCode with NVIDIA NIM, multi-key rotation, KIMI K2.6 & DeepSeek V4 Pro support
Author: NovaCode Team
License: MIT
Keywords: ai,coding,agent,tui,nvidia-nim,claude-code-alternative
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Debuggers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: textual>=1.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: httpx-sse>=0.4.0
Requires-Dist: rich>=13.7.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: click>=8.1.0
Requires-Dist: pathspec>=0.12.0
Requires-Dist: platformdirs>=4.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# NovaCode ⚡

**The most powerful TUI AI Coding Agent — surpasses Claude Code and OpenCode.**

[![pip install](https://img.shields.io/badge/pip-install%20novacode--tui-blue)](https://pypi.org/project/novacode-tui/)
[![npm install](https://img.shields.io/badge/npm-install%20novacode--tui-red)](https://www.npmjs.com/package/novacode-tui)
[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-green)](https://python.org)
[![MIT License](https://img.shields.io/badge/license-MIT-purple)](LICENSE)

```
  ╔══════════════════════════════════════════╗
  ║          NovaCode — AI Coding Agent      ║
  ║    More powerful than Claude Code ✨      ║
  ╚══════════════════════════════════════════╝
```

---

## ✨ What makes NovaCode special?

| Feature | NovaCode | Claude Code | OpenCode |
|---------|----------|-------------|----------|
| **Multi-key rotation** | ✅ Auto-failover | ❌ | ❌ |
| **NVIDIA NIM** | ✅ Native | ❌ | ❌ |
| **KIMI K2.6 via NIM** | ✅ No separate key | ❌ | ❌ |
| **DeepSeek V4 Pro streaming** | ✅ True SSE streaming | ❌ | ❌ |
| **Agentic tool loop** | ✅ Parallel execution | ✅ Sequential | ✅ Sequential |
| **Web search** | ✅ Built-in | ❌ | ❌ |
| **Context windowing** | ✅ Smart | ✅ | ✅ |
| **Plan/Build modes** | ✅ | ✅ | ✅ |
| **File tree sidebar** | ✅ Coming | ❌ | ❌ |
| **Token tracking** | ✅ Real-time | ✅ | ❌ |

## 🚀 Quick Start

### Install via pip (recommended)

```bash
pip install novacode-tui
```

### Install via npm

```bash
npm install -g novacode-tui
# npm wrapper will detect Python and prompt to install the Python package
```

### Install from source

```bash
git clone https://github.com/novacode-ai/novacode.git
cd novacode
pip install -e .
# Or via npm:
npm link ./npm
```

## 🔑 Configuration

### 1. Add NVIDIA NIM API Keys

Get free NIM keys from [build.nvidia.com](https://build.nvidia.com/):

```bash
novacode keys add
# Paste your NVIDIA NIM API key

# Add multiple keys for auto-rotation:
novacode keys add
novacode keys add
```

### 2. Add NIM API keys (same keys used for all models, including KIMI K2.6)

```bash
# Add as many keys as you want — NovaCode auto-rotates
novacode keys add
# Paste your NVIDIA NIM API key
```

### 3. List configured keys

```bash
novacode keys list
```

## 🎮 Usage

```bash
# Launch the TUI (interactive chat)
novacode

# Use a specific model
novacode --model moonshotai/kimi-k2.6
novacode --model deepseek/deepseek-v4-pro

# Send a one-off message (non-TUI)
novacode chat "refactor this code to use async/await"

# List available models
novacode models

# Edit configuration
novacode config
```

### TUI Keyboard Shortcuts

| Key | Action |
|-----|--------|
| `Ctrl+C` | Quit |
| `Ctrl+L` | Clear chat |
| `Ctrl+N` | New session |
| `Ctrl+S` | Focus input |
| `Ctrl+A` | Toggle auto-approve |
| `Esc` | Focus input |

## 🤖 Supported Models

| Model ID | Description |
|----------|-------------|
| `nvidia/llama-3.3-nemotron-super-49b` | NVIDIA's best — speed + quality |
| `moonshotai/kimi-k2.6` | KIMI K2.6 thinking model (served via NVIDIA NIM) |
| `deepseek/deepseek-v4-pro` | DeepSeek V4 Pro with true reasoning streaming |
| `nvidia/llama-3.1-8b-instruct` | Fast, lightweight |

### Model-specific behavior

- **KIMI K2.6**: Served via NVIDIA NIM (uses the same NIM keys). Thinking mode requires `temperature=1.0`, non-thinking requires `0.6`. No `tool_choice: "required"`.
- **DeepSeek V4 Pro**: Uses `reasoning_content` field for CoT streaming (no chunked dump). Can disable thinking via config.

## 🛠 Agentic Capabilities

NovaCode includes a powerful suite of tools:

| Tool | Description | Auto-confirm |
|------|-------------|:---:|
| `read` | Read file contents with line offsets | ✅ |
| `write` | Write content to files | ❌ |
| `edit` | Targeted find-and-replace edits | ❌ |
| `search` | Regex codebase search | ✅ |
| `bash` | Execute shell commands | ❌ |
| `list_dir` | List directory contents | ✅ |
| `glob` | Find files by glob pattern | ✅ |
| `file_info` | Get file metadata | ✅ |
| `web_search` | Search the web | ✅ |

## 🔄 Multi-Key Rotation

NovaCode's key rotation system automatically:

- **Round-robins** through available NIM keys
- **Detects 429 rate limits** and moves to the next key
- **Cooldowns** rate-limited keys for configurable intervals
- **Resets** expired cooldowns automatically
- **Tracks usage** per key (uses least-used strategy when configured)

```bash
# Configure strategy
novacode config  # Edit rotation_strategy: "round-robin" or "least-used"
```

## 🧠 Architecture

```
novacode/
├── __main__.py       # CLI entry point (click)
├── config.py         # JSON config, multi-key, multi-model
├── client/
│   ├── nim.py        # NVIDIA NIM + OpenAI-compatible client
│   └── rotation.py   # Multi-key rotation engine
├── agent/
│   ├── engine.py     # Tool execution loop
│   ├── tools.py      # Tool definitions (9 built-in tools)
│   └── context.py    # Token-aware context windowing
├── ui/
│   └── app.py        # Textual TUI application
├── models/
│   └── ...           # Model definitions & configs
└── utils/
    └── helpers.py    # Utility functions
```

## 📦 Development

```bash
git clone https://github.com/novacode-ai/novacode.git
cd novacode
pip install -e ".[dev]"

# Run tests
pytest

# Type check
mypy src/novacode

# Lint
ruff check src/novacode
```

## 🌟 Roadmap

- [ ] LSP integration for context-aware code understanding
- [ ] Multi-session management
- [ ] Custom tool creation DSL
- [ ] Project-level memory & patterns
- [ ] VSCode / JetBrains extension
- [ ] Local model support (Ollama, llama.cpp)
- [ ] Collaborative sessions

## 📄 License

MIT License — see [LICENSE](LICENSE)

---

> **NovaCode** — Because your code deserves the best agent.
