npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mvp-ai

v1.0.1

Published

A professional AI-powered CLI tool with natural language processing capabilities

Readme

🤖 AI CLI - Your AI-Powered Command Line Assistant

A professional, feature-rich AI CLI tool that brings the power of artificial intelligence directly to your terminal. Built with TypeScript and powered by multiple AI providers including Groq, OpenAI, and Anthropic.

✨ Features

🎯 Core AI Capabilities

  • Natural Language Processing: Ask questions in plain English and get intelligent responses
  • Streaming Responses: Real-time AI responses with beautiful terminal formatting
  • Multiple AI Providers: Support for Groq, OpenAI, and Anthropic models
  • Context Awareness: Automatically detects your project type and provides relevant assistance

💻 Developer Tools

  • Code Generation: Generate boilerplate code, components, APIs, and more
  • Code Translation: Convert code between different programming languages
  • Code Explanation: Get detailed explanations of commands, code snippets, and concepts
  • Error Debugging: Analyze error logs and get intelligent debugging assistance

🔧 Git Integration

  • Smart Commit Messages: Generate meaningful commit messages from your changes
  • Diff Analysis: Understand what your changes do and their impact
  • Git Workflow Assistance: Get help with branching, merging, and Git best practices

📝 Documentation & Analysis

  • File Summarization: Get high-level overviews of code files and projects
  • API Documentation: Quick explanations of libraries, functions, and APIs
  • Project Analysis: Understand project structure and architecture

🛠️ Automation & Scripting

  • Script Generation: Create automation scripts for common tasks
  • Regex Helper: Generate and test regular expressions from natural language
  • Task Automation: Generate deployment, backup, and monitoring scripts

🎮 Interactive Mode

  • Copilot Mode: Persistent AI session for ongoing assistance
  • Session Management: Save and restore conversation history
  • Context Preservation: Maintain conversation context across interactions

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • An API key from one of the supported providers (Groq, OpenAI, or Anthropic)

Installation

  1. Clone and setup the project:
git clone <repository-url>
cd ai-cli
npm install
npm run build
  1. Configure your API key:
# Copy the example environment file
cp .env.example .env

# Edit .env and add your API key
# For Groq (recommended for free usage):
GROQ_API_KEY=your_groq_api_key_here
  1. Test the installation:
node dist/index.js --help
  1. Optional: Install globally:
npm link
# Now you can use 'ai' command anywhere
ai --help

📖 Usage Examples

Basic AI Interaction

# Ask any question
ai ask "How do I reverse a string in Python?"

# Quick questions (shorthand)
ai "What is the difference between let and const in JavaScript?"

Code Generation

# Generate a React component
ai gen react component UserProfile

# Generate an API endpoint
ai gen api endpoint --language python --framework fastapi

# Generate with specific features
ai gen:component LoginForm --features "validation,styling,typescript"

Code Translation

# Translate Python to JavaScript
ai translate "def fibonacci(n): return n if n <= 1 else fibonacci(n-1) + fibonacci(n-2)" --from python --to javascript

# Use shortcuts
ai py2js "print('Hello World')"
ai js2ts "const greeting = 'Hello';"

Debugging & Analysis

# Debug an error
ai debug "TypeError: Cannot read property 'length' of undefined"

# Analyze from file
ai debug --file error.log

# Performance analysis
ai debug:performance --file profile.log

Git Integration

# Generate commit message
ai git commit

# Analyze changes
ai git diff --summary

# Get commit message suggestions
ai git commit --conventional

File & Project Analysis

# Summarize a file
ai summarize src/app.js

# Analyze entire project
ai sum:project

# Focus on specific aspects
ai summarize . --functions --classes

Interactive Mode

# Start interactive session
ai interactive

# In interactive mode:
ai> How do I optimize this React component?
ai> /help
ai> /save
ai> /exit

Script Generation

# Generate automation scripts
ai script "backup database daily at 2 AM"

# Generate deployment script
ai script:deploy "Deploy Node.js app to AWS"

# Save to file
ai script:backup --file backup.sh

Configuration

# View current config
ai config show

# Set API key
ai config set apiKey your_new_key

# Change model
ai config set model gpt-4

# Manage custom prompts
ai config prompts add "code-review" "Review this code for best practices" "Please review: {code}"

🎨 Terminal UI Features

