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

@xiaozhi-client/cli

v2.0.0

Published

小智客户端 CLI 包,提供命令行界面用于管理 MCP 服务和配置。

Readme

@xiaozhi-client/cli

小智客户端 CLI 包,提供命令行界面用于管理 MCP 服务和配置。

包说明

此包是 xiaozhi-client 项目的 CLI 入口点,作为独立 npm 包发布。它与 xiaozhi-client 主包共享相同的代码库和版本号。

目录结构

packages/cli/
├── src/
│   ├── index.ts              # 主入口
│   ├── Container.ts          # DI 容器
│   ├── Types.ts              # 类型定义
│   ├── Constants.ts          # 常量定义
│   ├── commands/             # 命令处理器
│   │   ├── index.ts
│   │   ├── CommandRegistry.ts
│   │   ├── CommandHandlerFactory.ts
│   │   ├── ConfigCommandHandler.ts
│   │   ├── EndpointCommandHandler.ts
│   │   ├── McpCommandHandler.ts
│   │   ├── ProjectCommandHandler.ts
│   │   └── ServiceCommandHandler.ts
│   ├── services/             # 服务管理器
│   │   ├── ProcessManager.ts
│   │   ├── DaemonManager.ts
│   │   ├── ServiceManager.ts
│   │   └── TemplateManager.ts
│   ├── utils/                # 工具类
│   ├── interfaces/           # 接口定义
│   └── errors/               # 错误处理
├── package.json
├── project.json              # Nx 项目配置
├── tsconfig.json
└── tsup.config.ts            # 构建配置

构建配置

  • 入口点src/index.ts../../dist/cli/index.js
  • 格式:ESM (ES Modules)
  • 目标:Node.js 20+
  • 打包工具:tsup (esbuild)

外部依赖

CLI 包通过 external 配置引用 backend 模块和 workspace 包:

  • @/WebServerdist/backend/WebServer.js (通过 WebServerLauncher)
  • @xiaozhi-client/configdist/config/index.js (配置管理)

导入方式

内部导入(使用相对路径)

// CLI 包内部使用相对路径
import { DIContainer } from "./Container";
import { CommandRegistry } from "./commands/index";

外部依赖(使用 workspace 包)

// 引用配置管理(从 workspace 包导入)
import { configManager } from "@xiaozhi-client/config";

// 引用 WebServer(使用路径别名,运行时解析为 backend 模块)
import { WebServer } from "@/WebServer";

开发命令

# 构建
pnpm build

# 类型检查
pnpm check:type

# 运行测试
pnpm test

# 代码检查
pnpm lint

依赖关系

packages/cli
  ↓ (implicitDependencies)
apps/backend
  ↓ (implicitDependencies)
packages/shared-types

构建顺序:shared-types → backend → cli