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

downcity

v1.1.418

Published

Downcity CLI — local City container and Federation Server management

Readme

downcity

downcity 是 Downcity 的全局安装聚合包。

npm install -g downcity
downcity -v

安装后会得到 city / downcityfed / downfed 两个相互独立的工具:

  • city 是本机 City 容器,基于 City() 与 Agent SDK 管理全局 Agent、运行时、Plugin 与控制台。
  • fed 是 Federation Server Manager;TUI 用于注册和管理 Server,项目命令读取当前目录的 federation.json。Local Node.js 和 Cloudflare Workers 都通过 fed deploy 部署。
  • fed web127.0.0.1:43128 启动当前 Federation 的本地 Web 管理 UI;管理员登录后的 Session 只保留在 CLI 本地 BFF 内存中。
fed create ./my-fed
cd my-fed
pnpm install
fed deploy
fed

fed create 默认生成 Local Node.js + SQLite 项目。首次 fed deploy 会创建管理员 ID 与高强度密码,并只显示一次;请立即保存。遗失密码时,只有拥有目标基础设施部署权限的人可以运行 fed deploy --admin-reset,非交互环境还必须显式传入 --yes。CLI 通过本地 SQLite 事务或 Wrangler 远程 D1 权限直接完成管理员恢复,不要求 Worker 读取恢复环境变量;普通 deploy 永远不会修改管理员。部署期间会持续显示当前构建、资源准备、Worker 发布、健康检查与管理员验证阶段。无参数执行 fed 会进入系统级 Federation 管理面板,已部署实例不依赖当前工作目录。

City 的主要命令:

city agent create .
city agent start <agent_id>
city agent token create <agent_id> --name local
city plugin action <plugin_name> <action_name> <agent_id> --input '{}'

city agent start 创建的 Agent 默认启用 ask_question Tool。使用 city agent chat <agent_id> 交互时,模型可以在缺少关键信息时显示文本、单选或多选问题; 回答会通过 Session Interaction 提交,并在同一轮模型执行中继续处理。

Agent 与 Plugin Binding 统一保存在全局数据库;Plugin 配置不进入 Agent SDK 的运行时 Plugin 对象。未传 agent_id 时,TTY 打开全局 Agent 选择器,非交互环境直接报错。

为独立产品后端登记 Bureau:

fed bureau token

命令打开 Bureau Token 交互式管理界面,可创建、查看和撤销 Token。创建时必须输入用途,也可以直接运行 fed bureau token create。CLI 在本地生成 bureau_token,Federation 保存用途和 hash,并将明文输出一次。把明文写入 Bureau 服务器的 DOWNCITY_BUREAU_TOKEN 环境变量;Federation 与 Bureau 不需要部署在同一台服务器。脚本中可用 fed bureau token list 查看,使用 fed bureau token revoke <token_id> 撤销。