@cloudgrid-io/cli

中文文档
0.25.1发布于 2026/11/04MITES Module近 30 天下载 1953

The CloudGrid CLI — put your apps and agents on the grid.

原始使用文档
文档目录14 节
  1. Contents
  2. Install
  3. Quickstart
  4. Examples
  5. Commands
  6. Flags
  7. Environment
  8. Telemetry
  9. Disabling telemetry
  10. Updating
  11. Uninstall
  12. Troubleshooting
  13. Support
  14. License

CloudGrid CLI

npm license

Build, ship, and run apps and agents on CloudGrid from your terminal. A directory or a URL becomes a live, addressable thing in about 30 seconds — deploy, tail logs, share, read feedback, all without leaving your shell.

The command is grid.

Contents

Install

macOS / Linux — curl

curl -fsSL https://raw.githubusercontent.com/cloudgrid-io/cli/main/install.sh | sh

macOS / Linux — Homebrew

brew install cloudgrid-io/tap/grid

Cross-platform (incl. Windows) — npm

npm install -g @cloudgrid-io/cli

Requires Node.js 22+.

Node 22 is what CloudGrid builds and tests on — every Dockerfile in the platform is node:22, and every CI job runs node-version: 22. The floor names that rather than sitting below it. Node 18 left maintenance in April 2025 and Node 20 in April 2026; neither receives security patches.

On an older Node, npm install -g @cloudgrid-io/cli prints an EBADENGINE warning and installs anyway — npm only refuses when you have set engine-strict=true. The install appearing to succeed is not a signal the CLI will run. Install Node 22 or later.

Verify: grid --version and grid doctor.

The package installs a single command, grid. The older cloudgrid, gridctl and cg names are retired and are not installed.

Quickstart

grid login          # Google OAuth in the browser
grid whoami         # confirm user + active grid
grid plug           # build + deploy the current directory, prints the live URL
grid open           # open it in the browser

No account needed to try a one-off share: grid plug ./index.html drops a public link.

Examples

# Scaffold and deploy a Node app
grid new app my-api --type node
cd my-api && grid plug

# Deploy the current directory and tail its logs
grid plug
grid logs --since 10m

# Publish beyond the grid as an unlisted link, then read feedback
grid visibility set my-api --inside grid --outside link
grid feedback

# Switch grid, list what's on it
grid use atomic
grid get entities

Commands

Visibility is two axes — --inside is who in the grid is an audience (private | spaces | grid), --outside is reach beyond it (none | link | public).

CommandPurpose
login / logout / whoamiSign in (Google OAuth), sign out, show user + active grid
use [slug]Set or show the active grid
new [name]Set up a folder to build in (no server entity until you plug or dev)
plug [target]Build + deploy (or redeploy); prints the live URL
devRun the linked entity locally with grid-injected resources
status [name]Grid dashboard, entity detail, or a deploy snapshot
followRe-attach to a deploy trace and stream progress until done
logs [name]Stream logs from the entity pods
open [name]Open the entity outlet URL in the browser
info [name]Show detailed entity metadata
rollback / versionsRoll back to a prior deploy; list, tag and pin minted versions
visibility setSet the two visibility axes (--inside / --outside)
env / secretsManage runtime env vars and secrets (secret values are never returned)
vaultManage a grid's vault items (write-only; never printed)
get / describe / create / deleteList, inspect, create and remove grids, entities and spaces
rename / unplugRename the display name; take a node off the grid
pullDownload an entity's source and link the folder so plug updates it
pickupMake your own copy of an app you can see, with upstream lineage
collabGet or grant push access to an entity
callers / callsWho may call an app you own; what your app calls
link / wireBind this folder, a repo, or a webhook to an entity
domainsServe apps on your own domain
spaceManage spaces
hooksManage webhook hooks
agentWrite agent instructions (AGENTS.md + CLAUDE.md) into this directory
scaffoldScaffold service folders declared in cloudgrid.yaml
sshOpen an interactive shell in a running pod
recipesPrint Runtime SDK recipes
feedback [message]Send feedback to the CloudGrid team
doctorDiagnostic checks (Node, Docker, API reachability, auth)
completion <shell>Shell completion script

Run grid <command> --help for the full flag set of any command, and grid --help for the complete list.

