Package Exports
- broke-cli
- broke-cli/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (broke-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
🚀 Broke CLI - Ultimate Coding Assistant
The most powerful CLI coding assistant
Code, fix, debug, and create with AI at your fingertips
📑 Table of Contents
- Features
- Quick Start
- Available Commands
- Auto-Analyze Command
- Examples
- How It Works
- Troubleshooting
- Try It Out
- Documentation
- Contributing
- License
✨ Features
- 🎯 Smart Code Analysis - Analyze and understand your codebase
- 🔧 Auto-Fix - Automatically fix bugs and issues
- 📝 Code Generation - Generate code from natural language descriptions
- 🐛 Debug Assistant - Get help debugging complex issues
- 🎨 Beautiful Terminal UI - Rich colors, animations, and modern design
- 📊 Real-time Logs - Colored, structured logging with multiple levels
- 🌐 AI Integration - Lightning-fast AI responses
- 📁 File Context - Understand your project structure
- 🔍 Smart Search - Find and analyze code patterns
- 📚 Documentation - Generate and improve documentation
- 🤖 Auto-Analysis - Automatically detect and analyze existing project structures
- 🔄 Smart Updates - Intelligently update existing files while maintaining compatibility
- 🎯 Project Detection - Auto-detect project types, frameworks, and dependencies
- 📋 Intelligent Suggestions - Provide context-aware suggestions for improvements
🚀 Quick Start
Prerequisites
- Node.js 18.0.0 or higher
- npm or yarn package manager
- OpenRouter API key (get one from https://openrouter.ai/keys)
Installation
# Install globally
npm install -g broke-cli
# Verify installation
broke --version
# Test OpenRouter API connection
broke "Hello, how can you help me with coding?"First Time Setup
# Create a .env file in the root directory
cp env.example .env
# Edit the .env file and add your OpenRouter API key
# Get your API key from https://openrouter.ai/keys
OPENROUTER_API_KEY=your-api-key-hereBasic Usage
# Start with interactive mode
broke
# Quick project overview
broke auto-analyze --summary
# Generate code
broke generate "Create a React component"
# Analyze existing code
broke analyze src/main.js📋 Available Commands
🔍 Analysis Commands
broke analyze <file>- Analyze and review specific filesbroke auto-analyze- Automatically analyze entire directorybroke auto-analyze --summary- Quick project overviewbroke auto-analyze --update- Auto-update existing filesbroke auto-analyze --interactive- Selective file updatesbroke auto-analyze --fix- Auto-fix common issuesbroke auto-analyze --create- Create missing essential files
🚀 Generation Commands
broke generate <description>- Generate code from descriptionbroke generate <description> --project- Generate complete projectbroke generate <description> --multiple- Generate multiple filesbroke generate <description> --interactive- Interactive generation
🛠️ Fix & Debug Commands
broke fix <issue>- Fix specific issues in codebroke debug <problem>- Get debugging helpbroke edit <file>- Edit files with AI assistancebroke edit-dir <directory>- Edit entire directories
📊 Utility Commands
broke logs- View command logs
📝 Utility Commands
broke prompt <text>- Direct AI promptbroke help- Show help informationbroke version- Show version information
🔍 Auto-Analyze Command
The new auto-analyze command automatically detects and analyzes your existing project structure:
# Quick overview of your project
broke auto-analyze --summary
# Auto-update existing files with improvements
broke auto-analyze --update
# Interactive mode for selective updates
broke auto-analyze --interactive
# Auto-fix common issues
broke auto-analyze --fix
# Create missing essential files
broke auto-analyze --createWhat it does:
- 🔍 Project Detection: Automatically identifies project type (React, Vue, Python, Java, etc.)
- 📊 Dependency Analysis: Extracts and analyzes dependencies from package.json, requirements.txt, etc.
- 🏗️ Framework Recognition: Detects frameworks and libraries in use
- 💡 Smart Suggestions: Provides context-aware improvement suggestions
- 🔄 Intelligent Updates: Suggests and applies improvements while maintaining compatibility
- 📝 File Generation: Creates missing essential files (README, .gitignore, etc.)
💡 Examples
Analyze Existing Project
# Quick overview
broke auto-analyze --summary
# Full analysis with suggestions
broke auto-analyze
# Auto-fix common issues
broke auto-analyze --fixGenerate New Code
# Simple component
broke generate "Create a React button component"
# Complete project
broke generate "Build a REST API with Express" --project
# Multiple files
broke generate "Create a user authentication system" --multipleFix Issues
# Fix specific problem
broke fix "Fix the authentication bug in login.js"
# Debug issue
broke debug "Why is my API returning 500 errors?"
# Edit file with AI
broke edit src/components/Header.js🔧 How It Works
The CLI is pre-configured with our API key, so you can start using it immediately after installation. No configuration files or API keys needed!
🚨 Troubleshooting
Common Issues
"Command not found"
# Reinstall globally
npm uninstall -g broke-cli
npm install -g broke-cli
# Or use npx
npx broke-cli --version```
# Or use npx
npx broke-cli --version"Permission denied"
# On Unix systems, you might need sudo
sudo npm install -g broke-cli
# Or use nvm to avoid permission issues
nvm install node
nvm use node
npm install -g broke-cliGetting Help
- Run
broke helpfor command overview - Check logs with
broke logs - Visit our GitHub Issues
Why No Configuration?
The CLI comes pre-configured with our API key, so you can start using it immediately after installation. No setup, no configuration files, no API keys needed!
📚 Documentation
For detailed documentation and examples, visit:
🎯 Try It Out
We've included a demo script to showcase the auto-analyze features:
📄 License
This project is licensed under the MIT License.