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

@godwin-ngabo/ai-coding-agent

v1.0.0

Published

Production-ready AI coding agent system for IDE integration

Readme

AI Coding Agent

A production-ready AI-powered coding assistant that integrates with IDEs like VS Code, providing intelligent code generation, modification, and analysis capabilities.

Features

  • Natural Language Commands: Generate and modify code using plain English
  • Multi-file Editing: Handle complex projects with multiple files
  • IDE Integration: Native VS Code extension support
  • Web Dashboard: Optional web-based interface
  • Safety Features: Automatic backups and confirmation prompts
  • Project Context Awareness: Understands your codebase structure
  • Multiple AI Models: Support for OpenAI, Anthropic, and other models via OpenRouter

Quick Start

Prerequisites

Installation

  1. Clone and install:
git clone <repository-url>
cd ai-agent
npm install
  1. Configure API key:
# Option 1: Environment variable
export OPENROUTER_API_KEY="your-api-key-here"

# Option 2: Interactive setup
npm run setup
  1. Install globally (optional):
npm link

Basic Usage

CLI Tool

# Generate code
ai-agent "create a login component with validation"

# Modify existing code
ai-agent "optimize the performance of this function"

# Analyze code
ai-agent "analyze this file for security issues"

# Explain code
ai-agent "explain how this authentication system works"

VS Code Extension

  1. Install the extension from the extension/ directory
  2. Open Command Palette (Ctrl+Shift+P)
  3. Run "AI Agent: Setup AI Agent"
  4. Start using commands like:
    • "AI Agent: Execute AI Agent"
    • "AI Agent: Explain Selected Code"
    • "AI Agent: Optimize Selected Code"

Web Dashboard

cd web-ui
npm install
npm start

Visit http://localhost:3000 to access the web interface.

Architecture

Core Components

ai-agent/
|
|-- src/                          # Core source code
|   |-- cli/                      # CLI tool components
|   |-- prompt/                   # Prompt generation system
|   |-- files/                    # File system management
|   |-- agent/                    # AI agent core
|   `-- utils/                    # Shared utilities
|
|-- extension/                    # VS Code extension
|-- web-ui/                       # Web dashboard
|-- config/                       # Configuration files
`-- docs/                         # Documentation

Data Flow

User Input -> Command Parser -> Prompt Generator -> AI API -> Response Parser -> File Editor -> Output

Configuration

CLI Configuration

Create config/user.json or use environment variables:

{
  "api": {
    "provider": "openrouter",
    "model": "openai/gpt-3.5-turbo",
    "maxTokens": 4000,
    "temperature": 0.7
  },
  "cli": {
    "confirmChanges": true,
    "createBackups": true,
    "maxFilesPerRequest": 50
  },
  "backup": {
    "enabled": true,
    "directory": ".ai-agent-backups"
  }
}

Environment Variables

OPENROUTER_API_KEY=your-key-here
AI_AGENT_MODEL=openai/gpt-4
AI_AGENT_MAX_TOKENS=4000
AI_AGENT_LOG_LEVEL=info

VS Code Settings

{
  "aiAgent.apiKey": "your-api-key",
  "aiAgent.model": "openai/gpt-3.5-turbo",
  "aiAgent.autoApply": false,
  "aiAgent.createBackups": true
}

Commands Reference

CLI Commands

# Execute AI agent
ai-agent "your task description"

# Setup configuration
ai-agent setup

# Show status
ai-agent status

# View configuration
ai-agent config --show

# Reset configuration
ai-agent config --reset

VS Code Commands

  • ai-agent.execute - Execute AI Agent
  • ai-agent.setup - Setup AI Agent
  • ai-agent.status - Show Status
  • ai-agent.openPanel - Open AI Agent Panel
  • ai-agent.quickChat - Quick Chat with AI
  • ai-agent.explainCode - Explain Selected Code
  • ai-agent.optimizeCode - Optimize Selected Code
  • ai-agent.generateTests - Generate Tests for Selection

Keyboard Shortcuts

  • Ctrl+Shift+A - Execute AI Agent
  • Ctrl+Shift+/ - Quick Chat
  • Ctrl+Shift+E - Explain Selected Code
  • Ctrl+Shift+O - Optimize Selected Code