Flags

Global:

  • -V, --version — print the CLI version
  • -v, --verbose — detailed output
  • -h, --help — help for any command

Common per-command:

  • --grid <slug> — pick/override the grid
  • --json / -o <format> — machine-readable output (table | json | yaml | wide)
  • --no-clipboard / --no-notify — suppress clipboard copy / OS notification on plug
  • --since <dur> / --tail <n> — logs window

Environment

  • CLOUDGRID_GRID — the active grid for this shell only. Accepts a slug or a grid id, and overrides ~/.cloudgrid/config.yaml without changing it.
  • CLOUDGRID_HOME — where config and credentials live (default ~/.cloudgrid).
  • CLOUDGRID_TOKEN — authenticate non-interactively instead of grid login.
  • CLOUDGRID_TELEMETRY — see Telemetry.

grid use writes to one file in your home directory, so it applies to every shell on the machine — including other terminals and any agent session running in parallel. When two shells need different grids, set CLOUDGRID_GRID rather than running grid use in each:

# This shell targets acme; every other shell keeps whatever `grid use` set.
export CLOUDGRID_GRID=acme
grid plug

# Or for a single command, without exporting anything:
CLOUDGRID_GRID=acme grid plug

Precedence, highest first: --grid → CLOUDGRID_GRID → grid use.

Scripts that need a specific grid should use CLOUDGRID_GRID or --grid. A script that calls grid use repoints the grid for everything else you have open, and does not put it back.

Telemetry

The CLI sends three event types to the CloudGrid API while the platform is in pre-release:

  • error — when a verb fails. Captures the v2 error code, HTTP status, request id, and the bare verb (no flags, no positional args).
  • success — on new, plug, dev, login after a clean completion. Captures the verb and elapsed time. No payload from the source tree.
  • feedback — only when you run grid feedback "<message>".

Every event is JWT-bound (your user id), times out at 250 ms, and never blocks the verb. File paths, command flags, env-var values, JWTs, and credentials are not collected. The feedback verb's --include-log flag is the only freeform path — it ships the scrubbed last 200 lines of ~/.cloudgrid/logs/cli.log.

Disabling telemetry

# One-shot, env var (highest priority — overrides config):
CLOUDGRID_TELEMETRY=0 grid plug

# Persistent, written to ~/.cloudgrid/config.yaml:
grid login --no-telemetry

Re-enable with CLOUDGRID_TELEMETRY=1 or by removing telemetry: false from your config file.

Updating

npm update -g @cloudgrid-io/cli      # npm
brew upgrade grid                    # homebrew

grid doctor warns when a newer version is available.

Uninstall

npm uninstall -g @cloudgrid-io/cli   # npm
brew uninstall grid                  # homebrew
rm -rf ~/.cloudgrid                  # remove stored credentials + config

Troubleshooting

  • grid: command not found — ensure the npm global bin (or Homebrew bin) is on $PATH; re-run the installer.
  • Auth errors / 401 — grid login again; check grid whoami shows the expected grid, switch with grid use <slug>.
  • Deploy fails — run grid doctor; check grid logs and grid status <name> for the trace.

Support

License

MIT. See LICENSE.

版本与发布记录

@cloudgrid-io/cli 共发布 122 个版本,首次发布于 2026/04/05;过去 12 个月发布了 122 个版本。

版本发布日期距今
0.25.1latest2026/11/046 天前
0.25.02026/11/037 天前
0.24.12026/10/2119 天前
0.24.02026/10/1823 天前
0.23.12026/10/1426 天前
0.22.02026/08/232 个月前

其他发布通道:next → 0.8.29-rc.0。

关于 @cloudgrid-io/cli 的常见问题

@cloudgrid-io/cli 是什么?

The CloudGrid CLI — put your apps and agents on the grid.

如何安装 @cloudgrid-io/cli?

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

@cloudgrid-io/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cloudgrid-io__cli 是否存在。

@cloudgrid-io/cli 支持 ESM 还是 CommonJS?

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

@cloudgrid-io/cli 需要什么版本的 Node.js?

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

@cloudgrid-io/cli 可以商用吗?

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

@cloudgrid-io/cli 的下载量有多少?

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

@cloudgrid-io/cli 还在维护吗?

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