Skip to main content

TermiCode

Open-source terminal AI coding assistant with secure file editing, repository intelligence, approval prompts, and OpenRouter-powered model routing.

TermiCode helps developers understand, modify, and maintain codebases without leaving the terminal. It combines AI-assisted coding with built-in safety features like diff previews, approval prompts, protected file guardrails, session memory, and intelligent model routing.

Unlike traditional AI coding assistants, TermiCode prioritizes transparent and controlled code editing. Every change can be reviewed before it touches your files, making it suitable for real development work.

License: MIT Python 3.8+ PyPI


✨ Features

  • 🤖 OpenRouter-powered AI coding assistant
  • 🔒 Secure file editing with approval prompts
  • 📝 Unified diff preview before every file modification
  • 📂 Repository exploration and code search
  • 🧠 Persistent project memory across sessions
  • 🔄 Automatic model fallback during rate limits
  • 💰 Live model pricing and token usage tracking
  • 🛡️ Protected file guardrails (.env, secrets, session files)
  • ⚡ Terminal-first workflow
  • 🔌 Optional Repowise integration for repository health analysis

🚀 Installation

Install from PyPI:

pipx install termicode-ai

# or

pip install termicode-ai

Launch TermiCode:

termicode

⚡ Quick Start

Create an OpenRouter API key:

https://openrouter.ai

Then configure your environment:

export OPENROUTER_API_KEY=your_api_key

Windows PowerShell:

$env:OPENROUTER_API_KEY="your_api_key"

Start the assistant:

termicode

Example prompts:

Explain this repository.

Refactor authentication.py.

Find where JWT tokens are verified.

Run the test suite and fix failing tests.

Generate a repository health report.

Improve the architecture of this module.

💻 Example Workflow

$ termicode

> Explain this repository

✓ Generated architecture summary.

> Refactor utils.py

✓ Diff preview generated.
✓ Waiting for approval...

Approve? (y/N/a)

> y

✓ File updated successfully.

> Run the test suite and fix failures

✓ Tests executed.
✓ Proposed fixes generated.

🎯 Who It's For

TermiCode is designed for developers who prefer working from the command line, including:

  • Students learning large codebases
  • Hackathon teams shipping quickly
  • Open-source contributors
  • Backend engineers
  • Python developers
  • CLI enthusiasts
  • AI-assisted development workflows

🛡️ Safety First

Unlike many coding assistants, TermiCode is designed around explicit user control.

It includes:

  • File protection for sensitive paths
  • Approval prompts before file modifications
  • Diff previews before writes
  • Protected session storage
  • Sandboxed file access
  • Safe undo support
  • Command approval controls

🧠 Intelligent Model Routing

TermiCode dynamically fetches the latest available models from OpenRouter instead of relying on a hardcoded model list.

Features include:

  • Automatic best free model selection
  • Budget mode for inexpensive paid models
  • Manual model selection
  • Live pricing information
  • Automatic fallback when a model becomes rate-limited

Useful commands:

/model auto
/model budget
/model <model-name>
/stats

📂 Session Memory

Every project gets its own persistent conversation history.

Sessions are stored outside your repository:

~/.termicode/sessions/<project>-<id>.history.json
~/.termicode/sessions/<project>-<id>.memory.json

You can relocate them using:

TERMICODE_HOME

Useful command:

/reset

🔌 Optional Repowise Integration

Repowise adds repository intelligence capabilities including:

  • Repository health reports
  • AI-assisted refactoring
  • Commit protection
  • Code health analysis

Install:

pip install repowise

Then verify:

/doctor

Core TermiCode functionality works without Repowise.


📖 Commands

Command Description
/help Show available commands
/map Display project structure
/doctor Check local environment
/model Manage AI model selection
/stats Show token usage and cost
/heal <file> AI-assisted file repair (Repowise)
/report Repository health report (Repowise)
/guard on/off Git commit protection (Repowise)
/approve on/off Toggle file auto-approval
/undo <file> Restore latest backup
/ripple <prompt> Multi-file architectural changes
/reset Reset current session
/clear Clear terminal
/exit Exit TermiCode

🧪 Development

Clone the repository:

git clone https://github.com/parthpathakpp29/termicode.git

cd termicode

python -m venv .venv

source .venv/bin/activate

pip install -e .[dev]

Run tests:

pytest

📚 Documentation

Document Description
ARCHITECTURE.md Codebase architecture and execution flow
CONTRIBUTING.md Contribution guide
CHANGELOG.md Release history
SECURITY.md Security reporting policy
CODE_OF_CONDUCT.md Community guidelines
docs/model-routing.md Model routing system
docs/tool-system.md Tool execution architecture
docs/sessions.md Session persistence
docs/file-editing.md File editing workflow
docs/approval-flow.md Approval and safety model

🤝 Contributing

Contributions are welcome.

Whether you're fixing a bug, improving documentation, adding tests, or implementing a new feature, we'd love your help.

Before opening large feature PRs, please open an issue to discuss the proposal.

See CONTRIBUTING.md for setup instructions and contribution guidelines.


📄 License

Licensed under the MIT License.

See LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

termicode_ai-0.2.1.tar.gz (69.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termicode_ai-0.2.1-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file termicode_ai-0.2.1.tar.gz.

File metadata

  • Download URL: termicode_ai-0.2.1.tar.gz
  • Upload date:
  • Size: 69.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for termicode_ai-0.2.1.tar.gz
Algorithm Hash digest
SHA256 174c33562af1a9d3f0991e437211d1653dd0190f9c3ea429bb0b1c57e046c615
MD5 7d47c43c04f89d56fa4e7cbdf291a9c8
BLAKE2b-256 ec5b0da7136c37eedc1a18d4f2fa00aa110df14579c653a0e76508c0fb23659b

See more details on using hashes here.

File details

Details for the file termicode_ai-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: termicode_ai-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 50.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for termicode_ai-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 798792fe7a9d6964ddd9b5196ed1fb1d89a8c7745d362f0fb87c2491bba20dff
MD5 eed6ffabd92a856af67f4601ac674244
BLAKE2b-256 62f8a16741e99bbc8af942d55736a5f4da49c62239593819360ec52b40af6271

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page