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

@gencode/cli

v0.3.0

Published

## 包定位

Readme

@gencode/cli

包定位

@gencode/cli 负责 CLI 入口与进程级执行编排。 它的作用是把 agent 执行能力包装成可以被外部系统消费的命令行为。

负责内容

这个包适合承载:

  • CLI 入口
  • 命令解析与分发
  • 单次任务执行编排
  • stdout 输出处理
  • HTTP callback 适配
  • websocket stream 适配
  • 命令配置与运行时装配

不负责内容

这个包不应成为以下能力的主要归属位置:

  • agent 领域逻辑
  • 本该属于 @gencode/agents 的 session 核心行为
  • 本该属于 @gencode/agents 的 memory 领域内部逻辑
  • 应沉淀到 @gencode/shared 的共享协议定义

当前源码入口

阅读本包时,建议先看:

  • src/bin.ts —— CLI 可执行入口
  • src/program.ts —— 命令编排
  • src/output.ts —— 输出处理
  • src/config.ts —— 运行配置
  • src/auth.ts —— 认证相关配置
  • src/plugins-config.ts —— 插件配置装配
  • src/logger.ts —— 日志工具

当前较有代表性的测试:

  • src/build-config.test.ts
  • src/logger.test.ts

dist/ 存在时,应将其视为生成产物,而不是主要编辑目标。

与其他包的关系

  • @gencode/cli 依赖 @gencode/agents 提供真实的 agent 执行与领域能力
  • @gencode/shared 应提供本包消费的稳定共享协议类型
  • @gencode/web 应通过 CLI 使用能力,而不是绕过它直接调用 @gencode/agents

开发说明

当你在这里增加新 CLI 能力时:

  • 保持所有进程外通信统一收口在这里
  • 不要把领域所有权从 @gencode/agents 拉到 CLI 层
  • 优先复用 @gencode/shared 中的共享协议结构
  • 保持命令行为小、显式、可测试

验证

在工作区根目录可运行:

pnpm -C source/packages/cli test

工作区级验证:

pnpm -C source typecheck
pnpm -C source test

相关规格文档

  • ../../../specs/system-overview.md
  • ../../../specs/architecture-boundaries.md
  • ../../../specs/development-workflow.md
  • ../../../specs/repo-map.md