semvec/pypi-packages huggingface dataset:
opencode-rlm 0.1.0
Production-grade TUI for AI-assisted development with RLM context management
License: MIT
Requires Python: >=3.11
Keywords: ai, anthropic, claude, coding, development, gpt, llm, openai, rlm, terminal, tui

# opencode-rlm

AI-powered development tool with TUI interface and Recursive Language Model (RLM) context management for unlimited conversation context.

## Features

- **RLM Context Management**: Automatic context archival and retrieval enables conversations beyond context window limits
- **Multi-Provider Support**: Anthropic (Claude), OpenAI (GPT-4), and more
- **Rich TUI Interface**: Full-featured terminal UI with Textual
- **14 Built-in Tools**: bash, read, write, edit, glob, grep, todo, webfetch, memory, and more
- **Session Management**: Fork, export, and manage conversation sessions
- **Slash Commands**: `/context`, `/search`, `/compact`, `/models`, `/agents`

## Installation

### via npm (recommended)

```bash
npm install -g opencode-rlm
```

### via pip

```bash
pip install opencode-rlm
```

### From source

```bash
git clone https://github.com/tekcin/opencode-rlm.git
cd opencode-rlm
pip install -e .
```

## Requirements

- Python 3.11+
- Node.js 16+ (for npm installation)

## Usage

```bash
# Start the TUI
opencode

# Start with a specific project
opencode /path/to/project

# Continue last session
opencode --continue

# Run a single command (non-interactive)
opencode run "explain this codebase"

# List available models
opencode models
```

## Configuration

Create `~/.config/opencode/config.json`:

```json
{
  "model": "anthropic/claude-sonnet-4",
  "theme": "opencode",
  "rlm": {
    "enabled": true,
    "threshold_ratio": 0.33,
    "auto_retrieve": true
  }
}
```

## Environment Variables

```bash
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...
```

## RLM (Recursive Language Model)

RLM enables unlimited context by automatically:

1. **Tracking** token usage across the conversation
2. **Archiving** older context when threshold is reached (default: 33%)
3. **Retrieving** relevant archived context for new queries
4. **Injecting** context into the conversation seamlessly

### Manual RLM Commands

- `/context` - Show current token usage
- `/search <query>` - Search archived context
- `/compact` - Manually trigger context archival

### RLM Tools

- `memory` - Search and retrieve archived context
- `rlm_query` - Execute Python queries on archived context

## License

MIT

## Author

Michael Thornton (tekcin@yahoo.com)