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

@zhizai/cli

v0.0.10

Published

CLI tool for 智在记录 — manage notes and knowledge from the terminal and AI agents

Readme

智在记录 CLI

智在记录的命令行工具,让你在终端和 AI Agent 里直接管理笔记、笔记集、场景与团队。

查笔记、写总结、管知识库——一条命令搞定,支持脚本和 AI Agent 调用。

当前版本:v0.0.4
已可用:auth / doctor / capabilities / version / notes / note get / setup。
其余业务命令(note create / ask / team 等)子命令已挂载,能力逐步完善中。

参与开发、构建与发包请见 docs/development.md。


安装

推荐使用 npm 全局安装(会自动下载对应平台二进制):

npm install -g @zhizai/cli@latest

安装后可用命令:

  • zhizai — 主命令
  • zz — 短别名

验证:

zhizai version
zz version

也可从 GitHub Releases 下载对应平台压缩包,解压后将 zhizai / zhizai.exe 放到 PATH 中。


使用要求

  • 通过 zhizai auth login 完成网页授权登录
  • 限流:最高约 2 次/秒

开始使用

1. 登录

zhizai auth login

按提示在浏览器确认授权即可。登录成功后写入 ~/.zhizai/config.json。

刷新 OAuth access_token(业务请求也会在过期时自动刷新):

zhizai auth refresh

2. 检查状态

zhizai auth status
zhizai doctor
zhizai doctor -o json
zhizai capabilities -o json

doctor 返回 ready=true,status=ready 表示可正常调用业务接口。

3. 查看笔记

zhizai notes
zhizai notes --limit 10 -o json
zhizai notes --all
zhizai note get <id>
zhizai note get <id> --field summary

4. 接入本机 AI

CLI 首次安装请用 npm(见上文「安装」)。setup 负责同步 Skills 与授权,不会在 CLI 已可用时重复 npm 重装。

# 预览将执行的操作
zhizai setup --dry-run -o json

# 同步 Skill 并引导授权(CLI 已就绪时跳过重装)
zhizai setup

# 升级或修复 CLI 二进制(显式触发 npm 重装)
zhizai setup --force-cli-install

setup 会把原子 Skill 安装到 Cursor、Claude Code、Codex 等本机 AI 环境,并引导完成授权。


功能一览

已可用

| 命令 | 说明 | |------|------| | zhizai auth login | 网页设备授权登录 | | zhizai auth refresh | 刷新 OAuth access_token | | zhizai auth status | 查看认证状态(凭证掩码) | | zhizai auth logout | 清除本机凭证 | | zhizai doctor | 检查安装、登录与 API 连通性 | | zhizai capabilities | 查看当前版本的稳定能力契约 | | zhizai version | 显示版本 | | zhizai notes [--limit\|--page\|--all] | 笔记列表 | | zhizai note get <id> [--field ...] | 笔记详情 | | zhizai note create --title/--content | 创建文字笔记 | | zhizai note update <id> --title/--abstract/--summary | 更新笔记 | | zhizai note delete <id> --yes | 删除笔记 | | zhizai note status <id> | 笔记处理进度 | | zhizai knowledge list [--received] | 笔记集列表(我创建的 / 收到的) | | zhizai knowledge get <id> | 笔记集详情 | | zhizai knowledge notes <id> | 笔记集内笔记 | | zhizai setup [--dry-run] [--force-cli-install] | 同步原子 Skill 并引导授权;CLI 已就绪时跳过重装 |

规划中

| 命令 | 说明 | |------|------| | zhizai knowledge create | 新建笔记集(后端接口待开放) | | zhizai file upload | 文件上传(录音/文档等笔记类型依赖此项) | | zhizai ask "<问题>" | 基于笔记的动态模版问答 / 总结 | | zhizai scene | 场景与知识卡 | | zhizai team | 团队与成员 | | zhizai msg | 消息与录音卡 | | zhizai update | 升级 CLI 并同步 Skill |


全局参数

| 参数 | 说明 | |------|------| | -o, --output table\|json | 输出格式(默认 table) |

机器 / AI Agent 调用时请加 -o json,统一读取:

{
  "success": true,
  "data": {},
  "error": null
}

失败时 success=false,读取 error.code / error.message / error.reason / error.retryable。


配置

凭证保存在 ~/.zhizai/config.json(含 OAuth access_token / refresh_token 等字段)。

鉴权说明

默认使用 OAuth 设备授权:zhizai auth login → 浏览器确认 → 业务请求头 X-OAuth2-Access-Token: Bearer …。

无头 / 连接器场景使用 zhizai auth login --no-open:不打开系统浏览器,打印 [verify_url] / [device_code] / [expires_in] / [interval],后台继续轮询直至授权完成。

OAuth 过期时 CLI 会自动用 refresh_token 刷新;也可手动 zhizai auth refresh。

仅当网页授权失败时,CLI 会提示可改用 API Key 备用登录。


AI Agent 使用

所有命令支持 -o json。内置原子 Skill:

| Skill | 职责 | |-------|------| | zhizai-auth | 安装、登录、诊断、升级 | | zhizai-note | 笔记列表、详情、文字创建、更新、删除、进度 | | zhizai-knowledge | 笔记集 | | zhizai-scene | 场景与知识卡 | | zhizai-team | 团队与成员 | | zhizai-msg | 消息与录音卡 |

另保留聚合 Skill zhizai-open-platform(含完整 OpenAPI 参考文档)。

原则:Skill 只做意图路由,真实请求一律走 zhizai CLI,不自行拼 OpenAPI。


相关链接

License

MIT