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

@youdao/baoku-cli

v0.0.3

Published

Youdao Baoku CLI - knowledge base management and content generation

Readme

baoku-cli

有道宝库命令行工具 -- 知识库管理、内容生成(PPT/播客/脑图/信息图/文档翻译)、知识库问答。主要面向 AI Agent 调用,也可人工使用。

安装

npm install -g @youdao/baoku-cli

或从源码编译:

make build
sudo cp baoku /usr/local/bin/

快速开始

# 授权(浏览器登录)
baoku config init

# 一步生成 PPT
baoku generate ppt --file report.pdf

# 知识库问答
baoku chat --project-id <id> --message "核心观点是什么?"

命令一览

| 命令 | 说明 | |------|------| | baoku config init | 浏览器授权,或 --api-key 手动配置 | | baoku config show | 查看当前配置 | | baoku project create/list/get | 知识库管理 | | baoku source add/list/status/delete | 来源管理(文件/URL/文本) | | baoku generate ppt/podcast/mindmap/infographic/doctran | 内容生成 | | baoku generate options | 查看可用生成选项(模板、音色等) | | baoku task status | 查询生成任务状态 | | baoku chat | 知识库问答 |

输出格式:--format json(默认,Agent 友好)或 --format pretty(人类友好)。

详细文档:https://baoku.youdao.com/developer/#/docs/getting-started

开发

依赖: Go 1.22+

make build           # 编译
make test            # 单元测试
make integration-test # 集成测试
make test-all        # 全部测试

项目结构

cmd/           Cobra 命令(每个命令一个文件)
internal/
  client/      HTTP 客户端(认证注入、重试、错误分类)
  config/      配置管理(环境变量 → 密钥链 → 配置文件)
  output/      JSON Envelope 输出、结构化错误、Pretty 格式
scripts/       npm 分发与发布脚本
skills/        Agent Skill 文档

测试

集成测试使用 httptest.Server 模拟 Baoku API,通过 RunContext 注入 fake 依赖(stdout/stderr、sleep、clock、API client)。所有测试命令必须带 -timeout 30s,防止轮询循环挂起。

# 跑单个测试
go test ./cmd -run TestIntegration_source_add -v -timeout 30s

发布

1. 打 tag

git tag v0.1.0
git push origin v0.1.0

2. 构建跨平台二进制

# 需要安装 goreleaser: brew install goreleaser/tap/goreleaser
./scripts/release.sh

产物在 dist/ 目录,支持 darwin/linux/windows x amd64/arm64。

3. 发布到 npm

./scripts/publish.sh

自动完成:GoReleaser 编译 → 分平台 npm 包打包 → 发布 @youdao/baoku-cli 及 6 个平台包。

测试构建(不发布)

./scripts/publish.sh --snapshot