JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q39902F
  • License MIT

🚀 The ultimate CLI coding assistant powered by AI - Generate code, analyze projects, and build applications with natural language commands

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 AI-Powered Coding Assistant

npm version Downloads License: MIT

✨ NEW in v2.0.0: Google Gemini AI Integration, Real-time Web Dashboard, User Authentication, Usage Tracking & Admin Panel!

Broke CLI is the ultimate command-line coding assistant powered by Google Gemini AI. Generate code, analyze projects, fix bugs, and manage your development workflow with natural language commands - now with a beautiful real-time web dashboard!

🌟 Key Features

🤖 AI-Powered Development

  • Google Gemini AI Integration (Primary) - Fast, free, and powerful
  • OpenRouter Support (Fallback) - Multiple AI models available
  • Natural Language Processing - Describe what you want in plain English
  • Smart Code Analysis - Understand your codebase instantly
  • Auto Bug Fixing - Automatically fix issues and vulnerabilities
  • Intelligent Code Generation - Create functions, components, and entire files

🌐 Real-time Web Dashboard

  • Futuristic 3D UI - Beautiful, modern design with animations
  • Live Usage Tracking - Real-time updates every 2 seconds via WebSocket
  • System Information - Monitor PC specs, memory, CPU usage
  • User Authentication - Secure login/logout system
  • Admin Panel - Manage users, approvals, and system stats
  • Mobile Responsive - Works perfectly on all devices

Usage Control & Analytics

  • Rate Limiting - 2 requests per minute for free users
  • Premium Tiers - Unlimited usage with admin approval
  • Usage Statistics - Track daily, hourly, and minute-by-minute usage
  • Session Management - Secure user sessions with real-time sync
  • Admin Approval System - Controlled upgrade process

🛠️ Developer Tools

  • Project Analysis - Automatic project structure detection
  • File Context Understanding - AI understands your entire codebase
  • Multi-language Support - JavaScript, TypeScript, Python, React, Vue, and more
  • Beautiful Terminal UI - Enhanced with colors, animations, and progress bars
  • Real-time Logs - Monitor all activities and debug easily

🚀 Quick Start

Installation

# Install globally via npm
npm install -g broke-cli

# Verify installation
broke version

Basic Usage

# Start the interactive mode
broke

# Analyze a file
broke analyze src/app.js

# Generate code
broke generate "Create a React login component with validation"

# Fix issues
broke fix "Fix the authentication bug in user.js"

# Debug problems
broke debug "Why is my API not working?"

# Launch web dashboard
broke dashboard

# Launch admin panel
broke dashboard --admin

# View usage statistics
broke usage

🌐 Web Dashboard

User Dashboard

  • Live Usage Stats - See your API usage in real-time
  • AI Model Info - Current model and status
  • System Information - Your PC specs and performance
  • Upgrade Requests - Request premium features

Admin Panel

  • User Management - View and manage all users
  • System Statistics - Server performance and metrics
  • Upgrade Approvals - Approve premium requests
  • Real-time Monitoring - Live updates of system status
# Start dashboard on default port (3000)
broke dashboard

# Start on custom port
broke dashboard --port 8080

# Launch admin panel
broke dashboard --admin

Default Admin Access:

  • Email: admin@broke-cli.com
  • Password: admin123

💻 Command Reference

Core Commands

Command Description Example
broke analyze <file> Analyze code for issues and improvements broke analyze app.js --focus security
broke generate <description> Generate code from natural language broke generate "API endpoint for user auth"
broke fix <issue> Fix bugs and issues automatically broke fix "Memory leak in React component"
broke debug <problem> Get debugging assistance broke debug "Why is my database connection failing?"
broke dashboard Launch web dashboard broke dashboard --port 3000
broke usage View usage statistics broke usage --admin

Advanced Options

# Use OpenRouter instead of Gemini
broke analyze app.js --openrouter

# Save output to file
broke generate "React component" --output component.jsx

# Enable verbose logging
broke --verbose analyze app.js

# Auto-fix issues
broke analyze app.js --auto-fix

# Interactive editing
broke analyze app.js --edit

🔧 Configuration

Environment Variables

Create a .env file in your project root:

# Google Gemini API (Primary)
GEMINI_API_KEY=your_gemini_api_key_here

# OpenRouter API (Fallback)
OPENROUTER_API_KEY=your_openrouter_api_key_here

# Web Dashboard
WEB_PORT=3000
SESSION_SECRET=your_session_secret

# Usage Limits
FREE_TIER_LIMIT=2
PREMIUM_TIER_LIMIT=100

Note: Broke CLI comes with pre-configured API keys for immediate use. Custom keys are optional for production use.

