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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ai-code-agent

v1.0.0

Published

A multi-provider CLI tool for AI-powered code generation with support for OpenAI, Anthropic, DeepSeek, Grok, and Kimi

Readme

AI Code Agent

A powerful CLI tool for AI-powered code generation and file management. Similar to Claude Code and Codex, this tool allows you to interact with multiple AI providers to generate code and automatically create files.

Features

  • Multi-Provider Support: OpenAI, Anthropic Claude, DeepSeek, Grok (xAI), Kimi (Moonshot)
  • Interactive chat interface with AI
  • Automatic file creation and code writing
  • Persistent conversation history
  • Global configuration management
  • Easy provider switching
  • Token/API key management

Installation

From npm (once published)

npm install -g ai-code-agent

Local Development

# Clone the repository
git clone <your-repo-url>
cd code-agents

# Install dependencies
npm install

# Link the package globally
npm link

Quick Start

1. Configure an AI Provider

Interactive setup (recommended):

ai-agent config set

Direct setup:

# OpenAI
ai-agent config set-token openai sk-your-api-key

# Anthropic Claude
ai-agent config set-token anthropic sk-ant-your-api-key

# DeepSeek
ai-agent config set-token deepseek your-api-key

# Grok (xAI)
ai-agent config set-token grok your-api-key

# Kimi (Moonshot)
ai-agent config set-token kimi your-api-key

2. Set Default Provider (Optional)

ai-agent config default openai

3. Start Chatting

ai-agent

Configuration Commands

View All Supported Providers

ai-agent config providers

List Configured Providers

ai-agent config list

Set API Key with Custom Model

ai-agent config set-token openai sk-your-key --model gpt-4
ai-agent config set-token anthropic sk-ant-key --model claude-3-opus-20240229

Remove Provider Configuration

ai-agent config remove openai

Use Specific Provider for a Session

ai-agent chat --provider anthropic
ai-agent --provider deepseek

Usage Examples

Start Interactive Chat

ai-agent

Creating a file:

You: Create a React component for a login form
AI: I'll create a React component for you...
Create file "LoginForm.jsx"? Yes
✓ File created: LoginForm.jsx

General questions:

You: How do I use async/await in JavaScript?
AI: Async/await is a modern way to handle asynchronous operations...

Exit:

You: exit

Switch Providers Mid-Session

# Use Anthropic Claude
ai-agent --provider anthropic

# Use DeepSeek
ai-agent --provider deepseek

Supported AI Providers

| Provider | ID | Models | |----------|----|--------------------| | OpenAI | openai | gpt-4-turbo-preview, gpt-4, gpt-3.5-turbo | | Anthropic Claude | anthropic | claude-3-5-sonnet-20241022, claude-3-opus-20240229, claude-3-sonnet-20240229 | | DeepSeek | deepseek | deepseek-chat, deepseek-coder | | Grok (xAI) | grok | grok-beta | | Kimi (Moonshot) | kimi | moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k |

Project Structure

code-agents/
├── bin/
│   └── cli.js                    # CLI entry point
├── src/
│   ├── api/
│   │   ├── providers/
│   │   │   ├── openai.js        # OpenAI provider
│   │   │   ├── anthropic.js     # Anthropic provider
│   │   │   ├── deepseek.js      # DeepSeek provider
│   │   │   ├── grok.js          # Grok provider
│   │   │   └── kimi.js          # Kimi provider
│   │   └── providerFactory.js   # Provider factory
│   ├── commands/
│   │   └── config.js            # Config commands
│   ├── utils/
│   │   ├── config.js            # Configuration management
│   │   └── fileManager.js       # File operations
│   └── index.js                 # Main application logic
├── package.json
└── README.md

Configuration

The tool stores configuration in ~/.ai-code-agent/config.json:

{
  "defaultProvider": "openai",
  "providers": {
    "openai": {
      "apiKey": "sk-your-openai-key",
      "model": "gpt-4-turbo-preview"
    },
    "anthropic": {
      "apiKey": "sk-ant-your-anthropic-key",
      "model": null
    },
    "deepseek": {
      "apiKey": "your-deepseek-key",
      "model": "deepseek-coder"
    }
  },
  "maxTokens": 2000,
  "temperature": 0.7
}

Requirements

  • Node.js 18 or higher
  • API key for at least one supported AI provider

Development

# Install dependencies
npm install

# Run locally
npm start

# Test the CLI
node bin/cli.js

How It Works

  1. Interactive Prompt: The tool opens an input prompt when you run the command
  2. AI Processing: Your prompt is sent to your configured AI provider
  3. Smart Response: The AI analyzes your request and determines if it needs to create a file
  4. File Creation: If code generation is needed, you'll be prompted to confirm file creation
  5. Automatic Writing: The code is automatically written to the specified file

Getting API Keys

  • OpenAI: https://platform.openai.com/api-keys
  • Anthropic: https://console.anthropic.com/
  • DeepSeek: https://platform.deepseek.com/
  • Grok (xAI): https://x.ai/api
  • Kimi (Moonshot): https://platform.moonshot.cn/

Publishing to npm

# Login to npm
npm login

# Publish the package
npm publish

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.