TermNet is an AI-powered terminal assistant that connects a Large Language Model (LLM) with shell command execution, browser search, and dynamically loaded tools.
It streams responses in real-time, executes tools one at a time, and maintains conversational memory across steps.
⚠️ Disclaimer: This project is experimental. Use at your own risk.
⚠️ Note: This has only been tested with GPT-OSS Models. Your models may behave differently.
toolregistry.json - tools auto-discover without code changesTermNet uses a multi-server architecture:
main.py) - Port 876: Handles agent communication and streamingbrowser_server.py) - Port 8765: Manages Playwright browser automationnotification_server.py) - Port 5003: Handles notifications and alertsweb_ui_server.py) - Port 5005: Browser-based interfaceAll servers are managed by the central launcher (run.py).
Root Files:
- run.py - Main launcher script
- requirements.txt - Python dependencies
- README.md - This file
Backend Core:
- main.py - WebSocket server entry point
- agent.py - TermNetAgent core logic
- memory.py - Memory step tracking
- safety.py - Command safety checker
- toolloader.py - Dynamic tool loader
- config.py - Configuration management
Tools:
- browser_search_websocket.py - Web browsing tool
- notification_tool.py - Notification management
- communication_tools.py - Email/SMS capabilities
- scratchpad.py - Note-taking tool
- terminal.py - Terminal session wrapper
Servers:
- browser_server.py - Browser automation server
- notification_server.py - Notification server
git clone https://github.com/RawdodReverend/TermNet.git
cd termnet
pip install -r requirements.txt
playwright install chromium
curl -fsSL https://ollama.ai/install.sh | sh
The run.py launcher manages all components:
python run.py
You'll be prompted to choose between: - Web UI (Browser interface at http://127.0.0.1:5005) - Terminal UI (Command-line interface)
For development or debugging, run components individually:
# Start the main WebSocket server
python main.py
# Start the browser server
python browser_server.py
# Start notification server
python notification_server.py
| Key | Description | Default |
|---|---|---|
OLLAMA_URL |
Base URL for Ollama server | http://127.0.0.1:11434 |
MODEL_NAME |
Model name/tag to use | gpt-oss:20b |
LLM_TEMPERATURE |
Response randomness (0-1) | 0.7 |
MAX_AI_STEPS |
Max reasoning steps per query | 10 |
COMMAND_TIMEOUT |
Max seconds for terminal commands | 30 |
STREAM_CHUNK_DELAY |
Delay between LLM output chunks | 0.01 |
| ## 🛠️ Adding Tools | ||
Tools are defined in toolregistry.json and implemented in Python modules. |
||
| ### 1. Register the Tool | ||
Add an entry to toolregistry.json: |
{
"type": "function",
"function": {
"name": "my_custom_tool",
"description": "Describe what this tool does",
"module": "mytool",
"class": "MyTool",
"parameters": {
"type": "object",
"properties": {
"arg1": { "type": "string" }
},
"required": ["arg1"]
}
}
}
Create termnet/tools/mytool.py:
import asyncio
class MyTool:
async def my_custom_tool(self, arg1: str):
"""Tool description"""
return f"Tool executed with arg1={arg1}"
# Optional: Async context management
async def start(self):
return True
async def stop(self):
pass
The tool will auto-load at startup. No code changes needed!
rm -rf /, shutdown, etc.) are blockedrm, mv, chmod) are allowed with warningsTermNetAgent: Main agent class managing chat loop and tool executionTerminalSession: Wrapper for safe command execution with timeout controlToolLoader: Dynamic tool importer based on registrySafetyChecker: Command safety validation systemBrowserSearchTool: Web browsing and content extractionNotificationTool: Notification management systemCore dependencies:
- websockets>=12.0
- playwright>=1.40.0
- beautifulsoup4>=4.12.0
- playwright-stealth>=1.0.0
- flask>=2.3.0
- aiohttp>=3.9.0
- lxml>=4.9.0
- html5lib>=1.1
- soupsieve>=2.5
playwright install chromium and check if Chrome is installedollama servetoolregistry.json syntax and Python module pathsThis project is licensed under the MIT License.
See LICENSE file for details.
$ claude mcp add TermNet \
-- python -m otcore.mcp_server <graph>