| Crates.io | sabi-tui |
| lib.rs | sabi-tui |
| version | 0.1.7 |
| created_at | 2025-11-30 10:32:39.361042+00 |
| updated_at | 2025-12-04 15:01:03.510928+00 |
| description | Terminal AI agent with ReAct pattern - execute shell commands, run Python, analyze images |
| homepage | https://github.com/n4ar/sabi-tui |
| repository | https://github.com/n4ar/sabi-tui |
| max_upload_size | |
| id | 1958096 |
| size | 401,796 |
A terminal-based AI agent implementing the ReAct (Reasoning + Acting) pattern for system administration. Describe tasks in natural language, review AI-generated shell commands, and get analysis of results.

curl -sSL https://raw.githubusercontent.com/n4ar/sabi-tui/main/setup.sh | bash
Download from Releases:
| Platform | Binary |
|---|---|
| macOS (Apple Silicon) | sabi-macos-aarch64 |
| macOS (Intel) | sabi-macos-x86_64 |
| Linux (x64) | sabi-linux-x86_64 |
| Linux (ARM64) | sabi-linux-aarch64 |
git clone https://github.com/n4ar/sabi-tui.git
cd sabi-tui
cargo build --release
cp target/release/sabi ~/.local/bin/
Run sabi and follow the onboarding wizard:
🚀 Welcome to Sabi-TUI!
Select provider:
1) Gemini (Google AI)
2) OpenAI
3) OpenAI-compatible (Ollama, Groq, Together, etc.)
Choice [1]:
All config stored in ~/.sabi/:
# ~/.sabi/config.toml
# Provider: "gemini" or "openai"
provider = "gemini"
api_key = "your-api-key"
model = "gemini-2.5-flash"
# For OpenAI-compatible APIs (Ollama, Groq, etc.)
# provider = "openai"
# base_url = "http://localhost:11434/v1"
# model = "llama3.2"
# Gemini
provider = "gemini"
api_key = "your-gemini-key"
model = "gemini-2.5-flash"
# OpenAI
provider = "openai"
api_key = "sk-xxx"
model = "gpt-4o"
# Ollama (local)
provider = "openai"
base_url = "http://localhost:11434/v1"
model = "llama3.2"
# Groq
provider = "openai"
base_url = "https://api.groq.com/openai/v1"
api_key = "gsk_xxx"
model = "llama-3.3-70b-versatile"
sabi # Interactive TUI mode
sabi -q "prompt" # Quick query (text response)
sabi -x "prompt" # Execute mode (with confirmation)
sabi --safe # Safe mode (preview only)
sabi mcp <command> # Manage MCP servers
sabi --version # Show version
sabi --help # Show help
Get instant answers without entering the TUI:
# Quick query - get text response
sabi -q "what is my IP address"
# Execute mode - run command with confirmation dialog
sabi -x "list large files in current directory"
Execute mode (-x) shows:
| Command | Description |
|---|---|
/model [name] |
List or switch AI model |
/new |
Start new session |
/sessions |
List all sessions |
/switch <id> |
Switch to session |
/delete <id> |
Delete session |
/image <path> |
Analyze image file |
/usage |
Show token usage stats |
/export [file] |
Export chat to markdown |
/clear |
Clear chat history |
/help |
Show help |
/quit |
Exit |
Press Tab to autocomplete commands.
Use ! prefix to run shell commands directly without AI:
!ls -la # List files
!pwd # Print working directory
!cat file.txt # View file contents
| Key | Action |
|---|---|
Enter |
Submit / Execute |
Esc |
Cancel / Quit |
Tab |
Autocomplete |
Ctrl+O |
Paste image from clipboard |
↑/↓ |
Scroll history |
Ctrl+C |
Force quit |
Extend Sabi with external tools via MCP servers (stdio or HTTP).
# Add stdio server
sabi mcp add <name> <command> [args...]
# Add HTTP server
sabi mcp add -t http -H "API-KEY: xxx" <name> <url>
# Set environment variable (stdio)
sabi mcp env <name> KEY=VALUE
# List configured servers
sabi mcp list
# Remove a server
sabi mcp remove <name>
# Filesystem server (stdio)
sabi mcp add filesystem npx -y @modelcontextprotocol/server-filesystem /home
# Git server (stdio)
sabi mcp add git npx -y @modelcontextprotocol/server-git
# Brave Search with API key (stdio)
sabi mcp add brave npx -y @anthropic/mcp-server-brave-search
sabi mcp env brave BRAVE_API_KEY=your-api-key
# Context7 (HTTP)
sabi mcp add -t http -H "CONTEXT7_API_KEY: your-key" context7 https://mcp.context7.com/mcp
# HTTP server with multiple headers
sabi mcp add -t http -H "Authorization: Bearer xxx" -H "X-Custom: value" myserver https://example.com/mcp
Servers are stored in ~/.sabi/mcp.toml. See examples/mcp.toml.example for a complete example.
Commands targeting sensitive paths (~, /Users, /etc) or using destructive patterns (rm -rf) require:
⚠️ DANGEROUS COMMAND DETECTED!
This command could cause irreversible damage.
Press Enter again to proceed to final confirmation.
🛑 FINAL CONFIRMATION REQUIRED
Type exactly: I understand the risks
AI cannot create arbitrary tools. Only allowed:
run_cmd - Shell commandsrun_python - Python coderead_file / write_file - File operationssearch - File searchmcp - MCP server toolsOperations on these paths trigger safety checks:
~, /Users, /home, /root/etc, /var, /usr, /bin, /sbin/System, /Library, /Applications| Tool | Description |
|---|---|
run_cmd |
Execute shell command |
run_python |
Execute Python code |
read_file |
Read file contents |
write_file |
Write to file |
search |
Search for files |
mcp |
Call MCP server tools |
Run sabi to start onboarding, or edit ~/.sabi/config.toml
Install Python 3: brew install python3 (macOS) or apt install python3 (Linux)
Use /model to list available models and switch
npx -y @modelcontextprotocol/server-filesystem --helpsabi mcp list# Using uninstall script
curl -sSL https://raw.githubusercontent.com/n4ar/sabi-tui/main/uninstall.sh | bash
# Or manually
rm ~/.local/bin/sabi
rm -rf ~/.sabi
MIT