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

@liwanhe/ai-cli-tool

v1.4.1

Published

AI-powered CLI tool based on LangChain and ReAct pattern - 93 professional tools across 11 functional domains

Downloads

105

Readme

AI CLI 工具

Python Version License Code Style Version

基于 Python 和 LangChain 的 AI CLI 工具,使用 ReAct 模式实现智能操作。

最新版本 v1.3.1:修复关键Bug,功能完整度从27.9%提升到100%!查看升级指南

✨ 特性

  • 🤖 基于 LangChain ReAct Agent
  • 🎯 93 个专业工具,11 大功能领域
  • 🔌 MCP 集成(支持无限扩展)
  • 📊 性能监控系统
  • 🎨 丰富的交互命令
  • 🔒 安全的路径验证
  • 🔌 可扩展的插件架构
  • 性能优秀(工具增长 3000%,响应时间仅增加 30%)

🚀 功能概览

📁 文件系统 (24个工具)

  • 基础操作: 读取、写入、追加、列出目录
  • 文件管理: 删除、移动、复制、批量重命名
  • 文本处理: 统计、提取、合并、去重、排序
  • 高级功能: 搜索、替换、查找、比较、分析
  • 压缩解压: zip 格式支持

🔧 Git 版本控制 (8个工具)

  • 状态查看、文件暂存、提交更改
  • 历史查看、差异对比
  • 分支管理、分支切换

🌐 网络操作 (4个工具)

  • 文件下载、HTTP 请求
  • URL 检查、信息获取

🔍 代码分析 (6个工具)

  • 代码统计、TODO 查找
  • Import 提取、JSON 处理
  • 代码库分析(支持 10+ 种语言)

📊 数据处理 (7个工具)

  • CSV 读写、过滤、统计
  • CSV/JSON 互转、合并

⚙️ 环境配置 (7个工具)

  • 环境变量管理
  • YAML 配置处理
  • 项目类型检测

🖥️ 系统操作 (8个工具)

  • 命令执行、脚本运行
  • 进程管理、系统信息
  • 资源监控(CPU、内存、磁盘、网络)

📝 文本增强 (10个工具)

  • 批量搜索替换、模式提取
  • 大小写转换、命名风格转换
  • 空白处理、行号添加

🎨 模板系统 (8个工具)

  • 模板管理、代码生成
  • 类/函数/测试生成
  • README 生成

⏰ 自动化 (4个工具)

  • 文件监控、目录监控
  • 哈希计算、哈希验证

🔌 MCP 集成 (7个工具) ⭐ NEW

  • MCP 服务器管理
  • 工具搜索和调用
  • 连接测试、启用/禁用
  • 支持无限扩展: filesystem, github, brave-search, fetch, memory, postgres, sqlite, puppeteer 等

🎊 最新更新

v1.4.0 - MCP 集成版 🔌

新增功能:

  • ✅ MCP (Model Context Protocol) 集成
  • ✅ 7个 MCP 管理工具
  • ✅ 支持无限扩展 MCP 服务器
  • ✅ 工具总数:86 → 93 个

支持的 MCP 服务器:

  • filesystem, github, brave-search, fetch, memory
  • postgres, sqlite, puppeteer, sequential-thinking

MCP 集成指南 | 完整文档

v1.3.1 - 优化版 🚀

  • ✅ 修复关键Bug(功能完整度 27.9% → 100%)
  • ✅ 性能监控系统
  • ✅ 5个新交互命令

优化报告 | 升级指南

📚 文档

| 文档 | 说明 | |------|------| | COMPLETE_GUIDE.md | 📖 完整指南(安装、使用、配置、开发)⭐ | | VERSION.md | 📋 版本历史 | | CHANGELOG.md | 📝 更新日志 | | CONTRIBUTING.md | 🤝 贡献指南 |

🚀 快速开始

方法 1:使用快速启动脚本(推荐)

# 1. 安装依赖
pip install -r requirements.txt

# 2. 配置 API Key
# 编辑 .env 文件,填入你的 API Key

# 3. 运行快速启动脚本
python quick_start.py

快速启动脚本会自动:

  • ✅ 检查依赖是否安装
  • ✅ 验证配置文件
  • ✅ 创建演示文件
  • ✅ 显示使用提示
  • ✅ 启动主程序

方法 2:手动启动

# 1. 安装依赖
pip install -r requirements.txt

# 2. 配置环境变量
cp .env.example .env
# 编辑 .env 文件,填入你的 API Key

# 3. 验证配置
python validate_config.py

# 4. 运行程序
python main.py

详细安装说明请查看 INSTALL.md

使用示例

基础操作

你: 列出当前目录的文件
AI: 当前目录包含以下文件...

你: 读取 README.md 文件
AI: README.md 文件内容是...

你: 创建一个新文件 test.txt,内容是 Hello World
AI: 文件创建成功...

高级操作

你: 在 config.py 中搜索 "API_KEY"
AI: 找到 3 处匹配...

你: 复制 important.txt 为 backup.txt
AI: 文件复制成功...

你: 查看 data.json 的文件信息
AI: 文件大小: 1.5 KB, 修改时间: 2024-12-01...

查看 TOOLS_REFERENCE.md 了解所有 11 个工具的详细说明。

项目结构

.
├── core/                    # 核心模块
│   ├── context.py          # 全局上下文
│   └── plugin_interface.py # 插件接口
├── plugins/                 # 插件模块
│   └── file_system.py      # 文件系统插件
├── config.py               # 配置管理
├── main.py                 # 主程序
├── .env.example            # 环境变量示例
└── requirements.txt        # 依赖列表

开发

添加新插件

  1. plugins/ 目录创建新的插件文件
  2. 继承 AIPlugin 基类
  3. 实现 get_tools() 方法
  4. main.py 中加载插件

示例:

from core.plugin_interface import AIPlugin
from langchain.tools import tool

class MyPlugin(AIPlugin):
    def get_tools(self):
        return [self.my_tool]
    
    @tool
    def my_tool(self, param: str) -> str:
        """工具描述"""
        return "结果"

运行测试

pytest

配置说明

所有配置项都在 .env 文件中:

  • API_KEY: OpenAI API 密钥(必需)
  • BASE_URL: API 基础 URL(可选,用于 API 中转)
  • MODEL_NAME: 模型名称(默认 gpt-4)
  • TEMPERATURE: 温度参数(0-2,建议 0)
  • WORK_DIR: 工作目录(默认 ./workspace)
  • MAX_ITERATIONS: 最大迭代次数(默认 15)

安全性

  • 所有文件操作限制在工作目录内
  • 文件大小限制为 10MB
  • 禁止父目录遍历(..
  • API Key 在日志中自动脱敏

📚 文档

Steering 规则

.kiro/steering/ 目录下有 8 个详细的指导文档:

  • product.md - 产品概述
  • tech.md - 技术栈
  • structure.md - 项目结构
  • config.md - 配置管理
  • security.md - 安全规范
  • prompts.md - Prompt 工程
  • plugins.md - 插件开发
  • development.md - 开发规范

🤝 贡献

欢迎贡献!请查看 CONTRIBUTING.md 了解如何参与项目。

📝 许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。

🙏 致谢

📞 支持

如有问题或建议:

  1. 查看文档和 FAQ
  2. 检查 app.log 日志文件
  3. 在 GitHub Issues 中提问

开发状态: ✅ 可用
版本: 0.1.0
最后更新: 2024-12-01