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

@gluttons/agent

v1.0.6

Published

Gluttons AI Agent — CLI tool with tool calling, workflow automation, Obsidian memory, and self-evolution

Readme

Gluttons Agent

CLI + Web AI Agent,支持工具调用、工作流编排、Obsidian 长期记忆和自主学习。

安装

npm install -g @gluttons/agent

快速开始

gluttons-agent init         # 配置 API Key(首次运行)
gluttons-agent chat         # 终端对话
gluttons-agent serve        # 启动 Web 服务 → http://localhost:3000
gluttons-agent run "..."         # 单次执行
gluttons-agent convert README.md # Markdown → HTML/PDF

CLI 命令

| 命令 | 说明 | | ------------------------------------- | ---------------------- | | gluttons-agent chat | 交互式对话 | | gluttons-agent run <prompt> | 单次执行 | | gluttons-agent serve | Web 服务(浏览器访问) | | gluttons-agent init | 初始化配置 | | gluttons-agent convert <file> | Markdown → HTML/PDF | | gluttons-agent workflow <file> | 运行工作流 JSON |

对话内命令

| 命令 | 说明 | | ------------------------------- | ------------ | | /model <name> [t] [url] [key] | 切换模型 | | /sessions | 列出历史会话 | | /load <id> | 加载会话 | | /rename <id> <title> | 重命名 | | /delete <id> | 删除 | | /new / /reset | 重置对话 | | /exit | 退出 |

功能

内置工具

| 工具 | 功能 | | -------------------------- | --------------------------------- | | read_file / write_file | 读写文件 | | bash | 执行 Shell(自动降级 PowerShell) | | web_fetch | HTTP 请求 | | browser_test | Playwright 浏览器操作 | | vision | OCR 图片文字识别 | | delegate | 派生子 Agent 并行执行 | | plan | 任务规划与逐步执行 | | configure | 切换模型和参数 | | markdown_to_html | Markdown → HTML / PDF |

Obsidian 工具

| 工具 | 功能 | | ----------------------------------- | ------------------ | | obsidian_search / obsidian_read | 语义搜索/读取知识库(向量 + 关键词混合检索) | | obsidian_write | 写入笔记(自动同步到向量索引) | | obsidian_recent | 最近笔记 | | learning | 反思总结、知识聚合 |

RAG 向量搜索

obsidian_search 使用本地 embedding 模型(all-MiniLM-L6-v2,384 维)对 Obsidian 笔记做语义检索,不再依赖精确关键词匹配。搜索策略为混合检索:向量语义搜索 + 关键词精确匹配并行执行,取并集后去重排序。

  • 搜"用户认证" → 命中"JWT 登录"、"权限管理"等语义相关笔记
  • 搜"洋洋" → 命中包含"儿子: 洋洋"的用户信息文档
  • 首次使用自动在后台构建向量索引,obsidian_write 写入后实时增量索引
  • 手动重建索引:让 Agent 执行 obsidian_search 并指定 action: rebuild_index
  • 向量模型离线工作,首次自动下载 ~80MB(国内用户配 HF_MIRROR 加速)

Markdown 转换

三种使用方式:

1. CLI 命令(最快,~200ms,零 token)

gluttons-agent convert README.md                    # HTML
gluttons-agent convert README.md --mode pdf --theme dark  # PDF 暗色
gluttons-agent convert README.md --mode full --theme dark --no-highlight

2. Web API(POST /api/convert

fetch('/api/convert', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ markdown: '...', outputMode: 'pdf', theme: 'dark' }),
});

3. Agent 对话

直接告诉 Agent:「把 README 转成 PDF,暗色主题」


输出模式:

| 模式 | 说明 | |------|------| | fragment | HTML 片段 | | full | 完整 HTML 文档,light/dark 主题可选 | | pdf | A4 PDF 导出(需 Playwright) |

支持 190+ 语言代码高亮、GFM 表格/任务列表、本地图片自动转 base64 嵌入,结果直接写文件不消耗 token。

工作流引擎

  • 步骤类型:agent / conditional / parallel / loop / delegate
  • 定时任务:cron + 简单间隔 5m / 1h
  • 错误策略:retry / skip / abort / fallback

配置

编辑 .env 文件(首次运行 gluttons-agent init 自动创建):

# 必填
LLM_API_KEY=sk-your-key-here

# 可选
LLM_MODEL=deepseek-v4-pro          # 默认模型
LLM_BASE_URL=https://api.deepseek.com/v1
AGENT_TEMPERATURE=0.7

# 长期记忆(可选)
OBSIDIAN_VAULT_PATH=C:/GT/Obsidian/Workbench
OBSIDIAN_REST_URL=http://localhost:27124

# RAG 向量搜索(可选)
HF_MIRROR=https://hf-mirror.com    # 国内用户设置 HuggingFace 镜像
# VECTOR_DB_PATH=                  # 向量数据库路径,默认 ~/.gluttons-agent/lancedb

铁律

行为规则在 RULES.md,编辑后重启生效。

架构

gluttons-agent chat  ──→  CLI (TUI)
gluttons-agent serve ──→  NestJS + Vue 3 (Web)
                              ↓
                        Agent Core (纯 TS)
                              ↓
                        LLM API (Deepseek 等)
                              ↓
                        Obsidian Vault (长期记忆)

开发

git clone <repo>
cd gluttons-agent
npm install
cd server && npm install && cd ..
cd client && npm install && cd ..

npm run dev          # 同时启动前后端开发服务
npm run cli          # 命令行模式

License

MIT