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

sanplex-cli

v0.4.3

Published

Sanplex命令行工具,支持在你喜爱的终端里访问和操作Sanplex数据,对 AI Agents 友好。

Readme

Sanplex CLI

npm Node.js License

简体中文 | English

Sanplex命令行工具,支持在你喜爱的终端里访问和操作Sanplex数据,对 AI Agents 友好。

主要特性

  • 基于Sanplex RESTful API 2.0,覆盖 40 多个模块、300 多个 API 操作,调用前按Sanplex版本检查接口兼容性
  • 可通过 npx sanplex-cli 免安装运行
  • 通过浏览器登录,只保存 Token、不保存密码,支持多账号切换
  • 支持对数据进行摘取、过滤、排序,并自动将 HTML 转换为 Markdown
  • 对 AI Agents 友好:帮助信息完善,支持 Markdown 与 JSON 输出
  • 通过 sanplex add-skill 一键安装技能到 AI Agent
  • 提供本地 stdio 与远程 HTTP MCP 服务,多个客户端可使用各自的Sanplex Token

环境要求

  • Node.js 18 或更高版本
  • Sanplex开源版 22.0、企业版 biz13.0、旗舰版 max8.0 或 IPD 版 ipd5.0 及以上

部分操作要求更高的Sanplex版本,CLI 会在发送请求前检查并提示。详见 API 覆盖与版本兼容。

快速开始

# 全局安装
npm install -g sanplex-cli

# 也可以使用 bun 安装,或免安装运行
# bun install -g sanplex-cli
# npx sanplex-cli
# pnpm dlx sanplex-cli

# 登录:自动打开浏览器,输入Sanplex地址、用户名和密码
sanplex login

# 查看产品列表
sanplex product

没有图形界面的终端可使用 sanplex login --no-browser 交互登录。环境变量登录、多账号切换和退出登录见 用户验证。

常用命令

命令格式为 sanplex <模块名> [操作] [参数]。省略操作时查看列表,只传 ID 时查看详情。

产品

# 查看产品列表
sanplex product

# 查看产品详情
sanplex product 1

# 创建产品
sanplex product create --name=新产品

# 更新产品名称
sanplex product update 1 --name=产品新名称

# 删除产品
sanplex product delete 1

Bug

# 查看产品 #1 的 Bug 列表
sanplex bug --product=1

# 查看 Bug 详情
sanplex bug 329

# 解决 Bug
sanplex bug resolve 329 --resolution=fixed

需求与任务

# 查看产品 #1 的需求列表
sanplex story --product=1

# 在执行 #10 中创建任务
sanplex task create --name=实现登录功能 --executionID=10

筛选与输出格式

# 只显示指定字段
sanplex product --pick=id,name

# 按条件过滤
sanplex bug --product=1 --filter 'status=active'

# 模糊搜索
sanplex story --product=1 --search=登录 --search-fields=title

# 按字段排序
sanplex bug --product=1 --sort=id:desc

# JSON 格式输出,适合程序处理
sanplex product --format=json

查看帮助

# 查看所有命令
sanplex help

# 查看模块的可用操作与参数
sanplex bug --help

# 查看操作的参数和最低Sanplex版本
sanplex bug resolve --help

获取 Token

脚本或 MCP 配置需要 Token 时,可用 sanplex token 读取:

# 读取当前账号或指定账号已保存的 Token
sanplex token
sanplex token 'admin@https://sanplex.example.com'

# 临时获取新 Token,不保存到 CLI 配置
sanplex token --server https://sanplex.example.com --user admin --password '<password>'

默认只输出一行 Token。读取已保存的 Token 不会联网验证,也不会修改配置或切换账号。详见 获取 Token。

管道输入、批量操作、分页控制和配置管理等更多功能见 CLI 核心功能详解。

在 AI Agents 中使用

可以通过以下三种方式在 AI Agents 中使用Sanplex:

| 方式 | 适用场景 | 是否需要安装 CLI | | --- | --- | --- | | 技能(Skill) | 个人使用,Agent 在终端中调用 CLI | 需要 | | 本地 MCP | 个人使用,Agent 通过 MCP 工具调用 CLI | 需要 | | 远程 MCP | 公司统一部署,用户用个人 Token 接入 | 不需要 |

完整说明见 在 Agents 中使用Sanplex。

通过技能使用

# 一键安装、登录并安装技能(交互选择目标 Agent)
npm install -g sanplex-cli && sanplex login && sanplex add-skill

# 直接指定目标 Agent,all 表示全部安装
sanplex add-skill claude-code
sanplex add-skill all

# 将所有内置技能导出到指定目录
sanplex add-skill --output ./skills

支持 Claude Code、Cursor、Cherry Studio、Codex、OpenCode、VS Code、Antigravity 和 Gemini。安装后即可在 Agent 中用自然语言提问:

Sanplex中有哪些产品?

产品 xxx 有哪些研发中的需求?

需求 xxx 有哪些风险?

由 Agent 发起登录时,使用 sanplex login --web 并保持进程运行,等用户在浏览器中完成验证后再继续。在 CI 或容器中,可以注入环境凭据或挂载配置文件;Agent 可先执行 sanplex profile --effective --format=json 确认实际使用的账号,输出不包含 Token 或密码。详见 Agent、CI 与容器中的凭据。

通过本地 MCP 使用

# 一键安装、登录并配置本地 stdio MCP(交互选择目标 Agent)
npm install -g sanplex-cli && sanplex login && sanplex add-mcp

sanplex add-mcp 会复用当前账号的 Token,不会将Sanplex密码写入 Agent 配置。可在 MCP 配置的 args 中追加启动选项来限制开放范围:

# 只开放查询,并限定业务模块
sanplex mcp --read-only --modules product,story,task,bug

# 将每个模块拆分为查询和写入两个工具,方便客户端分别授权
sanplex mcp --split-tools --modules product,story,task,bug

生成的配置格式和全部启动选项见 MCP 服务。

通过远程 MCP 使用

sanplex mcp-server 适合由公司管理员统一部署。用户只需服务地址和自己的Sanplex Token,无需安装 sanplex-cli;Sanplex按各自账号的权限处理请求。

# 管理员在服务器上启动服务,固定连接一个Sanplex站点
sanplex mcp-server https://sanplex.example.com

启动后打开 http://127.0.0.1:9090/start,用户可在页面上获取个人 Token,并复制接入说明让 Agent 协助配置。管理员需通过 HTTPS 反向代理同时提供 /start 和 /mcp。

文档

| 文档 | 说明 | | --- | --- | | 交互式命令参考(HTML) | 浏览器直接打开,搜索命令与参数,按模块和操作类型筛选 | | 命令、参数与用法参考 | 全部内置命令、业务操作、参数类型、必填项、可选值和用法 | | CLI 核心功能详解 | 用户验证、数据访问与操作、数据处理、输出格式、配置管理等 | | 在 Agents 中使用Sanplex | 通过技能或 MCP 在 AI Agents 中使用Sanplex | | Sanplex MCP 服务部署指南 | 管理员统一部署远程 MCP 服务、配置 HTTPS 反向代理并向用户发布 | | 在 Agent 中接入Sanplex MCP 服务 | Sanplex用户获取个人 Token,并在 Agent 中配置远程 MCP | | 开发指引 | 技术栈、项目结构、测试与构建 | | 技术方案与实现细节 | 内部接口调用规则、验证机制与持久化配置 | | 常见错误排查与参考手册 | 错误代码(Exxxx)查阅 | | 后续计划 | 待实现的功能和改进计划 | | 更新日志 | 每个版本的变更内容 |

许可证

MIT