How thetaplex/thetaterm works
ThetaTerm turns a natural-language request into a command tailored to the local OS and installed tools, then shows it for confirmation before execution. Its CLI also supports direct user-entered commands and an auto-confirm option, while outside-directory patterns always require confirmation. A separate MCP server exposes system information, documentation, command checks, and suggestions to other agents without running commands. The README documents the local tool/man-page context and OpenAI-compatible model support; the sampled source excerpts do not expose every internal call involved in gathering that context.
Main entry points: agent.py Command agent · mcp.py MCP tools · cli.py Query handling
Components 14
Terminal workflow
- CLI interface
thetaterm/cli.py - Query handling
thetaterm/cli.py - Review and approval
thetaterm/cli.py - Shell execution
thetaterm/cli.py
Command generation
- Command agent
thetaterm/agent.py - Model API client
thetaterm/agent.py - Command checks
thetaterm/agent.py
Agent integration
- MCP server
thetaterm/mcp.py - MCP tools
thetaterm/mcp.py
Local system
- System and tool context
thetaterm/agent.py - User shell
Other components
- Terminal user
- Model server
- Calling agent
Connections 16
- Terminal user → CLI interface: requests command
README.md - CLI interface → Query handling: handles input
thetaterm/cli.py - Query handling → Command agent: requests generation
thetaterm/cli.py - Query handling → Review and approval: presents command
thetaterm/cli.py - Review and approval → Command checks: checks outside paths
thetaterm/cli.py - Review and approval → Shell execution: approves execution
thetaterm/cli.py - Shell execution → User shell: runs command
thetaterm/cli.py - Command agent → Model API client: requests completion
thetaterm/agent.py - Model API client → Model server: sends API request
thetaterm/agent.py - Command agent → Command checks: validates output
thetaterm/agent.py - Command agent → System and tool context: uses system references
thetaterm/agent.py - Calling agent → MCP server: connects over MCP
README.md - MCP server → MCP tools: registers tools
thetaterm/mcp.py - MCP tools → Command agent: suggests commands
thetaterm/mcp.py - MCP tools → System and tool context: returns system docs
thetaterm/mcp.py - MCP tools → Command checks: checks commands
thetaterm/mcp.py