Your agentic CLI developer.
TunaCode is an agentic CLI-based AI tool inspired by Claude Code, Copilot, Windsurf and Cursor. It's meant to be an open source alternative to these tools, providing a similar experience but with the flexibility of using different LLM providers (Anthropic, OpenAI, Google Gemini, OpenRouter) while keeping the agentic workflow.
TunaCode is currently in beta and under active development. Please report issues or share feedback!
- No vendor lock-in. Use whichever LLM provider you prefer.
- MCP support
- Use /undo when AI breaks things.
- Easily switch between models in the same session.
- JIT-style system prompt injection ensures TunaCode doesn't lose the plot.
- Per-project guide. Adjust TunaCode's behavior to suit your needs.
- CLI-first design. Ditch the clunky IDE.
- Cost and token tracking.
- Per command or per session confirmation skipping.
- Tests 😅
- More LLM providers, including OpenRouter and Ollama
Install TunaCode.
pip install tunacode-cli
On first run, you'll be asked to configure your LLM providers.
tunacode
After initial setup, TunaCode saves a config file to ~/.config/tunacode.json. You can open and
edit this file as needed. Future updates will make editing easier directly from within TunaCode.
To use OpenRouter models, add an OPENROUTER_API_KEY to the
env section of your configuration file. TunaCode will set the environment variable so the
OpenAI client can communicate with OpenRouter:
{
"env": {
"OPENROUTER_API_KEY": "<YOUR_KEY>"
}
}Then run TunaCode with the OpenRouter base URL:
OPENAI_BASE_URL="https://openrouter.ai/api/v1" tunacodeYou can now switch to OpenRouter models using:
/model openrouter:mistralai/devstral-small
TunaCode supports Model Context Protocol (MCP) servers. You can configure MCP servers in your ~/.config/tunacode.json file:
{
"mcpServers": {
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}MCP servers extend the capabilities of your AI assistant, allowing it to interact with additional tools and data sources. Learn more about MCP at modelcontextprotocol.io.
/help- Show available commands/yolo- Toggle "yolo" mode (skip tool confirmations)/clear- Clear message history/compact- Summarize message history and clear old messages/model- List available models/model <num>- Switch to a specific model (by index)/branch <name>- Create and switch to a new Git branch/undo- Undo most recent changes/dump- Show current message history (for debugging)exit- Exit the application
TunaCode supports the use of a "guide". This is a TUNACODE.md file in the project root that contains
instructions for TunaCode. Helpful for specifying tech stack, project structure, development
preferences etc.
- Python 3.10 or higher
- Git (for undo functionality)
pip install tunacode-cli- Clone the repository
- Install dependencies:
pip install .(orpip install -e .for development)
# Install development dependencies
make install
# Run linting
make lint
# Run tests
make testWhen preparing a new release:
-
Update version numbers in:
pyproject.tomlsrc/tunacode/constants.py(APP_VERSION)
-
Commit the version changes:
git add pyproject.toml src/tunacode/constants.py git commit -m "chore: bump version to X.Y.Z" -
Create and push a tag:
git tag vX.Y.Z git push origin vX.Y.Z
-
Create a GitHub release:
gh release create vX.Y.Z --title "vX.Y.Z" --notes "Release notes here"
-
Merge to main branch and push to trigger PyPI release (automated)
This project follows the Conventional Commits specification for commit messages:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringperf:- Performance improvementstest:- Test additions or modificationschore:- Maintenance tasks (version bumps, etc.)build:- Build system changesci:- CI configuration changes
MIT
This project is a fork of sidekick-cli. Thank you to the sidekick-cli team for creating the foundation that made TunaCode possible! 🙏
