Fast, lightweight AI-assisted development that runs anywhere.
AI Coder Mini is a TypeScript-based CLI tool that provides AI-powered coding assistance with a focus on simplicity, security, and performance. Built on Bun.js for maximum speed and minimal dependencies.
- Lightweight & Fast: Built with Bun.js for optimal performance
- No External Dependencies: Self-contained with minimal runtime requirements
- AI-Powered Assistance: Stream-based AI responses with tool execution
- File Operations: Read, write, edit, search files and directories
- Command System: Extensible command architecture with built-in commands
- Plugin System: Modular plugin architecture for extensibility
- Memory Management: Intelligent conversation history with compaction
- Statistics Tracking: Real-time usage statistics and metrics
- Sandbox Support: Safe execution in restricted environments
- Raspberry Pi Compatible: Designed to run on resource-constrained devices
- Bun.js runtime
- Node.js 20+ (for TypeScript types)
# Clone the repository
git clone https://github.com/your-org/aicoder-mini.git
cd aicoder-mini
# Run the installation script
./install.shThe installer automatically detects your environment:
- Standard installation to
~/.local/share/aicoder-mini - Sandbox mode for restricted environments (firejail, read-only filesystems)
# Install dependencies
bun install
# Build the project
bun run build
# Run directly
bun src/index.ts
# Or use the built version
bun dist/index.jsaicoder-mini # Start interactive mode
aicoder-mini --help # Show help
aicoder-mini --version # Show version
Once in interactive mode, you can use these commands:
/help- Show available commands/clear- Clear conversation history/save <name>- Save current conversation/load <name>- Load a saved conversation/stats- Show usage statistics/memory- Show memory usage/compact- Compact conversation history/detail- Toggle detailed mode/yolo- Toggle auto-approval mode/reset- Reset conversation/quit- Exit the application
Simply type your coding questions or requests:
How do I implement a binary search tree?
Create a REST API endpoint for user management
Refactor this function to be more readable
AI Coder Mini can perform file operations through AI assistance:
Read the package.json file
Create a new utils.ts file with helper functions
Search for all TypeScript files containing "interface"
- AICoder: Main application controller
- StreamingClient: Handles AI communication and streaming responses
- ToolManager: Manages available tools and their execution
- CommandHandler: Processes user commands
- MessageHistory: Manages conversation context and memory
- PluginSystem: Extensible plugin architecture
- InputHandler: Processes user input with interrupt handling
read-file- Read file contentswrite-file- Write or create filesedit-file- Edit existing fileslist-directory- List directory contentsrun-shell-command- Execute shell commandsgrep- Search text in files
Extend functionality with plugins:
// Example plugin structure
export class MyPlugin implements Plugin {
name = "my-plugin";
version = "1.0.0";
async initialize(context: PluginContext) {
// Plugin initialization
}
async destroy() {
// Cleanup
}
}src/
├── core/ # Core application logic
│ ├── aicoder.ts # Main application class
│ ├── commands/ # Command implementations
│ ├── plugin-system.ts # Plugin management
│ └── ... # Other core modules
├── prompts/ # AI prompt templates
├── tools/ # Built-in tool implementations
└── index.ts # Application entry point
tests/ # Test suite
plugins/ # Example plugins
docs/ # Documentation
# Standard build
bun run build
# Minified build
MINIFIED=1 bun run build
# or
bun run build:min# Run all tests
bun test
# Run tests with coverage
bun test --coverageThis project follows strict coding guidelines:
- Readability is mandatory - Keep code simple and clear
- Guard clauses over else - Use early returns/exceptions
- Test every feature - Comprehensive test coverage
- No emojis in code - Use unicode symbols (✓, ✗) instead
- TypeScript strict mode - Full type safety
AI Coder Mini can be configured through environment variables and configuration files.
# AI provider configuration
AI_PROVIDER="openai" # openai, anthropic, etc.
AI_API_KEY="your-api-key"
AI_MODEL="gpt-4"
# Behavior configuration
MAX_TOKENS=4096 # Maximum context size
TEMPERATURE=0.7 # AI response randomness
AUTO_APPROVE=false # Auto-approve tool executions
# Retry configuration
MAX_RETRIES=3 # Maximum number of retry attempts (default: 3)
RETRY_MAX_WAIT=64 # Maximum backoff wait time in seconds (default: 64)
# Plugin configuration
DISABLE_PLUGINS=1 # Disable all plugins from loading- Sandbox Mode: Safe execution in restricted environments
- No External Dependencies: Reduced attack surface
- Permission Controls: Explicit file access controls
- Command Validation: All tool calls validated before execution
- Lightweight Runtime: Minimal memory footprint (<50MB base)
- Efficient Streaming: Real-time AI responses without buffering
- Smart Caching: Intelligent response caching
- Optimized for RPi3: Runs efficiently on resource-constrained devices
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes following the code style guidelines
- Add tests for new functionality
- Run the test suite:
bun test - Submit a pull request
- Read existing code before making changes
- Ask for clarification when requirements are unclear
- Create tests for every new feature
- Use guard clauses instead of else statements
- Keep code readable and maintainable
- Consider performance on resource-constrained devices
This project is licensed under the Apache License 2.0. See LICENSE for details.
- Issues: Report bugs and request features via GitHub Issues
- Documentation: Check the
docs/directory for detailed guides - Community: Join discussions in GitHub Discussions
Built with:
- Bun.js - Fast JavaScript runtime
- TypeScript - Type-safe JavaScript
AI Coder Mini - Fast, lightweight AI-assisted development that runs anywhere.