🌟 What's New in v2.0.0

🎉 Major Features

  • Google Gemini AI - Now the primary AI service for faster, better responses
  • Real-time Web Dashboard - Beautiful 3D UI with live updates
  • User Authentication - Secure login/logout with session management
  • Usage Tracking - Advanced analytics with rate limiting
  • Admin Panel - Complete user and system management
  • System Information - Real-time PC monitoring and stats

🔄 Improvements

  • Enhanced UI - Modern, responsive design with animations
  • Better Performance - Optimized for speed and reliability
  • WebSocket Integration - Real-time updates every 2 seconds
  • Mobile Support - Works perfectly on all screen sizes
  • Security - Enhanced authentication and session management

🛠️ Technical Updates

  • TypeScript - Full type safety and better development experience
  • Express.js - Robust web server with middleware support
  • Socket.IO - Real-time bidirectional communication
  • Modern Architecture - Scalable and maintainable codebase

📊 Usage Analytics

Free Tier

  • 2 requests per minute
  • 20 requests per hour
  • 100 requests per day
  • Access to web dashboard
  • Basic usage statistics

Premium Tier (Admin Approval Required)

  • Unlimited requests
  • Priority processing
  • Advanced analytics
  • Admin panel access (if promoted)
  • Custom rate limits

🔐 Authentication

User Registration

# Visit the dashboard to register
broke dashboard
# Go to http://localhost:3000/register

Admin Access

  • Default admin account is pre-configured
  • Contact admin for premium upgrades
  • Admin can promote users and manage limits

🌍 Web Deployment

Vercel Deployment

Broke CLI dashboard can be deployed to Vercel:

# Install Vercel CLI
npm i -g vercel

# Deploy to Vercel
vercel --prod

Local Development

# Clone the repository
git clone https://github.com/RifatArefinBD/broke-cli.git
cd broke-cli

# Install dependencies
npm install

# Build the project
npm run build

# Start development server
npm run dev

# Launch dashboard
npm start dashboard

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Fork and clone the repo
git clone your-fork-url
cd broke-cli

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build for production
npm run build

🐛 Troubleshooting

Common Issues

  1. "Command not found"

    npm install -g broke-cli
    npm link  # If still having issues
  2. "Permission denied"

    sudo npm install -g broke-cli  # Linux/Mac
    # Or use nvm for Node.js version management
  3. "API limit exceeded"

    • Check your usage with broke usage
    • Request premium upgrade via dashboard
    • Wait for rate limit reset
  4. "Dashboard not loading"

    # Check if port is available
    broke dashboard --port 8080
    
    # Check logs
    broke logs --show

Debug Mode

# Enable verbose logging
broke --verbose <command>

# Check system logs
broke logs --show

# Export logs for debugging
broke logs --export debug.log

📝 License

MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Google Gemini AI - For providing excellent AI capabilities
  • OpenRouter - For AI model diversity and reliability
  • The Developer Community - For feedback and contributions
  • Open Source Contributors - For making this project better

📞 Support

  • GitHub Issues: Report bugs or request features
  • Dashboard Support: Use the built-in help in the web dashboard
  • Community: Join our Discord server for discussions

Happy Coding with Broke CLI! 🚀

Transform your development workflow with AI-powered assistance and real-time insights. - Ultimate Coding Assistant

The most powerful CLI coding assistant
Code, fix, debug, and create with AI at your fingertips

Version License Node

📑 Table of Contents

✨ 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

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-here

Basic 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 files
  • broke auto-analyze - Automatically analyze entire directory
  • broke auto-analyze --summary - Quick project overview
  • broke auto-analyze --update - Auto-update existing files
  • broke auto-analyze --interactive - Selective file updates
  • broke auto-analyze --fix - Auto-fix common issues
  • broke auto-analyze --create - Create missing essential files

🚀 Generation Commands

  • broke generate <description> - Generate code from description
  • broke generate <description> --project - Generate complete project
  • broke generate <description> --multiple - Generate multiple files
  • broke generate <description> --interactive - Interactive generation

🛠️ Fix & Debug Commands

  • broke fix <issue> - Fix specific issues in code
  • broke debug <problem> - Get debugging help
  • broke edit <file> - Edit files with AI assistance
  • broke edit-dir <directory> - Edit entire directories

📊 Utility Commands

  • broke logs - View command logs

📝 Utility Commands

  • broke prompt <text> - Direct AI prompt
  • broke help - Show help information
  • broke 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 --create

What 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 --fix

Generate 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" --multiple

Fix 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-cli

Getting Help

  • Run broke help for 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.