AI coding agent with CLI
Project description
miu-code
AI coding agent with CLI and TUI. Provides an intelligent assistant for code exploration, generation, and manipulation through both command-line and terminal UI interfaces.
Quick Start
Installation
uv add miu-code
Usage
CLI Mode (one-shot query):
miu "read package.json"
miu -q "what's in the main.py file?"
miu --model openai:gpt-4o "help me debug this"
CLI Mode (interactive REPL):
miu
TUI Mode (Terminal UI):
miu-tui
Features
Code Tools
- Read - View file contents
- Write - Create new files
- Edit - Modify specific lines in files
- Glob - Pattern-based file discovery
- Grep - Content-based search
- Bash - Execute shell commands
Intelligence
- Powered by Claude Sonnet (or your chosen model)
- Multi-model support: Anthropic, OpenAI, Google, etc.
- ReAct reasoning with up to 20 iterations
- Session persistence across conversations
Interfaces
-
TUI - Responsive terminal UI with Textual framework
- Real-time streaming with auto-scroll
- Interruptible agent (Escape key)
- Mode system (ASK, NORMAL, PLAN) with safety levels
- Tool approval dialogs
- Message history navigation
-
CLI - Fast, scriptable command-line interface
- One-shot queries for automation
- Interactive REPL for exploration
- Slash command support (/cook, /commit, /plan)
- ACP server mode for editor integration
Architecture
miu-code/
├── agent/ → CodingAgent with ReAct reasoning
├── tools/ → Code manipulation tools (read, write, edit, etc.)
├── cli/ → asyncclick-based CLI entry point
├── tui/ → Textual-based Terminal UI
├── acp/ → Agent Communication Protocol server
├── session/ → Conversation persistence
└── commands/ → Slash command handlers
Configuration
Model Selection
Default: anthropic:claude-sonnet-4-20250514
Supported providers:
miu -m "anthropic:claude-opus-4-20251105" -q "your query"
miu -m "openai:gpt-4o" -q "your query"
miu -m "google:gemini-2.0-flash" -q "your query"
Session Management
miu -s session-123 # Resume session
miu --session new-id # Create new session
ACP Integration
miu --acp # Start ACP server for editor integration
TUI Key Bindings
| Key | Action |
|---|---|
| Ctrl+C | Quit |
| Ctrl+N | New session |
| Ctrl+L | Clear chat |
| Escape | Interrupt / Focus input |
| Shift+Tab | Cycle mode |
| Shift+Up/Down | Scroll chat |
| Up/Down (in input) | History navigation |
| Enter | Submit message |
Safety & Security
- Path traversal protection for file operations
- Tool approval system in TUI mode
- Configurable safety modes:
- ASK - Request approval for all tool use
- NORMAL - Auto-approve safe tools
- PLAN - Planning mode with warnings
Documentation
- Project Overview & PDR
- Code Standards
- System Architecture
- Codebase Summary
- TUI Design Guide
- Project Roadmap
Development
Python: >=3.11 License: MIT
Key Dependencies
miu-core[anthropic]- Agent frameworktextual>=1.0.0- TUI frameworkasyncclick>=8.1- Async CLIrich>=13.0- Rich terminal outputprompt-toolkit>=3.0- Advanced input handling
Contributing
- Follow Code Standards
- Run tests:
pytest tests/ - Check formatting:
ruff format . - Type check:
mypy miu_code/
Support
- Issues: GitHub issues
- Documentation: See
/docsfolder - Examples: Check
/miu_code/commandsfor slash command patterns
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file miu_code-1.0.0.tar.gz.
File metadata
- Download URL: miu_code-1.0.0.tar.gz
- Upload date:
- Size: 60.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d75780488f6c4a20d8f46cf5b28d716716d74321ca083abf437b784082cbb922
|
|
| MD5 |
eab546bb432f82d62b969d4a64853f7b
|
|
| BLAKE2b-256 |
8559649a90e496b7afa54227c5dcabce7646e826dfb5759b1e7bc431174bceb1
|
File details
Details for the file miu_code-1.0.0-py3-none-any.whl.
File metadata
- Download URL: miu_code-1.0.0-py3-none-any.whl
- Upload date:
- Size: 46.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8e9651547d8a1aa74a33a3e2f6d03a768a73f53ba8585e878e1732e1178eae1
|
|
| MD5 |
6ad77ee18eed6c261aa0fab3869a6d4a
|
|
| BLAKE2b-256 |
9ed629bdfdc1b85c4c646dce18ceaee17804f2c934848cf0236593efad085529
|