@vxil/cli

中文文档
0.36.0发布于 2026/11/03MITTypeScriptES Module

The vxil CLI — init, quickstart, push, gen, secrets, keys, migrate, doctor, diff, functions, payments; installs the vxil command (npm i -g @vxil/cli).

原始使用文档

@vxil/cli

The Vxil CLI — config-as-code for backend building blocks you enable in one line. The package is @vxil/cli and it installs the vxil command — the bare vxil name on npm is blocked, so always install the scoped package. It needs Node.js 24 or newer.

npx @vxil/cli quickstart          # create a tenant + scaffold vxil.config.ts
npx @vxil/cli push                # apply your config (features, cms collections, functions)
npx @vxil/cli gen                 # generate a typed client + MCP manifest for YOUR backend
npx @vxil/cli functions dev fn    # run a tenant function locally against the remote edge
npx @vxil/cli listen --forward-to localhost:3000/webhook   # forward inbound webhook events to your local server
npx @vxil/cli mcp install --client cursor   # wire your backend's MCP server into your editor's agent
npx @vxil/cli doctor              # keys, URLs, reachability + secrets referenced-vs-stored + per-function hashes
npx @vxil/cli diff --against staging   # CI drift gate vs a named slot: exit 0 no drift · 1 drift · 2 error

Config-as-code lives in vxil.config.ts, typed by @vxil/config (also bundled as the @vxil/cli/config subpath):

import { defineConfig } from '@vxil/config';

export default defineConfig({
  // (a) per-feature config — the same typed manifests the server validates
  features: {
    auth: { enabled: true },
    cms: { enabled: true, draftPublish: true },
    // provider 'resend' needs its key: `vxil secrets set RESEND_API_KEY` (or use provider: 'mock' to try it)
    notifications: { enabled: true, provider: 'resend', resendApiKeyRef: 'secret:RESEND_API_KEY', fromEmail: '[email protected]' },
  },
  // (b) CMS schema-as-code — collections + fields, reconciled by `vxil push`
  cms: {
    collections: {
      tasks: {
        fields: {
          title: { type: 'string', required: true, indexSlot: 's1' },
          done: { type: 'bool' },
        },
      },
    },
  },
});

Verbs: init templates quickstart try login link keys account logout invites members projects billing plan push pull diff gen doctor architect versions rollback secrets env seed export import functions listen mcp cms files webhooks search dev payments migrate config users send deliveries api.

vxil quickstart [--features a,b] [--invite <code>] [--env <label>] [--dev [--ttl <h>]] [--no-push] is the front door; vxil api --help prints the operator cheat-sheet — every dashboard action as one vxil api line.

