@appweaver/cli

中文文档
2.4.1发布于 2026/11/01MITTypeScriptCommonJS近 30 天下载 3345

Appweaver - the backend framework for AI-first development (@cli)

原始使用文档
文档目录5 节
  1. Description
  2. Installation
  3. Usage
  4. Documentation
  5. License

Appweaver Logo

The weaver command line tool of Appweaver.

NPM Version Package License NPM Downloads

Description

@appweaver/cli provides the weaver binary that drives the development workflow of an Appweaver project: building, starting, code generation, migrations, seeding, one-shot tasks, OpenAPI export, test database setup, configuration checks, modules, and package updates. It runs under Bun automatically when the project is configured for the Bun runtime.

Installation

npm install @appweaver/cli

It is a dependency rather than a dev dependency, as in a scaffolded project, since a production image runs weaver start and weaver migrate.

The CLI needs only @appweaver/core. weaver generate, weaver seed and weaver test setup use the @appweaver/data package of the project, weaver openapi its @appweaver/web, and they exit naming the package when it is missing.

Usage

weaver build                        # compile the TypeScript project
weaver start --watch                # start in watch mode, restarting on changes
weaver generate                     # generate types and the Prisma schema from the models
weaver migration new <name>         # create a database migration
weaver migrate                      # apply the pending migrations
weaver seed --build-project         # build the project, then run the seeders
weaver openapi --format yaml        # export the OpenAPI specification
weaver run src/tasks/report.ts      # run the default export of a file with the application, then exit
weaver test setup                   # create the temporary test database (NODE_ENV=test)
weaver config schema                # write the JSON Schema of appweaver.json from the enabled modules
weaver config print                 # print every config value with its source, the secrets hidden
weaver config check                 # validate the config, i.e. NODE_ENV=prod in CI (exit 1 on an error)
weaver module add redis docker      # add modules to the project, from the scaffold templates
weaver module add appweaver-gcs     # install a module package without its scripts, print its providers
weaver module new audit-log         # create the local module src/modules/audit-log/
weaver module remove docker         # remove a module, deleting its files
weaver upgrade --dry-run            # list the package upgrades without installing them

Long flags are kebab-case, and the flags turning a default off are --no-* negations (--no-skill, --no-registry, --no-prune). Run weaver <command> --help for the options of a command, or see the CLI reference.

Documentation

  • Appweaver README – getting started, configuration, and the overview of every package
  • Agent skill – the complete framework reference shipped to every scaffolded project

License

Appweaver is MIT licensed.

版本与发布记录

@appweaver/cli 共发布 71 个版本,首次发布于 2026/05/18;过去 12 个月发布了 71 个版本。

版本发布日期距今
2.4.1latest2026/11/016 天前
2.4.02026/11/016 天前
2.3.02026/11/016 天前
2.2.02026/10/317 天前
2.1.22026/10/2513 天前
2.1.12026/10/2513 天前

关于 @appweaver/cli 的常见问题

@appweaver/cli 是什么?

Appweaver - the backend framework for AI-first development (@cli)

如何安装 @appweaver/cli?

在项目目录运行 npm install @appweaver/cli,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:typescript(^5.9.0)、@appweaver/core(^2.4.1)、@appweaver/common(^2.4.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 weaver,可以用 npx weaver 直接运行。

@appweaver/cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@appweaver/cli 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@appweaver/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >= 24.7。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@appweaver/cli 可以商用吗?

@appweaver/cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@appweaver/cli 的下载量有多少?

根据 npm 官方下载统计,@appweaver/cli 在 2026/10/07 – 2026/11/05 这 30 天内被下载 3,345 次,日均约 112 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@appweaver/cli 还在维护吗?

最新版本 2.4.1 发布于 2026/11/01(6 天前);至今共发布 71 个版本,其中过去 12 个月发布了 71 个;首次发布于 2026/05/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。