rem is a beginner-focused coding assistant that runs in your terminal and
works with any LLM provider (Ollama, OpenAI, Anthropic, Gemini, Azure, AWS Bedrock,
OpenRouter, DeepSeek). It is designed for HTML, CSS, terminal basics, and project scaffolding,
with a structured contract so model output is predictable and safe to preview.
The CLI is written in Rust (rem-cli/) and supports 10 LLM providers, 36+ slash
commands, BM25 codebase indexing (with MessagePack + memmap), autonomous
goal loops, and a polished terminal UI with 6 color themes.
curl -fsSL https://raw.githubusercontent.com/csy20/rem-cli/main/install.sh | bashSupported platforms: x86_64 / aarch64 on Linux and macOS (Apple Silicon included).
# Build the image
cd rem-cli && docker build -t rem-cli .
# Run with Ollama sidecar
docker-compose up -d
docker-compose exec rem ask "create a basic html page"cd rem-cli
cargo build --release
./target/release/rem ask "create a basic html page with linked css"Requires Rust 1.78+ and a running Ollama instance (or API key for other providers).
# One-shot coding question
rem ask "create a simple html page with a header and footer"
# Safe terminal-command explanation
rem explain "rm -rf build"
# Patch preview for a file
rem patch --file index.html --task "add a navigation bar"
# Scaffold a new project
rem new my-site --project-type landing
# Interactive chat (REPL)
rem chat# Analyze logs
tail -100 app.log | rem
# Review git changes
git diff main | rem
# Check error output
cargo build 2>&1 | rem- 10 LLM providers: Ollama (default), OpenAI, Anthropic Claude, Google Gemini, Azure OpenAI, AWS Bedrock, OpenRouter, DeepSeek, GitHub Models, xAI Grok
- Three interaction modes: CHAT (conversation), CODE (generation), PLAN (analysis)
- Streaming responses: tokens appear as they're generated
- Pipe mode:
cat error.log | remβ non-interactive stdin processing - @ file references:
fix the bug in @src/utils/auth.jsβ inject file/dir context - Persistent project memory:
.rem/memory.mdwith auto-generation per project type
- Autonomous goal loop (
/goal): iteratively generates code, runs lint/tests, feeds results back to the LLM until goal met β with checkpointing and circuit breakers - Multi-file generation: auto-detects
### path/to/fileheadings in LLM output - Atomic file writes: temp + rename pattern with backup for undo
- Edit tool (
edit_file): replaces the first occurrence ofold_stringwhen multiple matches exist - Undo stack:
/undoreverts file creates/overwrites,/undo Nfor N levels
- Codebase indexing: pure-Rust BM25 retrieval with incremental updates, MessagePack format (60-80% smaller), and memmap-based loading
- Web search: DuckDuckGo, Google, Bing integration
- Filesystem search:
/find <query>with gitignore-awareness and regex mode - Relevant project context: auto-injected from BM25 index on each query
- 6 built-in color themes: GHOST (dark), PHOSPHOR (green), MIST (blue), PAPER (light), SAKURA (pink), EMBER (orange), CONTRAST (high-contrast)
- Custom themes: TOML-based theme files in
~/.config/rem-cli/themes/ - Syntax highlighting: language-aware code highlighting in terminal output
- Dynamic terminal width: adapts to terminal resize (SIGWINCH)
- Grouped
/help: commands organized by category (Session, Code, Tools, Project, Model, System)
- Command blocklist: dangerous patterns (rm -rf /, dd, chmod 777, pipe to shell) are flagged and blocked
- Path traversal prevention:
resolve_safe_pathensures writes stay within workspace - API key redaction: sensitive keys are redacted from error messages
- Non-shell execution: tool commands use safe subprocess APIs with timeouts
| Command | Description |
|---|---|
/help |
Show help with category groups |
/clear |
Clear chat history |
/reset |
Full reset β history, code cache, search |
/mode |
Toggle CHAT β CODE β PLAN |
/plan |
Switch directly to PLAN mode |
/save [path] |
Save session or write to file |
/resume |
Restore saved session |
/session export/import |
Export/import session data |
/compact |
Summarize & free context window |
/compact-dry-run |
Preview compaction |
/context |
Show full assembled prompt with token/turn/duration stats |
/edit |
Open $VISUAL/$EDITOR for multi-line input |
/why |
Show intent classification reasoning |
/summary |
Generate session summary via LLM |
/ping |
Test provider connectivity & latency |
/status |
Show session overview (tokens, time, turns, index) |
| Command | Description |
|---|---|
/write <path> |
Save last generated code to file |
/code |
Show last generated files |
/undo [N] |
Undo last N file writes |
/diff |
Compare generated vs existing files |
/apply |
Apply the last diff |
/copy [N] |
Copy last N responses to clipboard |
/goal <condition> |
Autonomous loop until condition met |
/vision <path> |
Analyze an image with the LLM |
| Command | Description |
|---|---|
/search <query> |
Search the web |
/explain <code> |
Explain what code does |
/test <file> |
Generate tests for a file |
/refactor <file> |
Suggest refactoring improvements |
/review |
AI code review of generated code |
/lint [file] |
Run linter on generated files |
/find <query> |
Search text inside the project |
| Command | Description |
|---|---|
/dir <path> |
Set project workspace directory |
/files |
List project file tree |
/memory [key=val] |
View or update project memory |
/config [key=val] |
View or update configuration |
/config edit |
Open config in $EDITOR with auto-reload |
/init |
Auto-generate .rem/memory.md |
/reload |
Reload config from disk |
| Command | Description |
|---|---|
/model <name> |
Show or change the active model |
/provider <name> |
Switch LLM provider |
/models |
List available models |
/pull <model> |
Pull a model via Ollama |
/reasoning [on/off/effort] |
Configure reasoning/thinking mode |
| Command | Description |
|---|---|
/theme [name] |
Change the color theme |
/tokens |
Show token usage & context stats |
/watch |
Watch files for changes and auto-retry |
/commit [msg] |
Stage all changes and git commit |
rem> explain the authentication flow in @src/auth.rs
rem> what tests cover @tests/integration/ ?
rem> fix the bug β @src/utils.ts handles this poorly
- Files: contents injected (up to 8000 chars)
- Directories: file listing with entry count injected
- HTTP URLs: ignored (pass through without injection)
REM stores project conventions in .rem/memory.md:
# Auto-generate from project structure
rem> /init
# View current memory
rem> /memory
# Add a convention
rem> /memory add Always use async/await, never .then()The memory file is loaded automatically at the start of every session, and language-specific guidance is injected into the system prompt.
Copy rem-cli/.remcli.toml.example to .remcli.toml in your project root, or
create ~/.config/rem-cli/config.toml.
model = "qwen2.5-coder:1.5b"
ollama_url = "http://localhost:11434"
timeout_s = 120
max_context_bytes = 16000
workspace_dir = "."
mode = "CHAT"
# For remote providers:
# api_key = "sk-..."
# provider = "openai"- Built-in defaults
- Global config:
~/.config/rem-cli/config.toml - Local config:
.remcli.tomlin project root - CLI arguments (e.g.
--model,--provider)
- Ollama (for local models):
ollama pull qwen2.5-coder:1.5b - Or an API key for: OpenAI, Anthropic, Gemini, Azure, OpenRouter, DeepSeek
For low-RAM machines (4-6 GB):
export OLLAMA_FLASH_ATTENTION=1
export OLLAMA_KV_CACHE_TYPE=q8_0
export OLLAMA_MMAP=1
export OLLAMA_MAX_LOADED_MODELS=1Set the corresponding environment variable or add to config:
| Provider | Env var | Config key |
|---|---|---|
| OpenAI | OPENAI_API_KEY |
api_key |
| Anthropic | ANTHROPIC_API_KEY |
api_key |
| Gemini | GEMINI_API_KEY |
api_key |
| Azure | AZURE_OPENAI_API_KEY |
api_key |
| OpenRouter | OPENROUTER_API_KEY |
api_key |
| DeepSeek | DEEPSEEK_API_KEY |
api_key |
| GitHub Models | GITHUB_TOKEN |
api_key |
| xAI Grok | XAI_API_KEY |
api_key |
- Dangerous command patterns are flagged and blocked in output
- The CLI does not execute shell commands from LLM output directly
- Tool execution uses safe subprocess APIs with configurable timeouts
- Path traversal is prevented by
resolve_safe_pathdirectory checks - API keys are redacted from error messages to prevent leakage
If you see Ollama request failed: 404:
- Ensure Ollama is running:
ollama list - Run with explicit model:
rem --model qwen2.5-coder:1.5b chat - If base URL includes
/api, the CLI handles it automatically
If you see Connection refused:
- Ensure Ollama is running on the expected port (default: 11434)
- For Docker: use
http://ollama:11434(internal Docker network)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLI Layer (main.rs + cli.rs) β
β Argument parsing, config loading, Ctrl+C handling β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β REPL Layer (repl.rs) β
β Interactive loop: read input β dispatch commands β LLM β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Command Handlers (commands/) β
β 34+ slash commands organized by category β
βββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββ€
β Provider Layer β Indexer Layer β Session Layer β
β 8 LLM providers β BM25 retrieval β History mgmt β
β Streaming + β Incremental index β Context assembly β
β Tool calling β Chunking β Mode switching β
βββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββ
cd rem-cli
cargo test # Run all tests (558+ unit, 18 integration)
cargo clippy # Lint check (zero warnings target)
cargo build --release # Release build
just all # Run all: check, lint, fmt, test, build-releaseSee AGENTS.md for detailed code conventions and project structure.
MIT