Every verb names its target. --dev selects the dev slot, --target <name> a named slot bound by vxil link <slug> --as <name> (which merges into the existing binding rather than replacing it). The selector is fail-closed — an unbound slot exits 1 telling you the fix, and never falls through to another tenant — and every write verb prints a target banner (slug + env, never a key) before it acts.

  • vxil plan --explain — the config plan with every leaf tagged declared or default.
  • vxil push [--skip-functions] — apply schema → config → functions; a project below the functions plan is stopped before anything is pushed, and --skip-functions pushes the rest.
  • vxil diff [--against <target>] [--ignore <k,…>] [--strict-secrets] [--strict-runtime] — the CI drift gate; secrets compared by name only, and a referenced-but-unstored name is informational unless --strict-secrets. A function whose only difference is a platform setting — the functions runtime (compatibility date/flags) or the plan's CPU limit — is listed with reason: runtime <old> → <new> / reason: cpu-limit <old> ms → <new> ms and is informational under the gate (--exit-code / --against: exit 0) unless --strict-runtime — a plain vxil diff still counts it; vxil plan shows the same reason, and vxil push redeploys it under the new settings.
  • vxil doctor — preflight: secrets referenced-vs-stored (advisory, names only) plus a served / published / local hash verdict per function. Under --json stdout is one JSON document; notices go to stderr.
  • vxil link <slug> — reuses the key already stored for the slug on this machine; --mint for a fresh one, --key to hand one in.
  • vxil keys mint --name <name> --scopes <a,b,c> [--env live|test] [--store] — mint a narrow key for a server (scopes validated locally; admin refused); the key prints once to stdout (--json → { api_key, key_id, scopes }) and is never stored unless --store. vxil keys list shows names, ids, scopes, created and last-used (never secrets); vxil keys revoke <key_id> [--yes] asks you to type the id, and refuses the key the CLI itself is using unless --yes. Needs a dashboard session (vxil login, or it prompts at a terminal; a piped / --json run fails with that remedy instead — pass --email/--password to script it, which never stores the session).
  • vxil cms drop <collection> [--purge-rows] [--yes] — remove one collection definition through the same guarded ack push --allow-destructive uses (rows are retained, and a re-create brings them back; --purge-rows hard-deletes them too, and on a collection dropped earlier deletes its retained rows).
  • vxil members list|invite|add|rm|uninvite and vxil invites accept <token|url> — the bound project's team from the terminal (your vxil login session): invite by e-mail with a role, add an existing account (also how you change a role), remove (typed e-mail, refuses the last owner), revoke a pending invitation, accept one.
  • vxil projects list|create|rm and vxil billing status|upgrade --tier <t> — your projects and the bound project's plan. projects rm deletes any project you own after you type its slug; billing upgrade prints the hosted checkout URL (never opens a browser) and also downgrades (--tier free).
  • vxil files put <path> --user <id>, vxil webhooks sources add|list|rm|test, vxil webhooks events replay|runs, vxil cms bulk-rm <collection> --filter '<json>' [--dry-run], vxil search sync run|reset <key> [--purge], vxil users import <file> — the operator actions where the CLI adds something a raw call cannot (bytes from disk, a print-once receiver URL, a dry run before a typed confirm, a chunked bulk). Everything else the dashboard does per feature is one vxil api line: vxil api --help.
  • vxil gen --offline --check ignores the pinned API majors (only the online generator knows them), so an online-generated vxil.types.ts passes the offline gate.
  • vxil api <METHOD> <path> ['<json>' | --data '<json>'] — call any /v1 route; bare JSON on stdout, banner on stderr.
  • vxil secrets list --all-projects — the names-and-metadata matrix across every bound project (values never come back).
  • vxil migrate payments --from-provider stripe|paddle|paypal|revenuecat (--customers <f.csv> | --all) [--dry-run] — backfill subscriptions through the server sync leg; resumable.
  • vxil payments simulate --scenario <s> --user <id> [--tier <t>] — mock/dev projects only: drive a refund pair, cross-platform unlock, renewal, expiry, past-due grace or transfer and check the oracle.

vxil listen --forward-to <url> polls your tenant's inbound webhook events and re-POSTs each new one to your local server under the exact delivery contract production uses — same body shape, same signed X-Vxil-Jobs-Signature header (your real signing secret) — so the handler you test locally is the handler you ship. --replay-last <n> re-forwards recent events; --raw posts the stored provider payload alone.

Docs: vxil.com · Dashboard: vxil.com/dashboard

MIT © techmaker.io

版本与发布记录

@vxil/cli 共发布 57 个版本,首次发布于 2026/07/10;过去 12 个月发布了 57 个版本。

版本发布日期距今
0.36.0latest2026/11/03今天
0.35.22026/11/021 天前
0.35.12026/11/012 天前
0.35.02026/10/313 天前
0.33.02026/10/286 天前
0.32.02026/10/2410 天前

关于 @vxil/cli 的常见问题

@vxil/cli 是什么?

vxil CLI - init, quickstart, push, gen, secrets, keys, migrate, doctor, diff, functions, payments;安装 vxil 命令(npm I -g @vxil/cli)。

如何安装 @vxil/cli?

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

@vxil/cli 支持 TypeScript 吗?

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

@vxil/cli 支持 ESM 还是 CommonJS?

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

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

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

@vxil/cli 可以商用吗?

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

@vxil/cli 还在维护吗?

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