β‘ Fast, Cost-Effective AI Code Assistant - The lightweight alternative to Claude Code for developers, small teams, and freelancers.
Claude Code is powerful but expensive. lite-code gives you the essential AI-powered code refactoring capabilities at a fraction of the cost.
| Feature | Claude Code | lite-code |
|---|---|---|
| Cost | $20/month | Pay-per-use (Cerebras) |
| Speed | Fast | β‘ Faster (batch processing) |
| Context | 200K tokens | 130K tokens |
| Best For | Enterprise | Developers, Freelancers, Small Teams |
| Setup | Complex | Simple (pip install) |
- β‘ Lightning Fast: Batch processing reads multiple files in one request
- π° Cost Effective: Pay only for what you use with Cerebras API
- π― Focused: Essential refactoring features without bloat
- π Python Support: Type hints, logging conversion, async patterns
- π JavaScript/TypeScript Support: Modern JS patterns, type annotations
- π¬ Interactive CLI: Simple, intuitive interface
- π Context Management: Reference files and folders with
@and/ - π Safe Refactoring: In-place editing with optional backup mode
- πΎ Persistent Configuration: Saves your settings between sessions
- π¨ Beautiful Output: Rich console with colored diffs
- β¨οΈ Tab Completion: Auto-complete file and folder references
- β Ask Mode: Ask questions about code and generate diagrams
pip install lite-codegit clone https://github.com/kumarsahil01/lite-code.git
cd lite-code
pip install -e .# Launch the interactive CLI
lite-code
# First-time setup will prompt for:
# 1. Cerebras API key
# 2. Model name (default: zai-glm-4.7)lite-code@filename- Reference a file (e.g.,@utils.py) - supports tab completion/folder- Reference a folder (e.g.,/src) - supports tab completionask <question>- Ask questions about code (e.g.,ask explain main())?- Show help!- Change settingsclear- Clear contextexit/quit- Save and exit
$ lite-code
π Welcome to lite-code!
AI-powered code refactoring assistant
No API key found.
Enter your Cerebras API key: sk-xxxxxxxx
β API key saved
lite-code > @utils.py
β Added utils.py (python) to context
lite-code > /src
β Added folder /src to context (5 files)
lite-code > Add type hints to all functions
β Analyzing 5 file(s)...
File 1/5: src/utils.py
--- original
+++ modified
-def greet(name):
+def greet(name: str) -> str:
print("Hello, " + name)
Apply changes? [y/N]: y
β Applied changes
File 2/5: src/api.py
--- original
+++ modified
-def fetch_data(url):
+def fetch_data(url: str) -> dict:
Apply changes? [y/N]: y
β Applied changes
β Completed: 5 files modified
lite-code > !
Settings:
1. Change API key
2. Change model (current: zai-glm-4.7)
3. Toggle backup mode (current: disabled)
4. Back
Select option: 3
β Backup mode enabled
lite-code > exit
β Configuration saved
Goodbye! πConfiguration is stored in ~/.lite-code/config.json:
{
"api_key": "your-api-key",
"model": "zai-glm-4.7",
"context": ["utils.py", "src/"],
"backup_mode": false
}Access settings by typing ! in the interactive CLI:
- Change API key - Update your Cerebras API key
- Change model - Switch between different models
- Toggle backup mode - Enable/disable automatic backups
- Back - Return to main interface
- Type hinting
- Print β logging conversion
- Async conversion
- Dead code removal
- Best practices (f-strings, context managers)
- var β const/let conversion
- Arrow functions
- Template literals
- JSDoc comments
- TypeScript type annotations
- Python 3.10+
- Cerebras API key
- Internet connection (for API calls)
cerebras-cloud-sdk- Cerebras API clientrich- Beautiful terminal outputprompt-toolkit- Interactive input with history
Get your Cerebras API key from Cerebras Cloud
No API key found.
Enter your Cerebras API key:
Solution: Enter your API key when prompted, or set it via settings (! command).
If you see an error about the model not existing, check the model name in settings (! command).
If files aren't being found, ensure you're in the correct directory and use relative paths.
git clone https://github.com/kumarsahil01/lite-code.git
cd lite-code
pip install -e ".[dev]"pytestpython -m buildtwine upload dist/*Built by: Sahil Kumar
Special Thanks: Cerebras for providing the zai-glm-4.7 model and API support
GitHub: https://github.com/kumarsahil01/lite-code
MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Built with Cerebras Cloud SDK
- Inspired by Claude Code
- Uses Rich for beautiful terminal output
- Uses prompt_toolkit for interactive input
For issues and questions, please open an issue on GitHub.
Made with β€οΈ by the Sahil Kumar