toolnetcli
v1.2.3
Published
ToolNet CLI — AI coding agent for the terminal
Readme
⚡ ToolNet CLI
The Autonomous Multi-Agent Terminal AI Coding Assistant
ToolNet CLI is a next-generation, high-performance terminal coding assistant engineered for developers, devops, and agentic workflows. Built on the Unified AgentHarness 2.0 architecture, it unifies interactive terminal streaming, autonomous multi-agent task graphs (DAG), role-based sub-agent delegation, intelligent context compaction, and multi-tier security sandboxing into a single developer tool.
Quick Start • Architecture • Features • Slash Commands • Keybindings • Security 2.0
🌟 Core Features
- ⚙️ Unified AgentHarness 2.0 Kernel: Central execution engine coordinating Context, Security, Tool Registry, MCP Gateway, and Session Persistence across all runtime modes.
- 🤖 Real Sub-Agent Execution Engine: Autonomous child agent loop with specialized personas (
RESEARCHER,CODER,TESTER,REVIEWER,ARCHITECT,GENERAL), role-based tool filtering, and dependency chaining. - 🧠 Unified Context Management Engine: Exact token estimation across model families, automatic bulky tool output pruning, atomic turn compaction (preserving
assistant.tool_callsandrole: "tool"pairs), and persistent session memory. - 🛡️ Security & Permissions 2.0 (SecretGuard): 5-tier semantic command risk classification (
CRITICAL_DENY,DANGEROUS,SAFE_BUILD,SAFE_READ,MODERATE_WRITE), sensitive file shielding (.env*,.ssh,.aws,.npmrc), and smart session trust ([A] Allow for Session). - 🖥️ Native ANSI Full-Screen TUI: Zero-dependency TUI compatible with Termius, mobile SSH, tmux, and all standard terminal emulators. Supports bracketed paste, streaming markdown rendering, and live tool status indicators.
- 🔌 Model Context Protocol (MCP): Seamless integration with local and remote MCP servers via stdio and SSE.
- ⚡ Multiple Execution Strategies:
- Interactive TUI: Live conversational pairing with streaming responses.
- Headless Prompt (
-p): Single-pass execution for scripts, CI/CD, and pipelines with optional--jsonoutput. - Turbo Mode: Ultra low-latency single-pass resolution for localized micro-tasks.
- Teamwork DAG Orchestrator: Dynamic task graph decomposition executing multi-agent DAGs concurrently.
🚀 Quick Start
Installation
macOS / Linux (recommended)
curl -fsSL https://raw.githubusercontent.com/LBT-AI/Toolnet-CLI/main/install.sh | shThis downloads a standalone binary — no Bun or Node.js required.
npm
npm install -g toolnetcli@latestWindows (PowerShell)
irm https://raw.githubusercontent.com/LBT-AI/Toolnet-CLI/main/install.ps1 | iexHomebrew / Scoop
Homebrew and Scoop manifests are maintained in this repository, but the public tap/bucket has not been published yet. Until registry publication is complete, use the standalone installer or npm methods above.
Uninstall
# Binary install
rm /usr/local/bin/toolnet # or ~/.local/bin/toolnet
# npm install
npm uninstall -g toolnetcliLaunching Interactive Mode
# Launch interactive TUI in the current workspace
toolnet
# Resume the most recent session
toolnet --resume
# Load a specific session ID
toolnet --session sess_12345Non-Interactive (Headless) Mode
# Run a single query directly from CLI / scripts
toolnet -p "Audit this repository for security vulnerabilities and summarize dependencies"
# Structured JSON output for CI/CD automation
toolnet -p "Check for TypeScript errors in src/" --json🏗️ Architecture
┌────────────────────────────────────────────────────────────────────────────┐
│ UNIFIED AGENT HARNESS 2.0 │
│ (Master Execution Kernel & Orchestration) │
├────────────────────────────────────────────────────────────────────────────┤
│ │
│ [Runtime Context] [Core Subsystems] [Execution Modes] │
│ ├── Workspace & Root ├── Context Engine ├── Interactive (TUI) │
│ ├── Session Persistence ├── Security 2.0 Guard ├── Headless (-p) │
│ ├── Model Gateway ├── Tool Registry & MCP ├── Turbo Single-Pass │
│ └── Framework Detector └── EventBus Telemetry └── Teamwork DAG │
│ │
└─────────────────────────────────────┬──────────────────────────────────────┘
│
┌──────────────────────────┴──────────────────────────┐
▼ ▼
┌──────────────────────────────┐ ┌──────────────────────────────┐
│ MAIN AGENT RUNTIME │ │ SUB-AGENT RUNTIME ENGINE │
│ • Autonomous Tool Loop │─── delegates ├── Researcher (Read/Grep/Web) │
│ • Interactive Streaming │ via ├── Coder (Write/Patch/Edit) │
│ • Multi-turn Session Flow │ spawn_agent ├── Tester (Test/Diagnostics) │
│ • Atomic Compactor │ ├── Reviewer (Diff/Security) │
└──────────────────────────────┘ └──────────────────────────────┘⌨️ Interactive Keybindings
| Keybinding | Action | Description | | :--- | :--- | :--- | | Enter | Send Message | Submits your prompt to the active agent | | Tab | Toggle Mode | Switches between Build mode (code execution) and Plan mode (read-only planning) | | Ctrl+K | Switch Model | Opens the interactive model & provider picker | | Ctrl+C | Cancel / Exit | Aborts the active generation or exits the TUI | | Ctrl+L | Clear Screen | Clears the terminal screen buffer | | PageUp / PageDown | Scroll Chat | Navigates through long conversation history |
💬 Slash Commands
| Command | Aliases | Description |
| :--- | :--- | :--- |
| /harness | /kernel, /sys | Displays Unified AgentHarness status, active subsystems, framework detection, and token telemetry |
| /subagent [role] <task> | /sub, /agent | Spawns a dedicated subagent (RESEARCHER, CODER, TESTER, REVIEWER, ARCHITECT) |
| /sandbox [mode] | /sb | Inspects or sets sandbox mode (workspace, ask, full-access, or clear session rules) |
| /compact | /compress | Triggers atomic context compaction and displays context token budget utilization |
| /status | /st | Checks ToolNet API Gateway connectivity, active providers, and tunnels |
| /model [name] | /m | Switches the active language model or lists available models |
| /teamwork <prompt> | /tw | Decomposes a complex objective into an autonomous DAG task graph |
| /tools | — | Lists all available tools, file operations, and execution permissions |
| /mcp | — | Manages Model Context Protocol (MCP) servers and client tools |
| /skills | — | Lists locally installed project skills and extensions |
| /session [list\|new\|switch] | — | Manages multi-session persistence and history switching |
| /undo / /redo | — | Reverts or reapplies file changes made by surgical patch tools |
| /qa <prompt> | — | Runs autonomous automated QA and test suite diagnostics |
| /doctor | — | Runs local diagnostic checks on environment, tools, and connectivity |
| /update | — | Checks for ToolNet CLI updates on npm |
🛡️ Security & Permissions 2.0
ToolNet CLI includes an enterprise-grade, multi-layered security engine to keep your machine safe:
[Tool Call Request]
│
▼
[SecretGuard] ───► Is sensitive file (.env, id_rsa, .npmrc, ~/.ssh)? ──► BLOCK in workspace mode
│
▼
[Semantic Command Classifier] ───► Evaluate Shell AST (CRITICAL_DENY / DANGEROUS / SAFE)
│
▼
[Session Trust Manager] ───► Was this tool/command allowed for the session? ──► ALLOW
│
▼
[Interactive Approval Modal] ──► [Y] Once [A] Allow for Session [N] Deny
│
▼
[Audit Logger] ───► Log structured JSONL event to .logs/security-audit.jsonlSandbox Modes
workspace(Default): Restricts read/write operations strictly within the project workspace root. Blocks access to credential files (.env*,id_rsa*) and dangerous shell commands (rm -rf /,mkfs).ask: Prompts the user interactively before executing sensitive file operations or dangerous commands.full-access: Unrestricted execution mode for automated containerized CI/CD environments.
📂 Configuration & Storage
| Path | Purpose |
| :--- | :--- |
| ~/.toolnetcli/config.json | Canonical CLI configuration (gateway/API mode, default model, sandbox, theme, update checks) |
| ~/.toolnetcli/sessions/ | Saved JSON session histories and message turns |
| ~/.toolnetcli/config.json | Global CLI preferences (default model, base URL, provider, theme) |
| .toolnet/permissions.json | Project-specific workspace security policy |
| .logs/security-audit.jsonl | Structured security evaluation audit log |
Environment Variables
TOOLNETCLI_SESSIONS_DIR: Custom path for session storage.TOOLNET_API_URL: Optional custom ToolNet Gateway endpoint URL.TOOLNET_DEBUG: Set to1to enable verbose debugging logs.
🛠️ Development & Testing
# Clone repository
git clone https://github.com/LBT-AI/Toolnet-CLI.git
cd Toolnet-CLI
# Install dependencies
bun install
# Full production verification: typecheck + 400+ tests + Bun/Node builds
bun run check
# Or run individual stages
bun run typecheck
bun test
bun run buildCI additionally smoke-tests the CLI and Teamwork persistence on Node 22 and the minimum supported Node 20 runtime.
Note — Node 20–21 persistence: native SQLite (
node:sqlite) requires Node 22.5+. On Node 20–21, Teamwork checkpoints and context-cache stores automatically fall back to the built-in JSON persistence store (<db>.jsonnext to the requested path). The same data model is preserved and nothing crashes — only raw SQL throughput differs.
📄 License
This project is licensed under the MIT License.
