AI-powered terminal toolkit with coding assistant, shell autocomplete, and API documentation generator
Project description
lac-cli
lac-cli is a terminal toolkit from lacai.io that brings AI into your command line. You get an AI shell, a coding assistant with memory, a debate engine, and an API doc generator.
What's new in v0.3.3: Added Formula System for custom coding rules, Token Management for context control, and MCP (Model Context Protocol) integration for connecting to external tool servers.
Install
Quick install (Unix/Linux/macOS):
curl -fsSL https://lacai.io/install.sh | bash
Quick install (Windows PowerShell):
iwr -useb https://lacai.io/install.ps1 | iex
Manual install (all platforms):
# Unix/Linux/macOS
pip3 install 'lac-cli[all]'
pip3 install anthropic
# Windows
pip install lac-cli[all]
pip install anthropic
Optional components:
pip install lac-cli[agent] # Just the coding assistant
pip install lac-cli[shell] # Shell with autocomplete server
pip install lac-cli[mind] # Multi-model debate engine
pip install lac-cli[all] # Everything
AI Provider Libraries (install based on your choice):
pip install anthropic # For Claude
pip install openai # For OpenAI/GPT
# Ollama requires no additional install
Getting Started
Run lac to see the menu of available tools:
lac
You'll see:
lac-cli v0.3.3
Available Tools:
1. Shell - AI-powered terminal with autocomplete
2. Mind - Multi-model debate engine
3. GenDoc - API documentation generator
4. Agent - AI coding assistant with project memory
5. Settings - Configure AI provider and model
Select a tool [1-5] or press Enter for Shell:
Or use direct commands:
lac shell # Launch AI terminal shell
lac mind # Launch multi-model debate
lac gendoc <path> # Generate API docs
lac agent # Launch AI coding assistant
LacAgent AI Coding Assistant
Launch the AI coding assistant with project memory:
lac agent
LacAgent can:
- Read, write, and edit files
- Run shell commands with safety checks
- Test APIs with HTTP requests
- Watch files for changes
- Generate API docs
- Remember your project context
- Undo/redo changes with diffs
- Connect to MCP servers (GitHub, databases, web search)
Commands you can use:
/undo # Revert last file edit with diff preview
/redo # Reapply undone edit
/history # Show all file edits this session
/diff <file> # Inspect file contents with line numbers
/gendoc [path] # Generate API documentation
/plan # Enable PlanMode (approve plans before execution)
/noplan # Disable PlanMode (execute immediately)
/tasks # Show current task list
/cleartasks # Clear all tasks
/formula list|use|off # Manage coding formulas
/manage on|off|status # Token management
/mcp # List connected MCP servers
Example Usage:
[You] create a FastAPI app with user authentication
[Agent] → Creates files, installs dependencies, sets up routes
[You] run the server
[Agent] → Starts uvicorn in background, provides log file location
[You] test the /users endpoint
[Agent] → Makes HTTP request, shows response
[You] /undo
[Agent] → Reverts last file change with diff preview
Terminal Shell
Launch the AI-powered shell:
lac shell
The first time you run it, a setup wizard will walk you through picking your AI provider and entering your API key.
To redo the setup:
lac shell --setup
To run without an internet connection:
lac shell --offline
To adjust autocomplete speed (default 150ms):
lac shell --debounce 50 # faster
lac shell --debounce 300 # slower
LacMind Multi-Model Debate
Launch the web-based debate interface for complex queries:
lac mind
LacMind runs multiple AI models in a debate format where they challenge and refine each other's ideas, then vote on the best response. Perfect for research, code generation, and complex problem-solving.
GenDoc API Documentation
Generate beautiful API documentation from your codebase:
lac gendoc /path/to/project
GenDoc scans your project, detects the framework, and uses AI to analyze your routes and controllers to generate comprehensive API documentation. Supports Laravel, Django, FastAPI, Flask, Express, and Rails.
Optional flags:
lac gendoc /path/to/project --prompt "Focus on authentication endpoints"
lac gendoc /path/to/project --integrate # Add /docs route to your framework
lac gendoc /path/to/project --output custom.html
MCP (Model Context Protocol) Integration
Connect your agent to external MCP servers for extended capabilities:
lac mcp add # Add a new MCP server
lac mcp list # List configured servers
lac agent # Start agent with MCP tools
Popular MCP Servers:
- GitHub - Create issues, PRs, search code
- PostgreSQL - Query databases, inspect schemas
- Filesystem - Safe file access to specific directories
- Brave Search - Web search capabilities
- Google Drive - Access Drive files
- Slack - Send messages, manage channels
Example Usage:
[You] create a GitHub issue about the bug we found
[Agent]
⏺ github__create_issue(...)
✓ Issue #42 created
Created issue #42 in your repository!
MCP servers are automatically connected when the agent starts. See MCP_QUICKSTART.md for setup guide.
Formula System
Create custom coding rules that get injected into the AI's instructions.
lac formula add # Create a new formula
lac formula list # See all formulas
lac formula use # Activate one
lac formula off # Turn it off
You can also use /formula inside the agent.
Token Management
Control how much context the AI uses. Helps manage costs and keeps conversations focused.
lac manage on # Turn on token tracking
lac manage status # See current usage
lac manage off # Turn it off
Three modes:
- trim keeps only recent messages
- warn just shows warnings
- compact has AI summarize old messages
Use /manage inside the agent to check status.
How It Works
Main Menu
When you run lac without arguments, you get an interactive menu to choose between:
- Shell - AI-powered terminal with real-time autocomplete
- Mind - Multi-model debate for complex queries
- GenDoc - API documentation generator
- Agent - AI coding assistant with project memory
- Settings - Configure AI provider and model
You can also use direct commands like lac shell, lac mind, lac gendoc <path>, or lac agent.
LacAgent Coding Assistant
LacAgent runs in your project folder and can access files and run commands.
What it does:
- File stuff: read, write, patch files (no full rewrites)
- Glob patterns: find files like
**/*.pyorsrc/** - Commands: runs shell commands, detects long ones and backgrounds them
- API testing: makes HTTP requests
- File watching: monitors files for changes
- Docs: generates API documentation
- Memory: remembers your project across sessions
- Undo/redo: full edit history with diffs
- PlanMode: shows you what it'll do before doing it (on by default)
- Tasks: tracks multi-step work
- Questions: can ask you stuff when it needs to
- MCP: connects to external servers for more tools
Smart stuff:
- Runs things like
npm startin background automatically - Saves logs to
~/.lac/logs/ - Paste multiple lines no problem
- Type
/to see all commands - Security checks on dangerous commands
How editing works:
- Reads the file first
- Makes surgical edits with patch_file
- Snapshots before every change
- You can /undo anytime
Terminal Shell
When you run lac shell, it starts a server in the background. You don't need to do anything.
As you type, it shows ghost text suggestions. Press Tab to use them. Type plain English like "show all files bigger than 100mb" and it converts it to the actual command, then asks if you want to run it.
The shell remembers your recent commands and their output, so suggestions get smarter as you use it.
LacMind Debate Engine
LacMind makes multiple AI models debate each other:
- Models discuss and challenge ideas
- They vote on who had the best reasoning
- Winner gives the final answer
Models are anonymous (Model A, B, C) so they can't be biased. You pick how long debates run and which models join.
GenDoc Documentation Generator
GenDoc makes API docs automatically:
- Scans your project and finds your framework
- Sends route/controller files to lacai.io for analysis
- Creates interactive HTML docs
- Can add a
/docsroute to your app
First time you run it, you'll need an API key from lacai.io/dashboard/keys. The docs include endpoints, parameters, examples, and you can export to Swagger or Postman.
Supported Providers
| Provider | Notes |
|---|---|
claude |
Anthropic API |
openai |
OpenAI API |
ollama |
Local models, no API key needed |
custom |
Any OpenAI compatible endpoint |
Commands
Main Menu
| Command | What it does |
|---|---|
lac |
Show interactive menu |
lac shell |
Launch AI terminal shell |
lac mind |
Launch LacMind debate UI |
lac gendoc <path> |
Generate API documentation |
lac agent |
Launch AI coding assistant |
lac mcp add |
Add MCP server interactively |
lac mcp list |
List configured MCP servers |
lac mcp remove |
Remove an MCP server |
LacAgent
| Command | What it does |
|---|---|
lac agent |
Launch AI coding assistant |
/undo |
Revert last file edit with diff |
/redo |
Reapply undone edit |
/history |
Show all file edits this session |
/diff <file> |
Inspect file with line numbers |
/gendoc [path] |
Generate API documentation |
/plan |
Enable PlanMode |
/noplan |
Disable PlanMode |
/tasks |
Show current task list |
/cleartasks |
Clear all tasks |
/formula list|use|off |
Manage coding formulas |
/manage on|off|status |
Token management |
/mcp |
List connected MCP servers |
Ctrl+C |
Interrupt agent execution |
exit |
Quit the agent |
Terminal Shell
| Command | What it does |
|---|---|
lac shell |
Launch the AI shell |
lac shell --setup |
Re-run setup wizard |
lac shell --offline |
Run without server |
lac shell --debounce MS |
Set autocomplete delay |
exit |
Quit the shell |
logout |
Delete your config and start fresh |
clear |
Clear the screen and session history |
cd <path> |
Change directory |
LacMind
| Command | What it does |
|---|---|
lac mind |
Launch LacMind web interface |
| Settings page | Add/edit/delete AI models |
| Duration selector | Set debate time (30s - 5min) |
| Stop button | End debate early |
| Export | Save conversations to PDF |
GenDoc
| Command | What it does |
|---|---|
lac gendoc <path> |
Generate API docs from project |
--prompt "text" |
Custom instructions for AI analysis |
--integrate |
Add /docs route to framework |
--output file.html |
Custom output filename |
| Export buttons | Download as Swagger or Postman |
Config
Your config is saved at ~/.lac/config.json after setup. You can edit it directly if needed.
{
"provider": "claude",
"api_key": "sk-...",
"model": "claude-haiku-4-5-20251001",
"base_url": "https://api.anthropic.com",
"server": "ws://localhost:8765"
}
Features
LacAgent Coding Assistant
File stuff:
- Read, write, patch files (exact string matching)
- Glob patterns like
**/*.py,*.js,src/** - Undo/redo with full history and diffs
Commands:
- Run shell commands with safety checks
- Auto backgrounds long commands (flutter run, npm start)
- Logs saved to
~/.lac/logs/
Other:
- HTTP requests for API testing
- File watching for changes
- API doc generation
- Project memory (remembers context)
- PlanMode (approve before execution)
- Task tracking with status icons
- Ask questions when needed
- Multi-line paste support
- Slash command autocomplete
- Ctrl+C to stop anytime
- Security validation
- MCP server integration
Terminal Shell
- Ghost text autocomplete as you type
- Plain English to command conversion
- Session history tracking for better suggestions
- Adjustable autocomplete speed
- Works with Claude, OpenAI, Ollama, or custom endpoints
- Offline mode with history fallback
- Auto starts server in background
- Logout clears everything
LacMind
- Multiple models debate sequentially
- Anonymous voting for best reasoning
- Real-time streaming
- Chat history saved
- Add/edit/delete models
- Set debate duration
- Stop early if consensus reached
- Export to PDF
- Dark theme UI
GenDoc
- Auto detects framework (Laravel, Django, FastAPI, Flask, Express, Rails)
- AI analyzes endpoints
- Interactive HTML docs with search
- Resizable sidebar with filtering
- Try It feature to test endpoints
- Export to Swagger or Postman
- Optional
/docsroute integration - Custom prompts for analysis
- Separate API key system
- Credit based usage
About
lac-cli is from lacai.io. Made for developers who work in the terminal.
License
MIT
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 lac_cli-0.3.3.tar.gz.
File metadata
- Download URL: lac_cli-0.3.3.tar.gz
- Upload date:
- Size: 223.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e2b570d871faa45f2eabea7515a4488065df2ca3ee04ac54832ec37d4879f47
|
|
| MD5 |
66b34dfe210ec933021b074a7029c20f
|
|
| BLAKE2b-256 |
f3c65a7643626087fe1c03272b85c6df259ef40b06132bc04d9e0dd00a75c173
|
File details
Details for the file lac_cli-0.3.3-py3-none-any.whl.
File metadata
- Download URL: lac_cli-0.3.3-py3-none-any.whl
- Upload date:
- Size: 232.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
695d682ca70e5576908fb7f4690727a039b77887510d36dcb92f1a73d474f836
|
|
| MD5 |
6e55a71e923684ef45df12c97c0b3866
|
|
| BLAKE2b-256 |
ee5ecd3fee20797951dd4738fa4013f604a412a90d067b1856e99cee8612ef75
|