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

@ginni215/cli-tool

v1.0.2

Published

CLI tool for senior order service management

Readme

CLI Tool

一个用于管理和查询养老服务项的命令行工具,支持跨平台安装(Windows、Linux、macOS)。

✨ 特性

  • 🚀 快速启动 - 原生二进制文件,启动速度快
  • 🌍 跨平台 - 支持 Windows、Linux、macOS(x64 和 ARM64)
  • 📦 按需下载 - 自动根据平台安装对应的二进制文件
  • 🔒 无需 Node.js - 打包后的二进制文件独立运行

📥 安装

全局安装(推荐)

npm install -g @ginni215/cli-tool

安装完成后,直接使用 cli-tool 命令。

本地开发

npm install
npm link

使用

1. 认证管理

初始化认证

# 交互式输入 token
cli-tool auth init

# 通过参数直接提供 token
cli-tool auth init -t ad7063ba-4018-4e25-9e17-b5cb047783bd

显示当前认证信息

cli-tool auth show

2. 查询服务项

# 查询服务项列表
cli-tool senior.order svc_item

命令参考

cli-tool auth init

初始化认证凭证。

选项:

  • -t, --token <token> - 授权令牌

示例:

cli-tool auth init -t your-token-here

cli-tool auth show

显示当前保存的认证信息。

示例:

cli-tool auth show

cli-tool senior.order svc_item

查询养老服务项列表。

示例:

cli-tool senior.order svc_item

配置

配置文件存储在 ~/.cli-tool/config.json,包含:

  • token - API 认证令牌

API 端点

  • Base URL: https://itest.clife.net
  • 服务项列表: GET /v1/saas/senior/mall/serviceItem/list
    • Headers: authorization: <token>

🔧 开发

项目结构

cli-tool/
├── bin/
│   ├── cli-tool.js          # 启动脚本(shim),动态加载平台二进制
│   └── cli-tool-core.js     # 核心实现(用于构建二进制)
├── lib/
│   ├── commands/
│   │   ├── auth.js          # 认证命令实现
│   │   └── service-item.js  # 服务项查询命令
│   └── utils/
│       ├── api.js           # API 客户端
│       └── config.js        # 配置管理
├── packages/                # 平台特定的二进制包
│   ├── win32-x64/
│   ├── linux-x64/
│   ├── linux-arm64/
│   ├── darwin-x64/
│   └── darwin-arm64/
├── scripts/
│   └── build.js             # 构建脚本
└── package.json

构建二进制

构建当前平台

npm run build

构建所有平台

npm run build:all

构建完成后,二进制文件会生成在 packages/<platform>/bin/ 目录。

发布流程

  1. 构建所有平台的二进制

    npm run build:all
  2. 发布平台特定的包

    cd packages/win32-x64 && npm publish --access public
    cd packages/linux-x64 && npm publish --access public
    cd packages/linux-arm64 && npm publish --access public
    cd packages/darwin-x64 && npm publish --access public
    cd packages/darwin-arm64 && npm publish --access public
  3. 发布主包

    npm publish --access public

    ⚠️ 注意: 必须先发布所有平台包,再发布主包。

🏗️ 架构说明

本项目采用与 wecom-cli 类似的跨平台架构:

  • 主包 (@ginni215/cli-tool): 包含启动脚本,根据平台动态加载对应的二进制
  • 平台包 (@ginni215/cli-tool-win32-x64 等): 包含特定平台的编译后二进制文件
  • 构建工具 (Node.js SEA + esbuild): 将 Node.js 代码打包成独立可执行文件

详细架构文档请查看 ARCHITECTURE.md。

🌐 支持的平台

| 操作系统 | 架构 | 包名 | |---------|------|------| | Windows | x64 | @ginni215/cli-tool-win32-x64 | | Linux | x64 | @ginni215/cli-tool-linux-x64 | | Linux | ARM64 | @ginni215/cli-tool-linux-arm64 | | macOS | x64 (Intel) | @ginni215/cli-tool-darwin-x64 | | macOS | ARM64 (M1/M2/M3) | @ginni215/cli-tool-darwin-arm64 |

📦 依赖

  • commander - 命令行参数解析
  • axios - HTTP 客户端
  • chalk - 终端输出美化
  • esbuild - 将 ESM 源码打包成单文件(开发依赖)
  • postject - 向 Node.js 可执行文件注入 SEA blob(开发依赖)

📄 许可证

MIT