Lightweight AI assistant framework in Rust with pluggable LLM providers (Ollama, llama.cpp, vLLM), built-in tool calling, agent skills, and customizable system prompts.

docs/examples/sockudo-worker/). Ollama supports retries with backoff, configurable timeouts, and reasoning/think levels.ls, read, write, edit, grep, glob, run, web_search, web_fetch, auto_compact, invoke_skill, switch_mode, question, screenshot, plus the built-in read image loader for multimodal models).casual (web-only), planning (read-only + signals), agent (full access), and research (web-focused) — to control what the AI can do. Modes are backed by customizable .md prompt files.~/.config/tinyharness/skills/ and .tinyharness/skills/. Invokable by the AI via invoke_skill or by the user via /use <name>. Supports YAML frontmatter with name, description, compatibility, licensing, and model-invocation controls./compact.~/.local/share/tinyharness/sessions/. Supports session listing, switching by prefix, renaming, deletion, and auto-save every 5 messages.tokio for efficient streaming with all providers. Ctrl+C interrupts generation gracefully.--tui. ⚠️ Experimental — may have rendering issues or incomplete features.~/.config/tinyharness/prompts/ and can be freely edited./showthink)./image and the read tool automatically loads image files for visual models.TINYHARNESS.md, .tinyharness.md, AGENTS.md, or CLAUDE.md walking up from the current directory. Configurable via TINYHARNESS_MD_FILES env var or settings. Additional project-specific files (e.g. RULES.md, .cursorrules) can be loaded from .tinyharness/config.json..tinyharness/config.json over global settings. Override safe/denied commands, auto-accept behavior, context limits, preferred mode, and more per project. View merged settings with /project-settings.docs/examples/sockudo-worker/)git clone https://github.com/yourusername/TinyHarness.git
cd TinyHarness
make install
This builds in release mode and copies the binary to ~/.local/bin. Make sure ~/.local/bin is in your $PATH:
export PATH="$HOME/.local/bin:$PATH"
To uninstall:
make uninstall
Alternatively, install via Cargo:
cargo install --path .
A Nix flake is provided for reproducible builds and dev environments.
Run once without installing:
nix run github:PTFOPlayer/TinyHarness
Build the package:
cd TinyHarness
nix build
./result/bin/tinyharness
Enter a development shell (with Rust toolchain, rustfmt, and clippy pre-configured):
nix develop
Ollama (default):
tinyharness
Connects to http://127.0.0.1:11434. Supports configurable timeout, retries, and think/reasoning level.
llama.cpp:
tinyharness --llama-cpp
Connects to http://127.0.0.1:8080 by default.
vLLM:
tinyharness --vllm
Connects to http://127.0.0.1:8000 by default.
OpenAI-compatible gateway (OpenRouter, Together, custom proxies, etc.):
tinyharness --openai-compat --url https://openrouter.ai/api/v1 --api-key <YOUR_KEY>
Requires --url (no default URL) and an API key. You can also set the OPENAI_API_KEY environment variable instead of --api-key. Bearer auth is sent on every request. Use --skip-health-check if the gateway doesn't expose a /health endpoint.
Sockudo (⚠️ highly experimental):
tinyharness --sockudo
Connects to http://127.0.0.1:6001 by default. Requires a running Sockudo server with AI Transport enabled and a worker bridge process (see docs/examples/sockudo-worker/). This backend is not recommended for production use.
A health check runs on startup to verify the provider is reachable. If the saved model is unavailable, the first available model is auto-selected with a warning.
Custom URL (works with any provider):
tinyharness --llama-cpp --url http://localhost:2832
tinyharness --ollama --url http://192.168.1.50:11434
tinyharness --vllm --url http://gpu-server:8000
tinyharness --openai-compat --url https://api.example.com/v1 --api-key sk-xxx
Continue last session:
tinyharness --continue
Resumes the most recent session in the current working directory.
Non-interactive prompt:
tinyharness -p "What does this project do?"
tinyharness --prompt "Explain the architecture"
Sends an initial prompt and then drops into the interactive loop for follow-up turns.
Terminal UI (experimental):
tinyharness --tui
Launches a split-pane TUI with conversation view, sidebar, input bar, and tool output panel. Built from scratch using raw ANSI escape sequences — no external TUI framework. This is experimental and may have rendering issues or incomplete features.
Interactive setup:
tinyharness --config
Runs a guided setup: pick a provider, enter a URL, save to settings. Exits when done.
| Flag | Description |
|---|---|
-o, --ollama |
Use the Ollama provider (default) |
-l, --llama-cpp |
Use the llama.cpp provider |
-v, --vllm |
Use the vLLM provider |
--openai-compat |
Use a generic OpenAI-compatible gateway (requires --api-key and --url) |
--sockudo |
Use the Sockudo AI Transport provider (⚠️ highly experimental) |
-u, --url <url> |
Custom base URL for the provider |
--api-key <key> |
Bearer token for --openai-compat (use - to clear saved key) |
--skip-health-check |
Skip provider health check at startup |
-c, --continue |
Continue the most recent session in the current directory |
--config |
Run interactive provider setup, then exit |
-p, --prompt <text> |
Start with this message, then drop into interactive mode |
--tui |
Launch the experimental terminal UI (split-pane TUI) |
| Mode | Tools Available | Purpose |
|---|---|---|
| casual | web_search, web_fetch |
Pure chat with web access, no filesystem access |
| planning | All read-only tools + signal tools | Analyze & plan, then escalate to agent |
| agent | All 15 tools | Full development access — code, commands, web |
| research | All read-only tools + signal tools | Web research, then escalate for execution |
Switch modes with /mode <name>, use shortcut aliases (/plan, /agent, /research, /casual), or let the AI request escalation via switch_mode.
| Tool | Category | Description |
|---|---|---|
ls |
ReadOnly | List directory contents |
read |
ReadOnly | Read file content (also loads images for multimodal models) |
grep |
ReadOnly | Search with regex across files |
glob |
ReadOnly | Find files by glob pattern |
web_search |
ReadOnly | Search the web (requires Ollama API key) |
web_fetch |
ReadOnly | Fetch a web page by URL |
write |
Destructive | Write content to a file |
edit |
Destructive | Edit a file by find-and-replace |
run |
Destructive | Execute shell commands with timeout & working directory |
switch_mode |
Signal | Request a mode switch |
question |
Signal | Ask the user a question with options |
auto_compact |
Signal | Request conversation compaction |
invoke_skill |
Signal | Activate a skill by name |
screenshot |
Signal | Request a screenshot from the user |
| Command | Description |
|---|---|
/sessions |
List all saved sessions (most recent first) |
/session <id> |
Switch to an existing session by ID prefix |
/session delete <id\|name> |
Delete a session with confirmation |
/rename <name> |
Rename the current session |
| Command | Description |
|---|---|
/mode [casual\|planning\|agent\|research] |
Show or switch agent mode |
/plan, /agent, /research, /casual |
Quick mode switch aliases |
/model [name] |
List available models or switch to one |
| Command | Description |
|---|---|
/add <path> |
Pin a file into context |
/drop <path> |
Remove a pinned file from context |
/files |
List all pinned files |
/dropall |
Remove all pinned files |
/refresh |
Re-read pinned files from disk |
/context |
Show auto-detected project context |
/init |
Generate or update TINYHARNESS.md |
/project-settings [init] |
Show or initialize per-project settings |
| Command | Description |
|---|---|
/compact [focus] |
Summarize conversation history (with cascading for long sessions) |
/image [<path>\|clear\|drop <n>] |
Attach an image to the next message |
| Command | Description |
|---|---|
/skills |
List all available skills |
/skill <name> |
Show a skill's details and content |
/use <name> |
Activate a skill, injecting its instructions |
/unload <name> |
Deactivate a previously loaded skill |
| Command | Description |
|---|---|
/settings [all] |
Show current configuration |
/command [list\|add\|rm\|deny\|undeny\|reset\|resetdeny] |
Manage auto-accepted and denied commands |
/apikey [key\|clear] |
Set, show, or clear the Ollama API key (needed for web_search) |
/contextlimit [tokens] |
Show or set the context warning threshold |
/autoaccept [all\|safe\|off] |
Show or set auto-accept mode (off, safe = read-only, all = all tools except run) |
/autocompact [on\|off] |
Toggle the auto_compact tool (when off, the model cannot request compaction) |
/showthink [on\|off] |
Toggle display of the model's thinking/reasoning chain |
/timeout <seconds> |
Set Ollama request timeout (default: 5s) |
/retries <count> |
Set Ollama max retries (default: 3) |
/think [off\|low\|medium\|high] |
Set Ollama reasoning/think level |
/audit [last\|session\|clear] |
View command execution audit log |
| Command | Description |
|---|---|
/help |
Show available commands |
/clear |
Clear terminal screen |
/debug [path] |
Dump full conversation context to a log file (for diagnostics) |
/exit or /quit |
Exit TinyHarness |
The /command system controls which shell commands are auto-accepted:
/command list # Show safe and denied commands
/command add <cmd> # Add a command to auto-accept list
/command rm <cmd> # Remove from auto-accept list
/command deny <cmd> # Add to deny list (always requires confirmation)
/command undeny <cmd> # Remove from deny list
/command reset # Reset safe commands to defaults
/command resetdeny # Clear the deny list
Safe commands include cd, ls, grep, cat, git status, git diff, git log, cargo tree, and ~40 more. Shell redirections (2>&1, 2>/dev/null) are stripped before matching. The deny list takes priority — if a command matches both lists, it is denied. The run tool can never be auto-accepted even in auto-ac
$ claude mcp add TinyHarness \
-- python -m otcore.mcp_server <graph>