A terminal-based AI programming agent written in Go. Teragen is designed for speed, visual excellence, and a seamless developer experience.
- Multi-Agent Management: Seamlessly handle multiple AI sessions with dynamic tabs and sequential ID management.
- Premium TUI Experience: A modern, aesthetically pleasing interface built with BubbleTea, LipGloss, and Glamour.
- Snapshot System: Automatic tracking of every file change. Teragen records "before" and "after" states to ensure you never lose work.
- Undo & Redo: Intelligent rollback and re-apply capabilities for snapshots, allowing you to iterate safely.
- Secure Sandboxed Access: Agent tools are restricted to the workspace root with built-in path traversal protection.
- Visual Diff Summaries: Real-time ASCII-connected summaries of file operations (Created, Modified, Deleted, Moved).
- Intelligent Header: Context-aware path display with smart trimming and terminal width awareness.
- Provider-Agnostic: Full support for OpenAI, OpenRouter, and custom OpenAI-compatible endpoints.
- Secure Secrets: API tokens and sensitive data are encrypted using hardware-locked IDs (HWID).
- Local Chat Persistence: Works like Git, storing sessions in a
.teragendirectory within your project.
- OpenAI
- OpenRouter
- Custom OpenAI-compatible endpoints
Ensure you have Go 1.21+ installed on your system.
go build -o teragen ./cmd/teragenStart the interface directly from your project root:
./teragenYou can also specify the workspace directory explicitly and choose how Teragen persists its own metadata and filesystem operations:
# Use current directory as workspace (default)
./teragen
# Use a specific project directory as workspace
./teragen ./myproject
# Ephemeral metadata: .teragen state (chats, snapshots, agents) lives only in memory
# but filesystem tools still operate on the real project files.
./teragen -e
./teragen ./myproject -e
# Mock filesystem: all LLM fs:* tools read/write an in‑memory virtual FS only.
# No real files are touched.
./teragen -m
./teragen ./myproject -m- Cwd: default mode,
.teragen+ filesystem on disk in the chosen workspace. - Ephemeral (
-e/--ephemeral):.teragenis in-memory only for the session; the agent still edits real files on disk. - Mock (
-m/--mock): both.teragenand filesystem operations are fully virtual and kept in memory only.
| Shortcut | Action |
|---|---|
SHIFT + → |
Switch to next agent (or Create if at the end) |
SHIFT + ← |
Switch to previous agent (Circular) |
SHIFT + ↑ |
Scroll viewport up |
SHIFT + ↓ |
Scroll viewport down |
UP / DOWN |
Navigate through command history |
ESC |
Exit the application |
ENTER |
Send message / Create agent (when on [+] tab) |
/model— Set model for active provider:/model <name>/clear— Clear visual chat history/chat— Manage chat:/chat <clear|new|switch|delete|copy> [args]/settings— Manage settings:/settings <key> <value>/undo— Revert the last file changes made by the agent/redo— Redo the next file changes/provider— Manage providers:/provider <list|toggle|remove|set-token> [args]/help— Show available commands
Teragen stores its global state and encrypted secrets in your OS standard directories:
- Windows:
%APPDATA%\teragen - Linux/macOS:
~/.config/teragen
Project-specific chats and local sessions are kept in a .teragen folder at your project root.
Teragen is built on top of amazing open-source projects:
- BubbleTea: The TUI framework for Go.
- LipGloss: Styling for terminal applications.
- Glamour: Markdown rendering for the CLI.
- MachineID: Secure hardware identification.
MIT © Sammwyy