| Crates.io | terraphim-repl |
| lib.rs | terraphim-repl |
| version | 1.0.0 |
| created_at | 2025-11-25 15:03:03.639093+00 |
| updated_at | 2025-11-25 15:03:03.639093+00 |
| description | Offline-capable REPL for semantic knowledge graph search |
| homepage | |
| repository | https://github.com/terraphim/terraphim-ai |
| max_upload_size | |
| id | 1949916 |
| size | 179,865 |
Offline-capable REPL for semantic knowledge graph search.
terraphim-repl is a lightweight, standalone command-line interface for semantic search across knowledge graphs. It works completely offline with embedded defaults - no configuration required!
cargo install terraphim-repl
git clone https://github.com/terraphim/terraphim-ai
cd terraphim-ai
cargo build --release -p terraphim-repl
./target/release/terraphim-repl
terraphim-repl
You'll see:
============================================================
🌍 Terraphim REPL v1.0.0
============================================================
Type /help for help, /quit to exit
Mode: Offline Mode | Current Role: Default
Available commands:
/search <query> - Search documents
/config show - Display configuration
/role [list|select] - Manage roles
/graph - Show knowledge graph
/help [command] - Show help
/quit - Exit REPL
Default> _
Search for documents:
Default> /search rust async
🔍 Searching for: 'rust async'
View knowledge graph:
Default> /graph
📊 Top 10 concepts:
1. rust programming language
2. async
ynchronous programming
3. tokio async runtime
...
List available roles:
Default> /role list
Available roles:
▶ Default
Show configuration:
Default> /config show
{
"selected_role": "Default",
...
}
Get help:
Default> /help
Default> /help search # Detailed help for a command
Exit:
Default> /quit
Goodbye! 👋
Search for documents matching a query.
Syntax:
/search <query> [--role <role>] [--limit <n>]
Examples:
/search rust
/search api --role Engineer --limit 5
/search async tokio
Display current configuration.
Syntax:
/config [show]
Example:
/config show
Manage roles (list or select).
Syntax:
/role list
/role select <name>
Examples:
/role list
/role select Engineer
Show the knowledge graph's top concepts.
Syntax:
/graph [--top-k <n>]
Examples:
/graph
/graph --top-k 20
Show help information.
Syntax:
/help [command]
Examples:
/help
/help search
Exit the REPL.
Syntax:
/quit
/exit
/q
On first run, terraphim-repl creates:
~/.terraphim/config.json - Configuration file~/.terraphim/default_thesaurus.json - Starter thesaurus~/.terraphim_repl_history - Command historyEdit ~/.terraphim/config.json to:
Example custom role:
{
"roles": {
"Engineer": {
"name": "Engineer",
"relevance_function": "title-scorer",
"haystacks": [
{
"location": "~/docs",
"service": "Ripgrep"
}
]
}
},
"selected_role": "Engineer"
}
terraphim-repl is designed to work completely offline:
terraphim-repl is a minimal subset of terraphim_tui:
| Feature | terraphim-repl | terraphim_tui |
|---|---|---|
| REPL Interface | ✅ | ✅ |
| Full-screen TUI | ❌ | ✅ |
| Basic Search | ✅ | ✅ |
| Knowledge Graph | ✅ | ✅ |
| AI Chat | ❌ | ✅ |
| MCP Tools | ❌ | ✅ |
| Web Operations | ❌ | ✅ |
| VM Management | ❌ | ✅ |
| Binary Size | <50MB | ~100MB+ |
Use terraphim-repl for:
Use terraphim_tui for:
terraphim-repl maintains command history across sessions in ~/.terraphim_repl_history.
Features:
/clear to clear screenCheck that ~/.terraphim/ directory exists:
ls -la ~/.terraphim/
If not, the first run should create it automatically.
Make sure you've installed the binary:
cargo install terraphim-repl
# Or use full path:
./target/release/terraphim-repl
# Debug build
cargo build -p terraphim-repl
# Release build (optimized)
cargo build --release -p terraphim-repl
# Run directly
cargo run -p terraphim-repl
cargo test -p terraphim-repl
crates/terraphim_repl/
├── Cargo.toml # Minimal dependencies
├── README.md # This file
├── CHANGELOG.md # Version history
├── assets/ # Embedded defaults
│ ├── default_config.json
│ └── default_thesaurus.json
└── src/
├── main.rs # Entry point + asset loading
├── service.rs # Service wrapper
└── repl/ # REPL implementation
├── mod.rs
├── commands.rs # Command definitions
└── handler.rs # REPL loop + handlers
Licensed under Apache-2.0. See LICENSE for details.
Contributions welcome! Please:
See CHANGELOG.md for version history.