term2
A powerful terminal-based AI assistant — think Claude Code and Warp having a child. Open source, multi-provider, with unique SSH support and Mentor mode.
A powerful terminal-based AI assistant — think Claude Code and Warp getting married and having a child. Unlike proprietary alternatives, term2 is open-source (MIT), works with any AI provider (OpenAI, OpenRouter, local self-hosted), requires no subscription, and uniquely supports remote server management via SSH.
Why term2 vs Alternatives?
| term2 | Claude Code | Warp | |
|---|---|---|---|
| Open Source | ✅ MIT | ❌ Proprietary | ❌ Proprietary |
| Cost | Pay-per-use | $20-200/mo | Freemium |
| AI Providers | Any (OpenAI, OpenRouter, local, etc.) | Anthropic only | Selected models only |
| SSH Remote | ✅ Native | ❌ No | ✅ Yes |
| Mentor Mode | ✅ Built-in | ❌ No | ❌ No |
| Self-Hostable | ✅ | ❌ | ❌ |
term2 gives you:
- Freedom — No vendor lock-in. Use any AI provider or model you prefer.
- Transparency — Open source means you can audit every line of code.
- Cost Control — Pay only for API usage, no monthly subscriptions.
- Remote Work — Troubleshoot and manage remote servers without installing anything on remote hosts.
Key Features
-
🎭 Three Operating Modes tailored to different workflows:
- Default Mode: Full-power codebase work with all editing tools
- Lite Mode: Fast, read-only mode perfect for SSH sessions and system administration
- Mentor Mode: Dual-AI consultation for complex architectural decisions
-
🤖 Multi-Provider Support: OpenAI, OpenRouter (Claude, Gemini, DeepSeek), Ollama, LM Studio, vLLM — use any model you want
-
🌐 SSH Mode: Execute commands and edit files on remote servers over SSH — perfect for server management without installing anything on the remote host
-
🔒 Safe Execution: Every command requires explicit approval with diff preview before execution
-
🛠️ Advanced Tools: Shell execution, file patching, search/replace, grep, find files, file reading, web search
-
💬 Slash Commands:
/clear,/quit,/model,/mentor,/litefor instant mode switching -
🎯 Streaming Responses: See the AI’s thoughts and reasoning in real-time
Operating Modes
Default Mode — Codebase Development
Full-featured mode with all editing tools and project context loading. Best for working on code projects.
Lite Mode — Everyday Terminal Assistant
The problem it solves: You need a general-purpose terminal assistant for everyday system tasks — not working with a codebase or project.
- 🚀 Fast and lightweight — No codebase context, quick startup
- 🔧 General terminal tools — Shell, grep, read files (no code editing)
- 🌐 Perfect for SSH — Ideal for remote server management
- 🔄 Toggleable — Switch on/off mid-session with
/litecommand
Perfect for: System administration, investigating logs, SSH sessions, file management, quick command help.
Mentor Mode — Collaborative Problem Solving
The problem it solves: You’re tackling a complex codebase problem and need expert consultation.
Two AI minds working together: your primary AI does reconnaissance and implementation, while a separate (often more powerful) mentor model provides strategic guidance and challenges assumptions. Think of it as pair programming with an expert consultant.
Best for: Architectural decisions, “am I missing something?” sanity checks, getting unstuck, pre-commit reviews.
Installation
npm install --global @qduc/term2
export OPENAI_API_KEY="your-api-key-here"
term2
Usage Examples
# Start in different modes
term2 # Default mode for codebase work
term2 --lite # Lite mode for general terminal help
term2 -m gpt-5.2 # Use specific model
# SSH mode for remote work
term2 --ssh user@host --remote-dir /path/to/project
term2 --ssh user@host --lite # SSH + lite mode
Safety Features
- Command approval required for every operation
- Diff preview for file changes before approval
- Risk analysis for dangerous operations
- Path safety checks for sensitive directories
- No hidden actions — all tool usage is transparent
Tech Stack
- TypeScript
- Ink — React for CLI
- OpenAI Agents SDK
- ssh2 for remote execution
Check out the GitHub repository for detailed documentation and advanced usage.