@ezship/cli

中文文档
0.1.18发布于 2026/11/13Apache-2.0TypeScriptES Module零依赖近 30 天下载 2325

ez: the command-line contract for ezship Sites. Also the module the studio's agent panel runs.

原始使用文档
文档目录4 节
  1. Signing in
  2. The Instance folder
  3. Editor setup
  4. What is in the package

@ezship/cli

The ez command and the contract: every operation on an ezship Instance or Site, run identically by the CLI and the Studio. Apache-2.0; requires Node 20 or later. ez help is the guide to building a Site.

Signing in

ez login acme discovers https://acme.ezship.dev and signs in with a code emailed to you (`--email

`, else it asks). With `--password [--username NAME]` it asks for a password instead (or reads it from piped stdin, which then needs `--username`); `--browser` approves the login on the platform's page.

Each login is a saved connection in ~/.ez/connections.json. ez login bravo saves another one while Acme stays primary; ez logins lists them, ez switch bravo changes the primary, and --instance acme targets one command. A bound folder always means its own Instance. For local development use ez login http://dev.localhost:5199; no system DNS change is needed.

ez account [--password] opens the platform's account page. ez tokens and ez token revoke <id> list and revoke tokens (--json supported). ez logout [--all] forgets saved credentials; it does not revoke a token.

The Instance folder

ez clone [<instance>] pulls every Site you may open into sites/<folder>/, named for the Site, and the Global Workspace into global/; ez pull --all refreshes them, following each folder's binding, never its name, and moves a folder when its Site is renamed. No Site may be named global or sites.

ez global <command> works on the Global Working Copy from a Site's folder. Admins and Builders add Tables, nullable columns and indexes to global/db/schema.sql; every schema edit regenerates global/db/types.d.ts, and Site code imports row types from global/db/types. Run ez global check, then ez global push, before a Preview or Deploy can create what you added: a push makes published definitions permanent and runs no DDL, and a deployed Site keeps its code and Declaration until it is deployed again. Limited Builders read, check and preview their own copy.

ez preview and ez dev build with the global/ beside the Site (or --global-dir <dir>, which must be pulled for the same Instance and Builder), else with the pushed Global files; a Preview of a retained Version uses the pushed ones. ez dev watches both copies and uploads after every change; the Preview reloads itself after each successful build. ez check runs the hosted Pipeline's full checks.

Editor setup

Clone, Pull and ez dev write editor setup for VS Code and other TypeScript editors: one root tsconfig.json extending .ez/editor/tsconfig.json, shared by global/ and every Site folder, with the React, JSX, @ezship/react and Global declarations and the database row types. No npm install is needed in a Working Copy. A standalone Working Copy, a Site with its own tsconfig.json, or one using a different --global-dir keeps its own setup; a custom configuration can extend ./.ez/editor/tsconfig.json. Editor metadata never enters status, Push or Preview, and the declarations follow the installed CLI release.

What is in the package

  • ez.mjs: the terminal binding: login, the primary, Site selection, Working Copies on disk.
  • connections.mjs: discovery, saved identities, the primary, target and request binding, the contract number.
  • commands.mjs (@ezship/cli/contract): every command against the Workspace interface, and ROUTES, how each remote method reaches the API (httpWorkspace for clients, matchRoute for the platform).
  • schema.mjs (@ezship/cli/schema): the App Database rule table, the db/schema.sql parser and the schema planner.
  • types.d.mts (@ezship/cli/types): the HTTP API's shapes.
  • account.mjs: ez tokens and ez token revoke; editor.mjs: the editor setup; bindings.mjs: where a folder's binding lives.
  • local-fetch.mjs: HTTP for *.localhost, keeping the Instance origin while connecting to loopback.
  • update-check.mjs: at most once a day, whether npm has a newer release; ez then says so on standard error after the command. EZ_NO_UPDATE_CHECK=1 or CI turns it off.

Plain JavaScript, zero runtime dependencies, no build. Tests: bun run test.

版本与发布记录

@ezship/cli 共发布 20 个版本,首次发布于 2026/09/06;过去 12 个月发布了 20 个版本。

版本发布日期距今
0.1.18latest2026/11/131 天前
0.1.172026/11/122 天前
0.1.162026/11/103 天前
0.1.152026/11/068 天前
0.1.142026/11/059 天前
0.1.132026/11/059 天前

关于 @ezship/cli 的常见问题

@ezship/cli 是什么?

ez: the command-line contract for ezship Sites. Also the module the studio's agent panel runs.

如何安装 @ezship/cli?

在项目目录运行 npm install @ezship/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ez,可以用 npx ez 直接运行。

@ezship/cli 支持 TypeScript 吗?

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

@ezship/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

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

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

@ezship/cli 可以商用吗?

@ezship/cli 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

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

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

@ezship/cli 还在维护吗?

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