LuckyD Code — AI coding assistant powered by DeepSeek
Project description
LuckyD Code
A full-featured AI coding assistant for your terminal and browser, powered by the DeepSeek API. Features 35+ built-in tools, a semantic knowledge graph, Playwright browser automation, multi-agent orchestration, Docker sandboxing, and a live Web UI.
Features
- AI Chat — Conversational coding assistant with streaming responses and thinking/reasoning mode
- Smart Model Routing — Auto-classifies prompt complexity into 4 tiers, escalating from cheap/fast to powerful/reasoning models
- Knowledge Graph — Automatically indexes your codebase into a searchable vector graph; falls back to a keyword graph if vector dependencies aren't installed
- Memory System — Persistent memory across sessions with auto-save and relevance search
- Cost Tracking — Per-session and cumulative cost tracking across models
- Web UI — Browser-based interface with cost panel, memory management, and model routing info
- 35+ Built-in Tools — File operations, search, code analysis, shell commands, and more
- MCP Support — Model Context Protocol for extending with custom tools
- Plugin System — Drop Python files into
~/.claude/plugins/to register additional tools at runtime - Context Management — Auto-compaction with summarization to stay within context windows
- Background Agents — Run tasks asynchronously while continuing to chat
- Orchestrator — Researcher → Coder → Reviewer pipeline for complex tasks
- Hooks System — Pre/post tool use, pre/post chat, and session lifecycle hooks
- Sandboxing — Docker-based secure command execution
- Session Management — Save and load conversations
- Undo — Revert file writes and edits
- Export — Export conversations to Markdown or HTML
- Shell Detection — Auto-detects Git Bash → WSL → cmd.exe on Windows; rewrites interactive commands so the correct shell is always used
- Analytics — Code health scoring, code smell detection, and trend tracking
Prerequisites
- Python 3.10+
- DeepSeek API key — Get one free at platform.deepseek.com/api_keys
Quick Start — No setup required
Windows — double-click one of these:
Install and Run - Windows.bat— CLI modeInstall and Run Web UI - Windows.bat— browser UI
Mac — double-click Install and Run - Mac.command
(first time: right-click → Open to bypass Gatekeeper)
Linux — run in terminal:
chmod +x "Install and Run - Linux.sh"
"./Install and Run - Linux.sh"
The launcher automatically creates a virtual environment, installs dependencies, and prompts for your API key on first run.
Installation
From PyPI
pip install luckyd-code
From source
git clone https://github.com/Dylanchess0320/LuckyD-Code
cd luckyd-code
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
Optional dependencies
# RAG support (semantic memory search)
pip install -e ".[rag]"
# Full RAG with FAISS vector search and file watching
pip install -e ".[rag-full]"
# Browser automation (Playwright)
pip install -e ".[browser]"
# Development dependencies
pip install -e ".[dev]"
Usage
CLI mode
luckyd-code
# or
ldc
# or
python main.py
Web UI mode
luckyd-code --web
# or
python main.py --web
Then open http://localhost:8000 in your browser.
Commands
Once in the CLI, use slash commands:
| Command | Description |
|---|---|
/help |
Show available commands |
/model |
Switch model or view current model |
/cost |
Show session cost |
/memory |
View or search memory |
/session |
Save, load, or list sessions |
/export |
Export conversation |
/undo |
Undo last file write/edit |
/orchestrate |
Run multi-agent pipeline |
/analytics |
Run code health analysis |
/clear |
Clear conversation |
/quit |
Exit |
Environment variables
Copy .env.example to .env and set your API key:
cp .env.example .env
Then edit .env:
DEEPSEEK_API_KEY=sk-your-deepseek-key-here
Built-in Tools
LuckyD Code includes 35+ tools for interacting with your codebase:
- File operations: Read, Write, Edit, Glob, Grep, Delete, Move, Copy
- Code analysis: Lint, TypeCheck, Complexity, Coverage
- Search: Semantic search, keyword search, file search
- Shell: Bash execution, PowerShell, Git operations
- Web: Playwright browser automation, HTTP requests
- Knowledge: Knowledge graph query, memory search
- Project: Project scan, dependency analysis, code smell detection
- Utility: Undo, Export, Session management
Project Structure
luckyd_code/
├── cli.py # Terminal UI and REPL
├── cli_commands/ # Slash-command handlers
├── web_app.py # Web UI server (FastAPI)
├── web_routes/ # Web UI route handlers
├── api.py # API streaming client
├── router.py # Model routing
├── config.py # Configuration
├── context.py # Conversation context
├── cost_tracker.py # Cost tracking
├── hooks.py # Lifecycle hooks
├── model_registry.py # Model definitions
├── memory/ # Persistent memory
├── brain/ # Knowledge graph & RAG
├── tools/ # Tool registry (35+ tools)
├── mcp/ # MCP client
├── permissions/ # Permission system
├── skills/ # Review & security
├── analytics/ # Usage analytics
├── templates/ # Web UI assets
└── background/ # Background agents
Development
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# With coverage
pytest --cov=luckyd_code --cov-report=term
# Type checking
mypy luckyd_code
# Build distribution
make build
Contributing
See CONTRIBUTING.md for detailed guidelines.
- Fork the repository
- Create a feature branch from
main - Write tests for new functionality
- Ensure all existing tests pass
- Submit a pull request
License
MIT License — see LICENSE for details.
Security
See SECURITY.md for supported versions and how to report vulnerabilities.
Changelog
See CHANGELOG.md for a history of changes.
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 luckyd_code-1.2.2.tar.gz.
File metadata
- Download URL: luckyd_code-1.2.2.tar.gz
- Upload date:
- Size: 267.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d431dc2f6f09e3bd4008fb09467f1ea2b89dba2761bfc6fe2c2d0a255a8830c7
|
|
| MD5 |
1e3c7efee3101ba2e74eabe1b343bd76
|
|
| BLAKE2b-256 |
6d9684c1f8c5d28a2f42da0a30c2f534152200c7f4251be8c08c42a8adcb7f08
|
File details
Details for the file luckyd_code-1.2.2-py3-none-any.whl.
File metadata
- Download URL: luckyd_code-1.2.2-py3-none-any.whl
- Upload date:
- Size: 256.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dc945fd9f519229fb2f6872c340b2cc5d50150344f7d94d2c8305af31596af0
|
|
| MD5 |
41128adc93aff6855aebe3daee3ecee7
|
|
| BLAKE2b-256 |
c2f0250accad9e3808705368df7ac6416b03d183c8e2d265e5cdb497564c274e
|