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

alou-ai

v0.3.24

Published

基于MCP和DeepSeek AI的智能文件操作CLI工具

Downloads

40

Readme

Alou AI - 智能文件操作助手

一个基于MCP(Model Context Protocol)和DeepSeek AI的智能文件操作CLI工具,专门优化用于抓取微信公众号文章、学术论文PDF和图片内容。

🚀 功能特性

  • 🤖 智能AI驱动: 使用DeepSeek AI模型理解并执行自然语言指令
  • 📱 微信公众号优化: 专门针对微信公众号文章抓取优化
  • 📄 学术论文支持: 支持ArXiv、IEEE、ACM等主流学术数据库
  • 🖼️ 图片批量提取: 智能提取网页中的图片并批量下载
  • 🔄 多轮工具调用: AI可以连续调用多个工具完成任务
  • 自主执行: AI无需用户确认即可调用工具,失败时自动重试
  • ⏱️ 超时保护: 每个工具调用有30秒超时限制
  • 📁 文件操作: 完整的文件系统操作支持
  • 🌐 网络请求: 智能网络内容抓取和处理
  • 💬 交互式界面: 提供友好的命令行交互界面
  • 🛠️ 错误恢复: 智能错误处理和重试机制

📦 安装

全局安装(推荐)

npm install -g alou-ai

本地安装

npm install alou-ai
# 创建 .env 文件(可选)
DEEPSEEK_API_KEY=your_deepseek_api_key_here
DEEPSEEK_API_ENDPOINT=https://api.deepseek.com/v1

🎯 使用方法

启动交互式聊天

alou chat
# 或者
alou

执行单个命令

alou execute "列出当前目录的文件"

查看可用工具

alou tools

初始化智能体

alou init

🎯 专业功能

微信公众号文章抓取

alou chat
✔ 你: 抓取这个微信公众号文章:https://mp.weixin.qq.com/s/xxx

学术论文抓取

✔ 你: 抓取这篇ArXiv论文:https://arxiv.org/abs/xxx

批量内容处理

✔ 你: 批量抓取这些URL的文章内容

图片批量提取

✔ 你: 从这个网页提取所有图片并下载

💡 使用示例

微信公众号文章抓取

✔ 你: 抓取这个微信公众号文章:https://mp.weixin.qq.com/s/xxx
🤖 助手: 我来抓取这篇微信公众号文章...

工具执行结果:
✅ fetch-txt: 成功获取文章内容
✅ write_file: 文章已保存为 markdown 格式

任务完成!已成功抓取微信公众号文章并保存。

学术论文抓取

✔ 你: 抓取这篇ArXiv论文:https://arxiv.org/abs/2301.00001
🤖 助手: 我来抓取这篇学术论文...

工具执行结果:
✅ fetch-txt: 成功获取论文信息
✅ 提取元数据: 标题、作者、摘要、关键词
✅ 识别PDF链接: https://arxiv.org/pdf/2301.00001.pdf

任务完成!已成功抓取论文信息和PDF链接。

批量内容处理

✔ 你: 批量抓取这些URL的文章内容
🤖 助手: 我来批量处理这些URL...

工具执行结果:
✅ 处理URL 1/3: 成功
✅ 处理URL 2/3: 成功  
✅ 处理URL 3/3: 成功

批量处理完成!共处理3个URL,全部成功。

图片批量提取

✔ 你: 从这个网页提取所有图片并下载
🤖 助手: 我来提取网页中的图片...

工具执行结果:
✅ fetch-html: 成功获取网页内容
✅ 识别图片: 发现15张图片
✅ 下载图片: 成功下载12张图片
✅ 生成清单: 图片清单已保存

任务完成!已成功提取并下载12张图片。

🏗️ 项目结构

src/
├── index.ts              # 主入口文件
├── cli.ts                # 命令行界面层
├── agent.ts              # 智能体业务逻辑层
├── deepseek-client.ts    # DeepSeek AI通信层
├── tool-registry.ts      # 工具注册表管理
├── mcp-client.ts         # MCP协议通信层
├── types.ts              # 类型定义
└── config/               # 配置文件
    ├── config.ts         # 主配置
    ├── env-config.ts     # 环境变量配置
    └── mcp-config.ts     # MCP服务器配置

🛠️ 开发

构建项目

npm run build

运行开发模式

npm run dev chat          # 启动交互式聊天
npm run dev execute "命令" # 执行单个命令
npm run dev tools         # 查看可用工具

测试功能

npx tsx test-enhanced-client.ts  # 测试增强功能

清理构建文件

npm run clean

📦 依赖

核心依赖

  • @modelcontextprotocol/sdk: MCP协议SDK
  • openai: OpenAI API客户端(兼容DeepSeek)
  • commander: 命令行参数解析
  • inquirer: 交互式命令行界面
  • chalk: 终端颜色输出
  • ora: 加载动画

开发依赖

  • typescript: TypeScript编译器
  • tsx: TypeScript执行器
  • @types/node: Node.js类型定义

🎯 核心特性详解

多轮工具调用

AI可以连续调用多个工具完成复杂任务,例如:

  1. 先获取网页内容
  2. 再解析数据
  3. 最后保存到文件

自主执行机制

  • AI无需用户确认即可调用工具
  • 失败时自动分析原因并重试
  • 最多重试3次,每次间隔递增

超时保护

  • 每个工具调用限制30秒
  • 超时后自动中止并重试
  • 防止工具调用卡死

智能错误恢复

  • 工具失败时AI会分析原因
  • 尝试其他方法解决问题
  • 提供详细的错误信息和建议

🔧 智能Prompt功能

微信公众号文章提取器

  • 功能: 专门抓取微信公众号文章内容和图片
  • 特点: 自动使用fetch-txt工具,支持重试机制
  • 参数: URL、提取图片、保存格式、包含元数据

学术论文抓取器

  • 功能: 抓取学术论文PDF和相关信息
  • 支持: ArXiv、IEEE、ACM、Springer、Elsevier等
  • 参数: 论文URL、来源类型、提取元数据、下载PDF

批量内容处理器

  • 功能: 批量处理多个内容源
  • 支持: 公众号文章、学术论文、混合类型
  • 参数: URL列表、内容类型、输出目录、命名规则

图片提取器

  • 功能: 从网页中提取所有图片并下载
  • 特点: 支持类型过滤、尺寸过滤、批量下载
  • 参数: 网页URL、图片类型、最小尺寸、保存路径

🔧 故障排除

常见问题

Q: 程序无法启动 A: 确保已正确安装:

# 重新安装
npm uninstall -g alou-ai
npm install -g alou-ai

# 检查安装
alou --version

Q: 抓取微信公众号文章失败 A: 确保URL格式正确:

# 正确的URL格式
https://mp.weixin.qq.com/s/xxxxxxxxx

# 程序会自动重试,如果持续失败请检查网络连接

Q: 中文显示乱码 A: 程序已自动处理Windows控制台编码问题。如果仍有问题:

chcp 65001  # Windows控制台设置UTF-8编码

Q: 命令找不到 A: 确保npm全局目录在PATH中:

npm config get prefix
# 将输出路径添加到系统PATH环境变量

📄 许可证

MIT License


🎯 快速开始

  1. 安装: npm install -g alou-ai
  2. 启动: alou chat
  3. 使用: 直接告诉AI你想要做什么

示例:

✔ 你: 抓取这个微信公众号文章:https://mp.weixin.qq.com/s/xxx
✔ 你: 批量下载这些网页的图片
✔ 你: 抓取这篇ArXiv论文的信息

🎉 现在就开始使用这个专门优化的AI内容抓取助手吧!