Prompt Examples

Code Generation

# Create components
ai-agent "create a React login form with email/password validation and error handling"

# Build APIs
ai-agent "create a REST API for user management with CRUD operations"

# Add features
ai-agent "add dark mode toggle to this application"

Code Modification

# Refactoring
ai-agent "refactor this function to use async/await instead of promises"

# Performance
ai-agent "optimize this database query for better performance"

# Security
ai-agent "add input validation and sanitization to this form"

Code Analysis

# Security review
ai-agent "analyze this authentication code for security vulnerabilities"

# Code review
ai-agent "review this component for React best practices"

# Documentation
ai-agent "generate comprehensive documentation for this API"

File Operations

Supported File Types

  • JavaScript/TypeScript (.js, .jsx, .ts, .tsx)
  • Python (.py)
  • Java (.java)
  • C/C++ (.c, .cpp, .h, .hpp)
  • Web (.html, .css, .scss)
  • Data (.json, .xml, .yaml)
  • Documentation (.md, .txt)

Safety Features

  • Automatic Backups: Creates backups before modifications
  • Confirmation Prompts: User approval for destructive changes
  • Rollback Capability: Undo recent changes
  • Validation: Syntax checking before applying changes

Output Format

The AI agent follows this format for code changes:

FILE: filename.js
<complete code content>

FILE: another-file.js
<complete code content>

API Integration

OpenRouter Setup

  1. Sign up at openrouter.ai
  2. Get your API key
  3. Configure in the agent:
    export OPENROUTER_API_KEY="your-key"

Supported Models

  • OpenAI: GPT-3.5 Turbo, GPT-4
  • Anthropic: Claude 3 Haiku, Claude 3 Sonnet
  • Meta: Llama 3 70B
  • And more via OpenRouter

Rate Limiting

Built-in rate limiting prevents API abuse:

  • Requests per minute: 60 (configurable)
  • Requests per hour: 1000 (configurable)
  • Automatic retry with exponential backoff

Development

Project Structure

ai-agent/
|-- src/cli/           # Command-line interface
|-- src/prompt/        # Prompt generation
|-- src/files/         # File system operations
|-- src/agent/         # AI agent core
|-- src/utils/         # Utilities
|-- extension/         # VS Code extension
|-- web-ui/           # Web dashboard
|-- tests/            # Test files
|-- docs/             # Documentation

Running Tests

# Run all tests
npm test

# Watch mode
npm run test:watch

# Coverage
npm run test:coverage

Building

# Build all components
npm run build

# Build extension only
npm run build:extension

# Build web UI only
npm run build:web

Development Mode

# CLI development
npm run dev

# Web UI development
cd web-ui && npm run dev

# Extension development
cd extension && npm run watch

Troubleshooting

Common Issues

API Key Error:

# Set environment variable
export OPENROUTER_API_KEY="your-key"

# Or run setup
ai-agent setup

Module Error:

# Install dependencies
npm install

# Use .mjs extension for ES modules
node agent.mjs "your task"

Permission Denied:

# Check file permissions
ls -la your-file.js

# Fix permissions
chmod 644 your-file.js

Debug Mode

Enable verbose logging:

ai-agent --verbose "your task"

Or set log level in config:

{
  "logging": {
    "level": "debug"
  }
}

Getting Help

# Show help
ai-agent --help

# Check status
ai-agent status

# View logs
tail -f logs/agent.log

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make changes and add tests
  4. Run tests: npm test
  5. Submit a pull request

Code Style

  • Use ES6+ features
  • Follow the existing code style
  • Add JSDoc comments
  • Include error handling
  • Write unit tests

License

MIT License - see LICENSE file for details.

Changelog

See CHANGELOG.md for version history and updates.

Support

  • Documentation: Check the docs/ directory
  • Issues: Report bugs on GitHub
  • Discussions: Use GitHub Discussions for questions
  • Community: Join our Discord server

Roadmap

  • [ ] Support for more AI providers
  • [ ] Advanced code analysis features
  • [ ] Team collaboration features
  • [ ] Plugin system for custom integrations
  • [ ] Mobile app support
  • [ ] Advanced debugging tools

Built with Node.js, Express, VS Code Extension API, and modern web technologies.