Open-source terminal AI coding assistant
Project description
OpenLaoKe
Open-source terminal AI coding assistant.
Features
- Interactive REPL with rich terminal UI
- Multi-Provider Support - Anthropic, OpenAI, Ollama, LM Studio, and custom endpoints
- Tool System with 9 built-in tools:
Bash- Execute shell commands with streaming outputRead- Read file contents with line range supportWrite- Create/overwrite filesEdit- Targeted find-and-replace file edits with diff outputGlob- Fast file pattern matching (respects .gitignore)Grep- Regex search across files with multiple output modesAgent- Spawn sub-agents for parallel workTaskkill- Kill running tasksNotebookWrite- Write Jupyter notebook cells
- MCP Support - Connect to external MCP tool servers
- Permission System - Three modes: default, auto, bypass
- Session Persistence - Auto-save and resume sessions
- Cost Tracking - Real-time token usage and cost display
- Slash Commands - 11 built-in commands (
/help,/model,/cost,/compact, etc.) - Hook System - Extensible pre/post hooks for tool and API calls
- Proxy Support - No proxy, system proxy, or custom proxy
Installation
# Clone and install
cd OpenLaoKe
pip install -e .
# Or with uv (recommended)
uv pip install -e .
Usage
# First run (shows configuration wizard)
openlaoke
# Reconfigure
openlaoke --config
# Non-interactive mode
openlaoke "Write a Python script that sorts a list"
# With options
openlaoke -m gpt-4o -p auto
openlaoke --provider ollama -m llama3.2
openlaoke --proxy http://127.0.0.1:7890
openlaoke --cwd /path/to/project
Supported Providers
| Provider | Type | API Key Required |
|---|---|---|
| Anthropic | Cloud | Yes |
| OpenAI | Cloud | Yes |
| Ollama | Local | No |
| LM Studio | Local | No |
| OpenAI-Compatible | Custom | Optional |
Environment Variables
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
Anthropic API key |
OPENAI_API_KEY |
OpenAI API key |
OPENLAOKE_MODEL |
Default model |
Slash Commands
| Command | Description |
|---|---|
/help |
Show available commands |
/exit |
Exit OpenLaoKe |
/clear |
Clear screen and conversation |
/model [name] |
Show or change model |
/permission [mode] |
Change permission mode |
/compact |
Compact conversation |
/cost |
Show session cost and usage |
/cwd [path] |
Show or change working directory |
/resume |
Resume last session |
/commands |
Show example commands |
/settings |
Show current settings |
Architecture
openlaoke/
├── core/ # Core systems
│ ├── state.py # Centralized state management
│ ├── tool.py # Tool base class and registry
│ ├── task.py # Task lifecycle management
│ ├── multi_provider_api.py # Multi-provider API client
│ ├── repl.py # REPL interaction loop
│ ├── config_wizard.py # Configuration wizard
│ └── ...
├── tools/ # Tool implementations
├── commands/ # Slash commands
├── services/ # External services (MCP)
├── components/ # UI components (TUI)
├── types/ # Type definitions
└── utils/ # Utilities
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run linter
ruff check .
# Run tests
pytest
# Build package
python -m build
Configuration
User config is stored at ~/.openlaoke/config.json. You can edit it directly or use /settings in the REPL.
License
GPLv3
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
openlaoke-0.1.5.tar.gz
(89.4 kB
view details)
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
openlaoke-0.1.5-py3-none-any.whl
(98.2 kB
view details)
File details
Details for the file openlaoke-0.1.5.tar.gz.
File metadata
- Download URL: openlaoke-0.1.5.tar.gz
- Upload date:
- Size: 89.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
defa0966c9485fbdba0daac3c2bd0aa5e4054a6d14a62c03c8b1fc51863f3dbe
|
|
| MD5 |
49275c70a2360c832d847a4b1db3d617
|
|
| BLAKE2b-256 |
1193fc59d530487adb56bee3a0ab3441fa5a0f2261527caa6690a5786b040851
|
File details
Details for the file openlaoke-0.1.5-py3-none-any.whl.
File metadata
- Download URL: openlaoke-0.1.5-py3-none-any.whl
- Upload date:
- Size: 98.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36a0cc45678fe8b0c1406ac357ce3f14c0da4019ef890880741633a4e674b4f1
|
|
| MD5 |
4af5ee2e0e24d01055d06988a6b86446
|
|
| BLAKE2b-256 |
7342839a95277644043ad4e75fb1f4e4f93b8cfa52c646cb624f4b2eac3b789b
|