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

easycrm-cli

v0.1.21

Published

easycrm/CPPService 进销存命令行工具(三层命令 + AI Skills),安装即用,无需 Go 环境

Downloads

1,967

Readme

easycrm-cli

easycrm-cli 是一个面向 easycrm/CPPService 的进销存命令行工具,提供三层命令:

  • 原始接口层:api <Action>
  • 业务域 action 层:<domain> <Action> --params
  • AI / 人类友好的 shortcut 层:<domain> +<shortcut>

仓库同时内置 6 个 AI Skills,结构对齐 lark-cli skills 机制,Agent 无需额外编写提示词即可直接操作 easycrm。

AI Skills 安装

方式一:交互式安装脚本(推荐,可选安装目标)

运行后列出可选 Agent 工具,由你勾选装到哪些(跳过 PromptScript——它官方不支持全局安装):

# Windows PowerShell
powershell -ExecutionPolicy Bypass -File scripts\install-skills.ps1
# Linux / macOS
bash scripts/install-skills.sh

方式二:命令行指定目标

npx skills add skiyoumi/easycrm-cli -y -g --agent "claude-code" --agent "codex" --agent "opencode"

注意:skills 工具要求每个 --agent 单独传参(逗号/空格分隔会报 Invalid agents);不带 --agent 会尝试装到全部 76 个工具,其中 PromptScript 不支持全局安装会报错(可忽略,或显式指定目标避免)。

快速开始

方式一:npx(无需安装,推荐)

npx -y easycrm-cli version        # 验证可用
npx -y easycrm-cli config init    # 配置 BASE_URL/MAP_KEY
npx -y easycrm-cli auth login     # 登录(公司名/职员名或手机号/密码)
npx -y easycrm-cli api CPPHomeInfo

要求:Node.js ≥ 16(npm 自带)。npx 每次拉取最新版,无全局安装负担。

方式二:npm 全局安装

npm i -g easycrm-cli
easycrm config init
easycrm auth login

已知限制:npm 11 全局安装可能跳过 optionalDependencies 的平台包(报"未找到平台二进制"),此时改用 npx 或项目级安装即可。

方式三:项目级安装

npm i easycrm-cli    # 在项目目录内
npx easycrm-cli version

要求:Go 1.23+(如使用 mise,可先 export PATH=/root/.local/share/mise/installs/go/1.23.12/bin:$PATH

make build
./bin/easycrm config init
./bin/easycrm auth login
./bin/easycrm api CPPHomeInfo

说明:

  • config init 会依次提示输入 BASE_URLMAP_KEYTelSnNumber
  • 如果要联调生产环境,请把 BASE_URL 填为 https://EZKDAPI.ezhisoft.com/
  • MAP_KEY 必须由用户提供,CLI 不会代填

三层命令

1. 原始接口层

适合调用任意已知 Action:

easycrm api CPPHomeInfo
easycrm api SalesRankingList --data '{"BeginDate":"2026-08-10","EndDate":"2026-08-10"}'

2. 业务域 action 层

适合使用已注册的业务接口与默认参数模板:

easycrm product GetPTypeList --params '{"FilterName":"牙线"}'
easycrm product GetProductsFromId --params '{"PTypeIDS":["1001"]}'
easycrm stock GetStockInfo --params '{"FilterNameOrCode":"牙线"}'
easycrm order GetOrderDetail --params '{"Number":"XS20260810001"}'
easycrm party GetWldzInfo --params '{"BTypeID":"1001"}'
easycrm report SalesRankingList --params '{"BeginDate":"2026-08-10","EndDate":"2026-08-10"}'
easycrm report GetBossTableList --params '{"BeginDate":"2026-08-10","EndDate":"2026-08-10"}'

3. shortcut 层

适合日常查询与 Agent 快速操作:

easycrm product +search 牙线
easycrm product +detail 1001
easycrm stock +query 牙线
easycrm report +daily-summary
easycrm report +sales-ranking

命令速查

| 场景 | 命令 | |---|---| | 初始化配置 | easycrm config init | | 登录 | easycrm auth login | | 查看登录状态 | easycrm auth status | | 退出登录 | easycrm auth logout | | 首页汇总 | easycrm api CPPHomeInfoeasycrm report +daily-summary | | 商品搜索 | easycrm product +search <关键字> | | 商品详情 | easycrm product +detail <id> | | 库存查询 | easycrm stock +query <关键字> | | 订单详情 | easycrm order GetOrderDetail --params '{"Number":"..."}' | | 往来对账 | easycrm party GetWldzInfo --params '{...}' | | 销售排行 | easycrm report +sales-ranking | | 老板报表 | easycrm report GetBossTableList --params '{...}' |

Skills 安装

仓库随附 6 个 skills,位于 skills/

优先安装方式:

npx skills add skiyoumi/easycrm-cli -y -g

如果本机没有该命令,按你的 Agent 工具规范处理,常见做法是:

  • 直接复制 skills/ 到项目的 .claude/skills
  • 或按对应工具的 skills 安装机制指向本仓库目录

输出格式与错误信封

全局选项:

  • --json
  • --format json|pretty|table|ndjson|csv
  • --config <PATH>
  • --dry-run

规则:

  • api 与业务域命令成功时输出业务数据本体
  • config/auth--json 下成功时输出 { "ok": true, "data": ... }
  • 所有 JSON 错误都写到 stderr,格式为 {"ok":false,"error":"..."},退出码非 0
  • table 输出会把单元格截断到 40 个字符;做机器处理请改用 jsoncsvndjson
  • --dry-run 只预览业务域命令即将发送的 ActionBody,不会请求服务端

安全

  • MAP_KEY 等价于业务数据访问凭证,泄露后可直接访问接口,必须单独保管。
  • 配置与登录凭据默认存放在 ~/.easycrm/,文件权限为 0600
  • ~/.easycrm/MAP_KEY、导出的 JSON 响应都不应提交到 git。
  • auth logout 会删除本机保存的登录凭据。

已知限制

  • 服务端测试环境偶发状态异常;排障时优先确认服务端是否可用。
  • GetOrderDetailGetWldzInfoSalesRankingListGetBossTableList 的部分参数 schema 尚未逐项核实,复杂场景建议先从 App 或后端文档确认,再用 api 或业务域 action 透传。

发布形态

  • GitHub 仓库:skiyoumi/easycrm-cli
  • 二进制分发:通过 make buildmake install 构建,本项目不发布 npm 包
  • Skills 分发:随仓库 skills/ 目录发布,并通过 npx skills add 或本地复制方式安装

make install 会把可执行文件安装到 ~/.local/bin/easycrm。请确保 PATH 包含 ~/.local/bin