An automonous AI coding agent that runs in the terminal. Similar to Claude Code, OpenAI Codex etc. but works with many more LLMs.
It can:
- Write code 📝
- Fix bugs 🐛
- Execute shell commands 💻
- Write tests 🧪
- Analyze codebase 🔍 and many more...
All within the terminal! 🚀
Full tutorial series on how to build it from scratch 👇
It has different modes for different tasks:
- 📝 Architect: Designs the system, brainstorms ideas with the user, saves the design in a markdown file.
- 💻 Code: Implements the architect's plan step by step
✅ LLMs supported so far:
- Google Gemini
- OpenAI
- Claude
- OpenRouter
- Deepseek
- Groq
- Local LLMs using Ollama
- LlamaIndex Workflow: For orchestrating and multiple LLMs support
- Tree-sitter: For searching code definitions (functions, classes, etc.) accross the codebase and checking for syntax errors
- Ripgrep: For regex search accross the codebase
- Google's diff-match-patch: For comparing and displaying diffs
Tig depends on some external tools:
- Ripgrep: For regex search accross the codebase
Make sure to install it for your operating system.
For macOS, you can use Homebrew:
brew install ripgrep
For Linux, you can use the package manager for your distro:
For Arch:
sudo pacman -S ripgrep
For Fedora:
sudo dnf install ripgrep
Install Tig using pip:
pip install tig-code
Note: If tig
is not in your PATH, you need to add it first (depends on your python installation)
Tig is configured using .env
file.
Specify the LLM and model to use alongside with appropriate API keys in the .env
file.
GOOGLE_API_KEY="..."
TIG_MODEL="gemini-2.0-flash"
TIG_PROVIDER="google" # available providers: [google, openai, anthropic, deepseek, groq, ollama, openrouter]
Provide the right API key variable for the right model e.g. GOOGLE_API_KEY
for Gemini, OPENAI_API_KEY
for OpenAI, ANTHROPIC_API_KEY
for Claude, etc.
Now run tig (optionally specify the mode --mode <code| architect>
):
tig
If you want to auto-approve all the actions taken by Tig (read, write, update files), run tig
with the --auto-approve
flag:
tig --auto-approve
Finally when prompted, provide tig with a task to get started:
...
New task: Create a screen recorder website for chrome
...