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

@wbytts/one

v0.0.3

Published

Command-line version of Cline AI coding assistant

Readme

Cline CLI - 命令行版本的 AI 编程助手

基于 Cline VSCode 插件 的核心逻辑,提供命令行版本的 AI 编程助手。

功能特性

  • 🤖 多模型支持: 支持 Anthropic、OpenAI、DeepSeek 等 20+ 种 AI 模型
  • 💻 交互式对话: 类似 ChatGPT 的交互体验
  • 🛠️ 强大工具系统: 文件操作、命令执行、代码搜索等
  • 轻量级: 无需 VSCode,启动快速
  • 🔧 灵活配置: 支持多种配置方式
  • 👀 文件监听: 自动检测文件变化并处理

安装

npm install -g cline-cli

或者本地开发:

git clone <此仓库>
cd cline-cli
npm install
npm run build

快速开始

1. 配置 API

# Anthropic Claude (推荐)
cline config set --provider anthropic --api-key sk-xxx --model claude-3-5-sonnet-20241022

# DeepSeek (中文优化)
cline config set --provider deepseek --api-key sk-xxx --model deepseek-chat

# OpenAI GPT
cline config set --provider openai --api-key sk-xxx --model gpt-4

2. 启动交互模式

cline chat

3. 执行单个任务

cline task "创建一个 React 组件"
cline task "重构这个函数" --files src/utils.js

使用指南

配置管理

# 查看当前配置
cline config list

# 设置工作目录
cline config set --directory /path/to/project

# 启用自动批准模式
cline config set --auto-approve

# 重置配置
cline config reset

交互模式

在交互模式下,你可以:

  • 直接与 AI 对话
  • 使用特殊命令:
    • exitquit - 退出
    • clear - 清空对话历史

任务执行模式

# 基本任务
cline task "创建一个新的 Express 服务器"

# 指定相关文件
cline task "优化这个算法" --files src/algorithm.js --files test/algorithm.test.js

# 在指定目录工作
cline task "初始化 React 项目" --directory ./my-app

# 自动批准所有操作
cline task "运行测试并修复错误" --auto-approve

文件监听模式

# 监听所有文件
cline watch

# 监听特定模式
cline watch --pattern "src/**/*.js"

# 在指定目录监听
cline watch --pattern "**/*.py" --directory ./python-project

可用工具

Cline CLI 提供以下工具来完成编程任务:

文件操作

  • read_file - 读取文件内容
  • write_to_file - 写入文件
  • list_files - 列出目录内容
  • search_files - 搜索文件内容

系统操作

  • execute_command - 执行 shell 命令

配置文件

配置文件位于 ~/.clinerc.json,支持以下配置:

{
  "apiProvider": "anthropic",
  "apiKey": "your-api-key",
  "model": "claude-3-5-sonnet-20241022",
  "workingDirectory": ".",
  "autoApprove": false,
  "customInstructions": "始终使用中文回复,优先使用 TypeScript",
  "tools": {
    "executeCommand": {
      "enabled": true,
      "autoApprove": ["npm install", "git status"],
      "timeout": 30000
    },
    "fileOperations": {
      "enabled": true,
      "watchPatterns": ["src/**/*", "*.json"],
      "excludePatterns": ["node_modules/**", ".git/**"]
    }
  },
  "security": {
    "allowFileDelete": false,
    "allowSystemCommands": true,
    "restrictedCommands": ["rm -rf", "sudo"]
  }
}

支持的 AI 模型

Anthropic Claude

cline config set --provider anthropic --model claude-3-5-sonnet-20241022

OpenAI GPT

cline config set --provider openai --model gpt-4
cline config set --provider openai --model gpt-3.5-turbo

DeepSeek (中文优化)

cline config set --provider deepseek --model deepseek-chat
cline config set --provider deepseek --model deepseek-coder

其他模型

  • OpenRouter (多模型聚合)
  • Google Gemini
  • Mistral AI
  • Ollama (本地模型)
  • LM Studio

示例场景

1. 代码重构

cline task "重构这个 React 组件,使其更简洁" --files src/components/UserProfile.jsx

2. 错误修复

cline task "修复测试失败的问题" --files test/api.test.js src/api.js

3. 新功能开发

cline task "添加用户认证功能,包括登录和注册"

4. 代码审查

cline task "审查这个 PR 的代码" --files src/new-feature.js

开发

项目结构

cline-cli/
├── src/
│   ├── core/
│   │   └── ClineCLI.ts          # 核心逻辑类
│   ├── config/
│   │   └── ConfigManager.ts     # 配置管理
│   ├── types/
│   │   └── Config.ts            # 类型定义
│   └── cli.ts                   # 命令行入口
├── package.json
└── README.md

本地开发

# 安装依赖
npm install

# 开发模式运行
npm run dev

# 构建
npm run build

# 运行测试
npm test

与 Cline VSCode 插件的区别

| 特性 | Cline VSCode | Cline CLI | |------|-------------|-----------| | 环境依赖 | VSCode | 任何终端 | | 用户界面 | 图形界面 | 命令行 | | 文件编辑 | VSCode 编辑器 | 直接文件操作 | | 浏览器控制 | 支持 | 不支持 | | 资源占用 | 较高 | 较低 | | 自动化 | 有限 | 完全支持 |

贡献

欢迎提交 Issue 和 Pull Request!

许可证

Apache-2.0

致谢

基于 ClineCline Chinese 项目开发。