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

@viso/code-cli

v0.0.7

Published

AI-powered code analysis and development CLI tool

Downloads

14

Readme

@viso/code-cli

English | 中文

AI-powered code analysis and development CLI tool.

🚀 Features

  • Interactive Chat: Natural language conversation with AI
  • Code Analysis: Intelligent code review and suggestions
  • Multi-Provider Support: Works with various AI providers
  • Project Integration: Seamless integration with your codebase
  • Cross-Platform: Works on Windows, macOS, and Linux
  • Configuration Management: Flexible configuration system

📦 Installation

Global Installation

npm install -g @viso/code-cli

Local Installation

npm install @viso/code-cli
npx code-cli --help

🔧 Usage

Initialize Project

code-cli init

This will create a .code-ai/config.json file in your project.

Interactive Chat

code-cli chat

Start an interactive conversation with the AI assistant.

Ask Questions

code-cli ask "How do I optimize this function?"
code-cli ask "What's wrong with my TypeScript code?"

Configuration

# Set configuration
code-cli config set provider silicon-flow
code-cli config set apiKey your-api-key

# Get configuration
code-cli config get provider
code-cli config list

Provider Management

# List available providers
code-cli providers list

# Set active provider
code-cli providers set silicon-flow

# Test provider connection
code-cli providers test

System Status

code-cli status

Check system status and configuration.

Tools

# List available tools
code-cli tools list

# Get tool information
code-cli tools info shell

🏗️ Commands

Core Commands

init

Initialize a new Code AI project.

code-cli init [options]

Options:

  • --template <template>: Use a specific template (development, production, custom)
  • --provider <provider>: Set default provider
  • --force: Overwrite existing configuration

chat

Start interactive chat mode.

code-cli chat [options]

Options:

  • --provider <provider>: Use specific provider
  • --context <path>: Add context from file or directory
  • --memory: Enable conversation memory

ask

Ask a single question.

code-cli ask <question> [options]

Options:

  • --provider <provider>: Use specific provider
  • --context <path>: Add context from file or directory
  • --output <format>: Output format (text, json, markdown)

config

Manage configuration.

code-cli config <command> [options]

Commands:

  • set <key> <value>: Set configuration value
  • get <key>: Get configuration value
  • list: List all configuration
  • reset: Reset to default configuration

Advanced Commands

providers

Manage AI providers.

code-cli providers <command> [options]

Commands:

  • list: List available providers
  • set <provider>: Set active provider
  • test [provider]: Test provider connection
  • login <provider>: Login to provider

tools

Manage tools.

code-cli tools <command> [options]

Commands:

  • list: List available tools
  • info <tool>: Get tool information
  • enable <tool>: Enable tool
  • disable <tool>: Disable tool

status

Show system status.

code-cli status [options]

Options:

  • --detailed: Show detailed status
  • --json: Output in JSON format

⚙️ Configuration

Configuration File

The configuration file is located at .code-ai/config.json:

{
  "version": "1.0.0",
  "provider": {
    "name": "silicon-flow",
    "config": {
      "apiKey": "your-api-key",
      "model": "deepseek-chat",
      "baseUrl": "https://api.siliconflow.cn"
    }
  },
  "tools": {
    "enabled": ["shell", "file", "search"],
    "shell": {
      "timeout": 30000
    }
  },
  "memory": {
    "enabled": true,
    "path": "./memory"
  }
}

Environment Variables

# Global configuration
CODE_AI_CONFIG_PATH=~/.code-ai/global-config.json

# Provider configuration
SILICON_FLOW_API_KEY=your-api-key
SILICON_FLOW_BASE_URL=https://api.siliconflow.cn

# CLI configuration
CODE_AI_DEBUG=true
CODE_AI_VERBOSE=true

Templates

Development Template

{
  "provider": {
    "name": "silicon-flow",
    "config": {
      "model": "deepseek-chat",
      "temperature": 0.7
    }
  },
  "tools": {
    "enabled": ["shell", "file", "search", "git"]
  }
}

Production Template

{
  "provider": {
    "name": "silicon-flow",
    "config": {
      "model": "deepseek-chat",
      "temperature": 0.3
    }
  },
  "tools": {
    "enabled": ["file", "search"]
  }
}

🧪 Examples

Basic Usage

# Initialize project
code-cli init --template development

# Ask a question
code-cli ask "Review this TypeScript function"

# Interactive chat
code-cli chat --context src/

Advanced Usage

# Use specific provider
code-cli ask "Optimize this code" --provider silicon-flow

# Output in JSON format
code-cli ask "Analyze this file" --output json

# Set configuration
code-cli config set provider.config.temperature 0.5

🔧 Development

Building from Source

git clone https://github.com/Lingann/code-cli.git
cd code-cli
npm install
npm run build

Running Tests

npm test                # Run all tests
npm run test:unit      # Run unit tests
npm run test:integration # Run integration tests

🔗 Related Packages

🤝 Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

📄 License

MIT License - see LICENSE for details.

🆘 Support