The AI CLI includes beautiful terminal formatting with:

  • 🎨 Syntax highlighting for code blocks
  • 📊 Progress indicators for long operations
  • 🎯 Colored output for better readability
  • 📦 Boxed content for important information
  • Streaming responses with real-time output
  • 🔄 Interactive prompts for user input

🔧 Configuration

Environment Variables

# AI Provider Settings
GROQ_API_KEY=your_groq_api_key
OPENAI_API_KEY=your_openai_api_key  
ANTHROPIC_API_KEY=your_anthropic_api_key

# CLI Settings
AI_CLI_DEFAULT_MODEL=llama-3.3-70b-versatile
AI_CLI_MAX_TOKENS=4096
AI_CLI_TEMPERATURE=0.7

# Debug Settings
DEBUG=false
LOG_LEVEL=info

User Configuration

Configuration is stored in ~/.ai-cli/config.json:

{
  "apiKey": "your_api_key",
  "model": "llama-3.3-70b-versatile", 
  "provider": "groq",
  "maxTokens": 4096,
  "temperature": 0.7
}

🏗️ Project Structure

ai-cli/
├── src/
│   ├── commands/          # Command implementations
│   │   ├── ask.ts         # General AI interaction
│   │   ├── explain.ts     # Code/command explanation
│   │   ├── generate.ts    # Code generation
│   │   ├── translate.ts   # Code translation
│   │   ├── debug.ts       # Error analysis
│   │   ├── git.ts         # Git integration
│   │   ├── summarize.ts   # File/project analysis
│   │   ├── interactive.ts # Interactive mode
│   │   └── ...
│   ├── services/          # Core services
│   │   └── ai-service.ts  # AI provider integration
│   ├── utils/             # Utility functions
│   │   ├── formatter.ts   # Terminal formatting
│   │   ├── project-detector.ts # Project type detection
│   │   └── file-analyzer.ts    # File analysis
│   ├── config/            # Configuration management
│   ├── types/             # TypeScript type definitions
│   └── index.ts           # Main entry point
├── dist/                  # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

🎯 Supported AI Providers

Groq (Recommended)

  • Free tier available
  • Fast inference
  • Models: llama-3.3-70b-versatile, mixtral-8x7b-32768
  • Setup: Get API key from console.groq.com

OpenAI

  • High quality responses
  • Models: gpt-4, gpt-3.5-turbo, gpt-4-turbo
  • Setup: Get API key from platform.openai.com

Anthropic

🔍 Command Reference

Core Commands

  • ai ask <question> - Ask any question to the AI
  • ai explain <code/command> - Explain code or commands
  • ai generate <type> [name] - Generate code templates
  • ai translate <code> --to <language> - Translate code between languages
  • ai debug [error] - Debug errors and analyze logs
  • ai interactive - Start interactive copilot mode

Git Commands

  • ai git commit - Generate commit messages
  • ai git diff - Analyze git differences
  • ai git log --summary - Summarize git history

Analysis Commands

  • ai summarize <file/directory> - Summarize code files
  • ai doc <library/function> - Get documentation
  • ai regex <description> - Generate regex patterns

Automation Commands

  • ai script <description> - Generate automation scripts
  • ai config - Manage configuration

🚀 Advanced Usage

Custom System Prompts

# Use custom system prompt
ai ask "Explain this code" --system "You are a senior developer mentor"

# In interactive mode
ai interactive --system "You are a Python expert focused on best practices"

Output Formats

# JSON output
ai ask "What is React?" --output json

# Markdown output
ai explain "docker run" --output markdown

Project-Aware Assistance

The CLI automatically detects your project type and provides contextual help:

  • Node.js projects: Suggests npm/yarn commands, React patterns
  • Python projects: Recommends pip/poetry, Django/Flask patterns
  • Java projects: Maven/Gradle assistance, Spring Boot patterns
  • And more: Rust, Go, PHP, Ruby, etc.

🛠️ Development

Building from Source

# Clone the repository
git clone <repository-url>
cd ai-cli

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

# Run tests
npm test

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📝 License

MIT License - see LICENSE file for details.

🤝 Support

  • Issues: Report bugs and request features on GitHub
  • Documentation: Check the wiki for detailed guides
  • Community: Join our Discord for discussions

🎉 What's Next?

The AI CLI is designed to be extensible and continuously improved. Upcoming features include:

  • Plugin system for custom commands
  • Team collaboration features
  • Integration with popular IDEs
  • Advanced project templates
  • Multi-language support for UI

Happy coding with AI! 🚀