@mediamonks/canopy-cli 0.7.12 → 0.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/{db-8Etjmzxh.mjs → db-DKnJQPm5.mjs} +2 -2
  2. package/dist/{deploy-B1WrPq5W.mjs → deploy-CnxJ4TE6.mjs} +2 -2
  3. package/dist/dev-BqLvttKc.mjs +2 -0
  4. package/dist/{dev-BnUYGQQm.mjs → dev-CyJT6EfQ.mjs} +4 -4
  5. package/dist/docs/ci.md +50 -0
  6. package/dist/docs/cli-create.md +46 -0
  7. package/dist/docs/cli-db.md +86 -0
  8. package/dist/docs/cli-delete.md +44 -0
  9. package/dist/docs/cli-deploy.md +58 -0
  10. package/dist/docs/cli-dev.md +82 -0
  11. package/dist/docs/cli-docs.md +47 -0
  12. package/dist/docs/cli-download.md +42 -0
  13. package/dist/docs/cli-egress.md +37 -0
  14. package/dist/docs/cli-feedback.md +75 -0
  15. package/dist/docs/cli-index.md +61 -0
  16. package/dist/docs/cli-init.md +46 -0
  17. package/dist/docs/cli-login.md +43 -0
  18. package/dist/docs/cli-logout.md +32 -0
  19. package/dist/docs/cli-logs.md +57 -0
  20. package/dist/docs/cli-open.md +41 -0
  21. package/dist/docs/cli-projects.md +43 -0
  22. package/dist/docs/cli-promote.md +44 -0
  23. package/dist/docs/cli-rollback.md +45 -0
  24. package/dist/docs/cli-skill.md +39 -0
  25. package/dist/docs/cli-staging.md +54 -0
  26. package/dist/docs/cli-token.md +47 -0
  27. package/dist/docs/cli-upgrade.md +43 -0
  28. package/dist/docs/cli-usage.md +43 -0
  29. package/dist/docs/cli-whoami.md +46 -0
  30. package/dist/docs/cli.md +86 -0
  31. package/dist/docs/data.md +85 -0
  32. package/dist/docs/deploy.md +81 -0
  33. package/dist/docs/dev.md +72 -0
  34. package/dist/docs/developers-agents-and-ai.md +95 -0
  35. package/dist/docs/developers-architecture.md +106 -0
  36. package/dist/docs/getting-started.md +108 -0
  37. package/dist/docs/index.json +336 -0
  38. package/dist/docs/infrastructure.md +406 -0
  39. package/dist/docs/migrations.md +183 -0
  40. package/dist/docs/overview-faq.md +105 -0
  41. package/dist/docs/overview-how-it-works.md +82 -0
  42. package/dist/docs/overview-use-cases.md +76 -0
  43. package/dist/docs/overview-what-is-canopy.md +75 -0
  44. package/dist/docs/platform-ai-usage.md +65 -0
  45. package/dist/docs/platform-client-access.md +54 -0
  46. package/dist/docs/platform-deploys-and-rollbacks.md +93 -0
  47. package/dist/docs/platform-egress.md +75 -0
  48. package/dist/docs/platform-feedback.md +114 -0
  49. package/dist/docs/platform-google.md +213 -0
  50. package/dist/docs/platform-members-and-access.md +71 -0
  51. package/dist/docs/platform-project-data.md +76 -0
  52. package/dist/docs/platform-schedules.md +90 -0
  53. package/dist/docs/platform-sites-and-profiles.md +61 -0
  54. package/dist/docs/porting-nextjs.md +233 -0
  55. package/dist/docs/sdk-ai.md +103 -0
  56. package/dist/docs/sdk-auth.md +57 -0
  57. package/dist/docs/sdk-database.md +126 -0
  58. package/dist/docs/sdk-files.md +82 -0
  59. package/dist/docs/sdk-services.md +58 -0
  60. package/dist/docs/sdk.md +126 -0
  61. package/dist/docs/staging.md +106 -0
  62. package/dist/docs/static-serving.md +323 -0
  63. package/dist/docs/troubleshooting.md +102 -0
  64. package/dist/{docs-DxB7NhZs.mjs → docs-BBMVxVta.mjs} +2 -2
  65. package/dist/{egress-CN_axsAN.mjs → egress-BFSwa8Uu.mjs} +1 -1
  66. package/dist/{feedback-B-GXUBPs.mjs → feedback-BMX_d4KZ.mjs} +2 -2
  67. package/dist/index.mjs +25 -24
  68. package/dist/{local-BGRd_FMZ.mjs → local-BQxsp-ZQ.mjs} +2 -2
  69. package/dist/{login-D7dI8D9N.mjs → login-BDTO3nVw.mjs} +1 -1
  70. package/dist/{logs-DNiZquki.mjs → logs-C53y2eAS.mjs} +1 -1
  71. package/dist/{migrations-C-5x6SYf.mjs → migrations-C6EcKD6a.mjs} +1 -1
  72. package/dist/{open-DRPp4QJg.mjs → open-C5x3tX6I.mjs} +1 -1
  73. package/dist/{package-CDLufecy.mjs → package-vJXq4RNN.mjs} +1 -1
  74. package/dist/{projects-C6JQjVqg.mjs → projects-MMbv7MmK.mjs} +1 -1
  75. package/dist/schedule-Cq9K0rnE.mjs +106 -0
  76. package/dist/skill/canopy/SKILL.md +160 -0
  77. package/dist/{skill-BOWfqwr2.mjs → skill-Zq9aIPKf.mjs} +2 -2
  78. package/dist/{staging-Bw1D_J8M.mjs → staging-D8G4amjO.mjs} +1 -1
  79. package/dist/templates/spa/.github/workflows/canopy-deploy.yml +34 -0
  80. package/dist/templates/spa/AGENTS.md +47 -0
  81. package/dist/templates/spa/README.md +14 -0
  82. package/dist/templates/spa/_gitignore +4 -0
  83. package/dist/templates/spa/canopy.json +5 -0
  84. package/dist/templates/spa/index.html +12 -0
  85. package/dist/templates/spa/package.json +21 -0
  86. package/dist/templates/spa/src/app.tsx +25 -0
  87. package/dist/templates/spa/src/canopy.ts +5 -0
  88. package/dist/templates/spa/src/main.tsx +10 -0
  89. package/dist/templates/spa/src/style.css +29 -0
  90. package/dist/templates/spa/tsconfig.json +16 -0
  91. package/dist/templates/spa/vite.config.ts +7 -0
  92. package/dist/templates/static/AGENTS.md +45 -0
  93. package/dist/templates/static/README.md +9 -0
  94. package/dist/templates/static/_gitignore +2 -0
  95. package/dist/templates/static/canopy.json +4 -0
  96. package/dist/templates/static/index.html +21 -0
  97. package/dist/templates/static/main.js +9 -0
  98. package/dist/templates/static/style.css +29 -0
  99. package/dist/templates/worker/.dev.vars.example +9 -0
  100. package/dist/templates/worker/.github/workflows/canopy-deploy.yml +34 -0
  101. package/dist/templates/worker/AGENTS.md +63 -0
  102. package/dist/templates/worker/README.md +17 -0
  103. package/dist/templates/worker/_gitignore +5 -0
  104. package/dist/templates/worker/canopy.json +6 -0
  105. package/dist/templates/worker/index.html +12 -0
  106. package/dist/templates/worker/package.json +22 -0
  107. package/dist/templates/worker/src/app.tsx +25 -0
  108. package/dist/templates/worker/src/canopy.ts +5 -0
  109. package/dist/templates/worker/src/main.tsx +10 -0
  110. package/dist/templates/worker/src/style.css +29 -0
  111. package/dist/templates/worker/tsconfig.json +16 -0
  112. package/dist/templates/worker/vite.config.ts +7 -0
  113. package/dist/templates/worker/worker/index.ts +52 -0
  114. package/dist/{token-D7zrIF8G.mjs → token-BUxgRJVA.mjs} +1 -1
  115. package/dist/{ui-2mrJcjYC.mjs → ui-B1Px5y7q.mjs} +17 -0
  116. package/dist/{upgrade-fhfrid_O.mjs → upgrade-ES8u8_Pn.mjs} +2 -2
  117. package/dist/{usage-CX1Izj_l.mjs → usage-DjNngyvy.mjs} +1 -1
  118. package/package.json +1 -1
  119. package/dist/dev-CySBxW7I.mjs +0 -2
@@ -0,0 +1,61 @@
1
+ ---
2
+ title: Installing the CLI
3
+ description: Install the canopy CLI, sign in, and learn the conventions every command shares.
4
+ ---
5
+
6
+ Everything on Canopy is driven by one command-line tool: `canopy`. It scaffolds projects, runs them locally, deploys them, and manages their data — this section is the reference for every command.
7
+
8
+ ## Install
9
+
10
+ The CLI is published on npm as `@mediamonks/canopy-cli`. You need Node.js 20 or newer; then install it globally:
11
+
12
+ ```bash
13
+ npm install -g @mediamonks/canopy-cli
14
+ ```
15
+
16
+ Confirm it's on your PATH:
17
+
18
+ ```bash
19
+ canopy --version
20
+ ```
21
+
22
+ ## Sign in
23
+
24
+ Canopy authenticates through Monks' OneLogin. Run [`canopy login`](https://docs.canopy.website/cli/login) — it opens your browser, waits for the redirect back, and stores tokens in `~/.canopy/config.json`. Verify with [`canopy whoami`](https://docs.canopy.website/cli/whoami), which prints who you're signed in as on each site.
25
+
26
+ ## Staying up to date
27
+
28
+ [`canopy upgrade`](https://docs.canopy.website/cli/upgrade) reinstalls the latest release using whichever package manager installed the CLI. You rarely need to remember it: once a day the CLI checks the npm registry in the background (never blocking your command), and when you're behind it prints a one-line hint on stderr — `Update available: x.y.z → a.b.c. Run 'canopy upgrade' to update.` The check is silent in CI and when output is piped, and can be disabled with `CANOPY_NO_UPDATE_CHECK=1`.
29
+
30
+ ## Conventions every command follows
31
+
32
+ **Sites and `--profile`.** Canopy runs as several independent sites (`main`, `staging`, `gcp-pilot`). Every command accepts a global `--profile <site>` flag — or the `CANOPY_PROFILE` environment variable — to pick which site it talks to. Without either, the site comes from the `profile` pin in the project's `canopy.json`, then from the active default chosen at login. See [Sites & profiles](https://docs.canopy.website/platform/sites-and-profiles).
33
+
34
+ **The site header.** Every command starts by printing one line to stderr, e.g. `canopy 0.5.1 · main (canopy.website)` — so the command log always shows which version ran against which site. It goes to stderr on purpose: stdout stays clean for piping.
35
+
36
+ **`--json`.** [`canopy login`](https://docs.canopy.website/cli/login) and [`canopy usage`](https://docs.canopy.website/cli/usage) take a `--json` flag that prints machine-readable JSON to stdout instead of the human-formatted view — handy for agents and scripts. Other read commands keep stdout clean and stable for piping.
37
+
38
+ **`--help`.** `canopy <command> --help` prints the authoritative usage and flags for any command straight from the installed version, so it never goes stale.
39
+
40
+ ## Commands
41
+
42
+ - [canopy login](https://docs.canopy.website/cli/login) — sign in through OneLogin in your browser
43
+ - [canopy whoami](https://docs.canopy.website/cli/whoami) — show who you're signed in as, per site
44
+ - [canopy logout](https://docs.canopy.website/cli/logout) — clear stored tokens
45
+ - [canopy create](https://docs.canopy.website/cli/create) — scaffold and register a new project
46
+ - [canopy init](https://docs.canopy.website/cli/init) — set up a folder for an existing project
47
+ - [canopy projects](https://docs.canopy.website/cli/projects) — list your projects
48
+ - [canopy delete](https://docs.canopy.website/cli/delete) — delete a project and its data
49
+ - [canopy dev](https://docs.canopy.website/cli/dev) — run a project locally
50
+ - [canopy deploy](https://docs.canopy.website/cli/deploy) — build and deploy a new version
51
+ - [canopy rollback](https://docs.canopy.website/cli/rollback) — make a previous version live again
52
+ - [canopy download](https://docs.canopy.website/cli/download) — download a deployed version's files
53
+ - [canopy token](https://docs.canopy.website/cli/token) — manage deploy tokens for CI
54
+ - [canopy db](https://docs.canopy.website/cli/db) — pull, snapshot, and restore project data
55
+ - [canopy usage](https://docs.canopy.website/cli/usage) — AI spend and storage for a project
56
+ - [canopy open](https://docs.canopy.website/cli/open) — open the live project in your browser
57
+ - [canopy docs](https://docs.canopy.website/cli/docs) — read the Canopy guides, offline-capable
58
+ - [canopy skill](https://docs.canopy.website/cli/skill) — install the Canopy agent skill into a repo
59
+ - [canopy upgrade](https://docs.canopy.website/cli/upgrade) — update the CLI itself
60
+
61
+ `canopy logs` (tail a project's worker logs) exists as a stub for a planned feature and currently exits with a pointer to the roadmap.
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: canopy init
3
+ description: Set up a local folder for a project that already exists on Canopy — scaffold a starter or link an existing app.
4
+ ---
5
+
6
+ `canopy init` connects a local directory to a project that **already exists** on Canopy — one created in the dashboard, or by `canopy create` on another machine. Where `create` registers a new project, `init` never registers anything: it only prepares files locally.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy init # pick a project, scaffold ./<slug>/
12
+ canopy init retro-board . --no-scaffold # link the current dir to an existing project
13
+ canopy init retro-board apps/board --template spa
14
+ ```
15
+
16
+ ## Arguments & flags
17
+
18
+ - `<slug>` — the project's slug. When omitted on a TTY you pick from the projects you can edit. The slug must exist and you must have edit access, or the command errors.
19
+ - `<dir>` — target directory: `.` for the current directory, any path, or `./<slug>/` when omitted.
20
+ - `--template <id>` — starter to scaffold: `static` (plain HTML/CSS/JS, no build), `spa` (Vite + React + TypeScript), or `worker` (`spa` plus a backend worker). Picker when omitted on a TTY, `static` otherwise.
21
+ - `--no-scaffold` — link mode: skip the template and only write a `canopy.json` pointing the directory at the project. Use this for an app you've already built. (`--scaffold` is the default.)
22
+ - `--profile <site>` — global flag (or `CANOPY_PROFILE`): which site to resolve the project on; the profile is pinned into the written `canopy.json`.
23
+
24
+ ## How it works
25
+
26
+ The CLI first fetches your project list and validates the slug against it — a wrong slug or missing edit access fails before any files are written.
27
+
28
+ **Scaffold mode** (default) requires the target directory to be empty-ish (missing, or holding only dotfiles like `.git`). It copies the chosen template in, then writes `canopy.json` with the slug and profile pin — the same result as `canopy create`, minus the registration. If the directory has files, the error tells you to use `--no-scaffold` instead.
29
+
30
+ **Link mode** (`--no-scaffold`) writes just a `canopy.json` with the slug (creating the directory if needed). If a `canopy.json` already links the directory to a _different_ project, the command refuses rather than silently relinking; if it already links to the same project, it's a no-op. After linking, add `"dist"` or `"build"` fields to `canopy.json` if your app has a build step, then `canopy deploy`.
31
+
32
+ ## Examples
33
+
34
+ ```bash
35
+ canopy init
36
+ ```
37
+
38
+ Lists the projects you can edit, scaffolds your pick into `./<slug>/`, and prints next steps.
39
+
40
+ ```bash
41
+ canopy init landing-page . --no-scaffold
42
+ ```
43
+
44
+ Writes a `canopy.json` in the current directory linking it to `landing-page`, so `canopy deploy` knows where to publish.
45
+
46
+ To register a brand-new project instead, see [canopy create](https://docs.canopy.website/cli/create). See also [canopy projects](https://docs.canopy.website/cli/projects).
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: canopy login
3
+ description: Sign in to Canopy through OneLogin in your browser and store CLI tokens for every site.
4
+ ---
5
+
6
+ `canopy login` signs you in through your browser with OneLogin and stores CLI tokens locally. It's the first command you run on a new machine, and the one you come back to when `canopy whoami` says your token expired.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy login
12
+ canopy login --profile main # non-interactive: pick the default site up front
13
+ canopy login --json # machine-readable status for agents/CI
14
+ ```
15
+
16
+ ## Arguments & flags
17
+
18
+ - `--profile <site>` — which site (`main` | `staging` | `gcp-pilot`) becomes your active default after login. On an interactive terminal you get a picker when omitted; on a non-TTY (or with `--json`) the flag — or the `CANOPY_PROFILE` env var — is required.
19
+ - `--json` — emit machine-readable JSON status lines to stdout instead of interactive output. First a `{"status": "waiting", "url": …}` line with the sign-in URL, then `{"status": "ok", …}` or `{"status": "error", …}` (exit code 1 on error).
20
+
21
+ ## How it works
22
+
23
+ 1. The CLI opens your default browser on the OneLogin sign-in page. If nothing opens, it prints the URL for you to visit manually.
24
+ 2. You finish signing in **in the browser** — your password never passes through the CLI. When OneLogin hands control back, the browser shows a small "You're signed in" page and you can return to the terminal. The sign-in waits up to 5 minutes; the hand-back uses local port `8976`, so if another program holds that port the login fails with a clear message.
25
+ 3. The CLI stores a token for **every** site (`main`, `staging`, `gcp-pilot`), not just the one you picked, in `~/.canopy/config.json` — readable only by your user account.
26
+
27
+ One login therefore covers all sites; `--profile` only decides which one commands target by default. If minting fails for a non-active site you get a warning but login still succeeds; if it fails for your **active** profile the command errors and asks you to re-run.
28
+
29
+ ## Examples
30
+
31
+ ```bash
32
+ canopy login
33
+ ```
34
+
35
+ Opens OneLogin, prompts you to pick a default site, and finishes with a per-site checklist plus your email — you're ready for `canopy create` or `canopy deploy`.
36
+
37
+ ```bash
38
+ CANOPY_PROFILE=staging canopy login --json
39
+ ```
40
+
41
+ Headless-friendly: prints the sign-in URL as JSON so an agent can hand it to you, then reports per-profile results when the browser flow completes.
42
+
43
+ See also [canopy whoami](https://docs.canopy.website/cli/whoami), [canopy logout](https://docs.canopy.website/cli/logout), and [Sites & profiles](https://docs.canopy.website/platform/sites-and-profiles).
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: canopy logout
3
+ description: Sign out of Canopy by removing all locally stored CLI tokens.
4
+ ---
5
+
6
+ `canopy logout` signs you out on this machine by forgetting every stored CLI token. Use it on a shared machine, or when you want a clean slate before logging in as someone else.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy logout
12
+ ```
13
+
14
+ ## Arguments & flags
15
+
16
+ None. Logout is deliberately all-or-nothing: it clears the tokens for **every** site (`main`, `staging`, `gcp-pilot`) at once — there is no per-profile logout, so the global `--profile` flag has no effect here.
17
+
18
+ ## Details
19
+
20
+ The command is local-only: it removes every stored token from `~/.canopy/config.json` and prints a confirmation. Nothing is called on the server, so the tokens themselves aren't revoked — they simply age out at their normal expiry. Your active-site choice stays in the file, so the next `canopy login` picks up where you left off.
21
+
22
+ If no token was stored to begin with, it prints `Not logged in.` and exits successfully.
23
+
24
+ ## Examples
25
+
26
+ ```bash
27
+ canopy logout
28
+ ```
29
+
30
+ Removes all site tokens from `~/.canopy/config.json`; subsequent commands that need the API will ask you to run `canopy login`.
31
+
32
+ See also [canopy login](https://docs.canopy.website/cli/login) and [canopy whoami](https://docs.canopy.website/cli/whoami).
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: canopy logs
3
+ description: Read your project worker's logs (console output) from the terminal — no cloud console access needed.
4
+ ---
5
+
6
+ `canopy logs` prints what your project's worker wrote to `console.log` / `console.error`. Reach for it when the worker misbehaves — a 500, an unexpected 403, a schedule that "did nothing" — instead of adding diagnostic endpoints and redeploying. The same output lives in the dashboard under the project's **Logs** tab.
7
+
8
+ Logs are available on every site that runs workers. On a site where the platform can't read worker output, the command says so honestly instead of guessing. One caveat on Cloudflare-hosted sites: log capture starts with a project's next deploy after 2026-08-19 — a worker that hasn't been redeployed since then has nothing to show yet.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ canopy logs [--project <slug>] [--staging] [--since 1h] [--limit 100] [--follow] [--json]
14
+ ```
15
+
16
+ ## Arguments & flags
17
+
18
+ - `--project <slug>` — project slug. Defaults to the `canopy.json` in the current directory.
19
+ - `--staging` — read the staging channel's worker instead of live. Default `false`.
20
+ - `--since <when>` — how far back to read: a duration like `30s`, `15m`, `2h`, `1d`, or a timestamp. Default `1h`.
21
+ - `--limit <n>` — max entries to print, 1–1000. Default `100`.
22
+ - `--follow` / `-f` — keep polling for new entries every few seconds until you Ctrl-C.
23
+ - `--json` — print entries as JSON lines (`{ ts, severity, text }`) instead of formatted text.
24
+
25
+ ## How it works
26
+
27
+ Every request your worker handles captures its stdout/stderr; `canopy logs` reads that capture through the platform (project members only — there's no direct cloud access to grant or leak). Entries print oldest-first as:
28
+
29
+ ```
30
+ SEVERITY timestamp text
31
+ ```
32
+
33
+ `console.error` output is tagged `ERROR` and `console.warn` is `WARNING`; `console.log` stays `DEFAULT`. Text is verbatim — whatever the worker logged, including multi-line JSON. Thrown errors show up too: an uncaught exception in a request handler becomes one `ERROR` entry with the full stack trace (and the request answers a 500), so a crashing endpoint is diagnosable from the log alone.
34
+
35
+ It's read-only and stdout-clean: entries go to stdout for piping, everything else to stderr.
36
+
37
+ ## Examples
38
+
39
+ ```bash
40
+ canopy logs --since 15m
41
+ ```
42
+
43
+ The last quarter hour of worker output for the project in the current directory.
44
+
45
+ ```bash
46
+ canopy logs -f
47
+ ```
48
+
49
+ Watch logs live while you exercise the app — the closest thing to a terminal attached to your deployed worker.
50
+
51
+ ```bash
52
+ canopy logs --staging --since 1d --json | jq -r 'select(.severity == "ERROR") | .text'
53
+ ```
54
+
55
+ Just yesterday's errors from the staging worker, for a script or an agent.
56
+
57
+ See also [Troubleshooting](https://docs.canopy.website/guides/troubleshooting) for what to do with what you find, and [canopy staging](https://docs.canopy.website/cli/staging) for the staging channel.
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: canopy open
3
+ description: Open the deployed project in your browser.
4
+ ---
5
+
6
+ `canopy open` opens the project's live URL in your default browser — the quickest way to look at what's actually deployed, typically right after a `canopy deploy`.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy open [dir] [--project <slug>]
12
+ ```
13
+
14
+ ## Arguments & flags
15
+
16
+ - `--staging` — open the [staging channel](https://docs.canopy.website/guides/staging) (`staging-dot-<slug>`) instead of the live site.
17
+
18
+ - `[dir]` — project directory to read `canopy.json` from. Defaults to the current directory.
19
+ - `--project <slug>` — project slug, overriding `canopy.json`.
20
+
21
+ ## How it works
22
+
23
+ The command resolves the project slug, builds the live URL from the active site's project domain (projects are served at `https://<slug>.<site domain>`), prints the URL, and opens it in your default browser. Which domain that is depends on the active profile — `--profile staging` opens the project on the staging site, not production.
24
+
25
+ It does not deploy, check, or wait for anything: if the project has never been deployed, the browser simply lands on whatever the platform serves for an empty project. To open the dashboard instead, use the URL printed by [canopy projects](https://docs.canopy.website/cli/projects).
26
+
27
+ ## Examples
28
+
29
+ ```bash
30
+ canopy deploy && canopy open
31
+ ```
32
+
33
+ Ship and eyeball: deploys the current directory's project, then opens the freshly-live site.
34
+
35
+ ```bash
36
+ canopy open --project my-app --profile staging
37
+ ```
38
+
39
+ Opens `my-app` as served by the staging site, regardless of what the current directory pins.
40
+
41
+ See also [canopy deploy](https://docs.canopy.website/cli/deploy) and [Sites & profiles](https://docs.canopy.website/platform/sites-and-profiles).
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: canopy projects
3
+ description: List your Canopy projects with their status, role, and live URLs.
4
+ ---
5
+
6
+ `canopy projects` lists the projects you can work on for the current site — one line each with slug, status, your role, live URL, and name. It's the quickest way to recall a slug, check what you have access to, or confirm you're on the site you think you are.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy projects
12
+ canopy projects --all
13
+ canopy --profile staging projects
14
+ ```
15
+
16
+ ## Arguments & flags
17
+
18
+ - `--all` — include projects you can't edit. By default the list shows only projects where you're an owner or editor (admins always see everything, since they can edit everything).
19
+ - `--profile <site>` — global flag (or `CANOPY_PROFILE`): each site has its own project registry, so listing on `staging` shows a completely different set than `main`.
20
+
21
+ ## Details
22
+
23
+ The command fetches your project list from the platform and prints one aligned row per project: slug, status, your role (`owner` / `editor`; for `--all` rows you can't edit it shows the owner's email instead, and admins see `admin`), the live URL, and the display name.
24
+
25
+ With nothing to show, the message distinguishes the two cases: no projects exist at all (`run canopy create`), or none are yours — in which case it mentions how many `--all` would reveal.
26
+
27
+ The CLI version and active site are printed on stderr, keeping stdout clean for piping — handy since the output is stable, column-aligned text.
28
+
29
+ ## Examples
30
+
31
+ ```bash
32
+ canopy projects
33
+ ```
34
+
35
+ Shows your own projects on your default site, e.g. to grab a slug for `canopy init` or `canopy delete`.
36
+
37
+ ```bash
38
+ canopy projects --all
39
+ ```
40
+
41
+ Shows every project on the site, with owner emails for the ones you can't edit — useful for finding who to ask for access.
42
+
43
+ See also [canopy create](https://docs.canopy.website/cli/create), [canopy init](https://docs.canopy.website/cli/init), and [Members & access](https://docs.canopy.website/platform/members-and-access).
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: canopy promote
3
+ description: Make the staged version live — migrations replay against the live database first, then the exact staged artifacts go live.
4
+ ---
5
+
6
+ `canopy promote` takes what you verified on the [staging channel](https://docs.canopy.website/guides/staging)
7
+ and makes it live. It is not a redeploy: the platform re-uses the exact files
8
+ and backend bundle of the staged version, so what you tested is what ships.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ canopy promote # promote the currently staged version
14
+ canopy promote v8 # promote a specific version
15
+ canopy promote --yes # skip the confirmation (CI)
16
+ ```
17
+
18
+ ## Arguments & flags
19
+
20
+ - `[version]` — the version to make live, as `8` or `v8`. Defaults to whatever
21
+ is currently staged; errors when nothing is staged and no version is given.
22
+ - `--project <slug>` — project slug, overriding `canopy.json`.
23
+ - `--dir <path>` — project directory (defaults to the current directory).
24
+ - `--yes` — skip the confirmation prompt.
25
+ - `--profile <site>` / `CANOPY_PROFILE` — which site to promote on.
26
+
27
+ ## What happens, in order
28
+
29
+ 1. **Migrations replay against live.** Any schema migrations you rehearsed on
30
+ staging are still pending in the live database's journal — they apply now,
31
+ with an automatic pre-promote snapshot taken first. A migration failure
32
+ aborts the promote: the live version never flips, old code keeps running,
33
+ and the output names the snapshot and the restore command.
34
+ 2. **The staged backend goes live.** If the version shipped a worker, the
35
+ platform redeploys that exact bundle with live bindings.
36
+ 3. **The pointer flips.** The staged version becomes the live version.
37
+
38
+ The output confirms the live URL, the promoted version, any migrations that
39
+ applied, and the snapshot key.
40
+
41
+ Promotion is also a button on the dashboard's Overview tab.
42
+
43
+ See also [canopy deploy](https://docs.canopy.website/cli/deploy) (`--staging`), [canopy staging](https://docs.canopy.website/cli/staging),
44
+ and [Staging & promoting](https://docs.canopy.website/guides/staging).
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: canopy rollback
3
+ description: Make an earlier deploy live again by moving the live pointer to a previous version.
4
+ ---
5
+
6
+ `canopy rollback` switches the project's live version back to an earlier deploy. Reach for it when a deploy went wrong and you want the last good version serving again in seconds — no rebuild, no re-upload.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy rollback # pick a version from the deploy history
12
+ canopy rollback v3 # make v3 live directly
13
+ canopy rollback --project my-app 3
14
+ ```
15
+
16
+ ## Arguments & flags
17
+
18
+ - `[version]` — the deploy version to make live, as `3` or `v3`. Optional: when omitted on an interactive terminal you get a picker showing the full deploy history (version, timestamp, source, and which one is currently live), preselecting the version just before the live one. On a non-TTY run with no version, the CLI rolls back to `live - 1` automatically.
19
+ - `--project <slug>` — project slug, overriding `canopy.json` in the target directory.
20
+ - `--dir <path>` — project directory (defaults to the current directory).
21
+ - `--profile <site>` / `CANOPY_PROFILE` — which site's deployment to roll back.
22
+
23
+ ## How it works
24
+
25
+ Every deploy is stored immutably as a numbered version; "live" is just a pointer to one of them. Rolling back moves that pointer — no files are rebuilt, uploaded, or deleted. Projects with a custom backend also get their backend rolled to the bundle matching the target version, so frontend and backend stay in step. The command prints the target, asks the platform to repoint, and confirms with the live URL, the now-live version, and the version that was live before.
26
+
27
+ Because versions are never destroyed, rolling back is symmetric: "roll forward" is simply `canopy rollback <newer-version>` — pass the number of the newer deploy you want live again. Picking the version that's already live is an error, and a project with fewer than two deploys has nothing to roll back to.
28
+
29
+ Deploy history is also visible in the dashboard, where the same rollback is a button.
30
+
31
+ ## Examples
32
+
33
+ ```bash
34
+ canopy rollback
35
+ ```
36
+
37
+ Shows the deploy history for the project in the current directory and lets you pick — the entry before the live one is preselected.
38
+
39
+ ```bash
40
+ canopy rollback v7 --project client-site --profile main
41
+ ```
42
+
43
+ Directly repoints `client-site` on the main site to version 7 — works the same whether v7 is older or newer than what's live.
44
+
45
+ See also [canopy deploy](https://docs.canopy.website/cli/deploy), [canopy download](https://docs.canopy.website/cli/download), and [Deploys & rollbacks](https://docs.canopy.website/platform/deploys-and-rollbacks).
@@ -0,0 +1,39 @@
1
+ ---
2
+ title: canopy skill
3
+ description: Install the Canopy agent skill into a repo so coding agents know how to drive the platform.
4
+ ---
5
+
6
+ `canopy skill install` writes the Canopy agent skill into the current repository, teaching AI coding agents (Claude Code and others) how to use the platform: checking install and login state, creating vs. initializing projects, choosing templates, reading `canopy docs` before guessing, and treating `db restore`, `delete`, and deploys with appropriate care.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy skill install
12
+ ```
13
+
14
+ `install` is currently the only subcommand.
15
+
16
+ ## Arguments & flags
17
+
18
+ None — it always installs into the repository at the current working directory.
19
+
20
+ ## How it works
21
+
22
+ The skill files ship inside the CLI package, so installing needs no network. Two paths are written:
23
+
24
+ - `.agents/skills/canopy/` — the source of truth, in the tool-neutral `.agents/` tree so any agent tooling can read it (no vendor lock-in).
25
+ - `.claude/skills/canopy` — a **symlink** to the `.agents/` copy, so Claude Code picks the skill up. Where symlinks aren't available (e.g. Windows without developer mode), the CLI falls back to a real copy and says so.
26
+
27
+ Installation is a clean replace: any existing skill directory is removed first, and the installed copy is stamped with the CLI version that wrote it. That stamp is how the skill stays fresh — [`canopy upgrade`](https://docs.canopy.website/cli/upgrade) detects an installed skill in the repo and re-runs `canopy skill install` with the new CLI, so the skill always matches the CLI version in use. If that auto-refresh ever fails, re-run `canopy skill install` yourself.
28
+
29
+ Commit the `.agents/` directory (and the `.claude/` link) so teammates and CI agents get the skill with the repo.
30
+
31
+ ## Examples
32
+
33
+ ```bash
34
+ canopy skill install
35
+ ```
36
+
37
+ From a repo root: installs the skill, prints where the files went and whether `.claude/skills/canopy` is a symlink or a copy, and suggests trying `canopy docs`.
38
+
39
+ See also [canopy docs](https://docs.canopy.website/cli/docs) — the always-current documentation the skill points agents at — and [canopy upgrade](https://docs.canopy.website/cli/upgrade).
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: canopy staging
3
+ description: Inspect, refresh, or tear down the project's staging channel.
4
+ ---
5
+
6
+ `canopy staging` manages the project's [staging channel](https://docs.canopy.website/guides/staging) — the
7
+ safe copy created by the first `canopy deploy --staging`.
8
+
9
+ ## Usage
10
+
11
+ ```bash
12
+ canopy staging status # what's staged, what's live, the staging URL
13
+ canopy staging use v3 # serve an existing version on staging
14
+ canopy staging sync # replace staging data with a fresh copy of live
15
+ canopy staging destroy # remove the staging channel entirely
16
+ ```
17
+
18
+ ## Subcommands
19
+
20
+ ### `status`
21
+
22
+ Shows whether the channel exists, which version is staged (and whether it has
23
+ a backend), which version is live, and the staging URL. When the staged version
24
+ differs from live it reminds you that `canopy promote` makes it live.
25
+
26
+ ### `use`
27
+
28
+ Points the staging channel at any version in the deploy history — the reverse
29
+ of [canopy promote](https://docs.canopy.website/cli/promote), and the staging twin of
30
+ [canopy rollback](https://docs.canopy.website/cli/rollback). A pointer move: nothing is uploaded or
31
+ rebuilt, and the version's backend (if any) is redeployed to the staging
32
+ worker. Omit the version on a terminal to pick from the history. Requires the
33
+ staging channel to exist; it applies no migrations, so an old version runs
34
+ against staging's current schema (the same caveat version previews have).
35
+
36
+ ### `sync`
37
+
38
+ Re-clones the live database over the staging one. Staging data is replaced —
39
+ live is only read. Use it to re-rehearse a migration on fresh data, or when
40
+ test writes have made staging drift too far. Asks for confirmation on a
41
+ terminal; `--yes` skips it.
42
+
43
+ ### `destroy`
44
+
45
+ Deletes the staging database, staged files, and the staging backend. Live is
46
+ untouched. The deploy history keeps its records, and the next
47
+ `canopy deploy --staging` recreates the channel from a fresh copy of live.
48
+ Requires typing the slug to confirm; `--yes` skips it.
49
+
50
+ All three take `--project <slug>` to target a project outside the current
51
+ directory, and `--profile <site>` / `CANOPY_PROFILE` for the site.
52
+
53
+ See also [canopy deploy](https://docs.canopy.website/cli/deploy), [canopy promote](https://docs.canopy.website/cli/promote), and
54
+ [Staging & promoting](https://docs.canopy.website/guides/staging).
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: canopy token
3
+ description: Create, list, and revoke project-scoped deploy tokens for CI and push-to-main deploys.
4
+ ---
5
+
6
+ `canopy token` manages deploy tokens: standing `cnpy_` bearer credentials that can do exactly one thing — deploy one specific project. You reach for it when setting up CI (typically GitHub Actions deploying on every push to main) so the runner never needs a personal login.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy token create --name "GitHub Actions"
12
+ canopy token list
13
+ canopy token revoke <id>
14
+ ```
15
+
16
+ ## Arguments & flags
17
+
18
+ All subcommands resolve the project the usual way — `canopy.json` in the target directory, or `--project <slug>` to override — and honor the global `--profile <site>` / `CANOPY_PROFILE` for which site the token belongs to.
19
+
20
+ - `create` — mint a new deploy token for the project.
21
+ - `--name <label>` — a label shown in the dashboard, e.g. `"GitHub Actions"`. Optional but recommended so you can tell tokens apart later.
22
+ - `list` — show the project's deploy tokens: id, name, creation time, and who created them. Token values are never shown here.
23
+ - `revoke <id>` — delete a token by its id (from `canopy token list`). Deploys using it stop working immediately.
24
+
25
+ ## How it works
26
+
27
+ `create` prints the token plaintext **exactly once** — the platform stores only a hash, so copy it right away. The token is scoped to a single project on a single site: it can deploy that project and nothing else, which makes it safe to hand to a CI system.
28
+
29
+ To use it in CI, put the value in the `CANOPY_DEPLOY_TOKEN` environment variable — the CLI checks it before the login token, so `canopy deploy` works on a runner with no `canopy login`. For GitHub Actions, add it as the repo secret `CANOPY_DEPLOY_TOKEN` (`gh secret set CANOPY_DEPLOY_TOKEN`, or Settings → Secrets); pushes to main then deploy via the project's `canopy-deploy.yml` workflow.
30
+
31
+ If a deploy fails with a rejected token, it was likely revoked — create a fresh one here or in the dashboard (Settings → Deploy tokens) and update the secret. Losing a token is never a problem: revoke the old id and mint a new one.
32
+
33
+ ## Examples
34
+
35
+ ```bash
36
+ canopy token create --name "GitHub Actions"
37
+ ```
38
+
39
+ Prints a new `cnpy_` token once, with instructions for storing it as the `CANOPY_DEPLOY_TOKEN` repo secret.
40
+
41
+ ```bash
42
+ canopy token list --project my-app
43
+ ```
44
+
45
+ Shows every deploy token for `my-app` so you can spot stale ones and revoke them by id.
46
+
47
+ See also [canopy deploy](https://docs.canopy.website/cli/deploy) and the [CI guide](https://docs.canopy.website/guides/ci).
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: canopy upgrade
3
+ description: Update the Canopy CLI to the latest published version, using the installer that put it there.
4
+ ---
5
+
6
+ `canopy upgrade` reinstalls the CLI globally at the latest published version. You'll usually run it because the CLI told you to: when a newer release exists, commands print a one-line `Update available: … Run 'canopy upgrade' to update.` hint on stderr.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy upgrade
12
+ canopy upgrade --version 0.5.0
13
+ canopy upgrade --pm npm
14
+ ```
15
+
16
+ ## Arguments & flags
17
+
18
+ - `--version <x.y.z>` — install this exact version instead of `latest` (also how you downgrade).
19
+ - `--pm <installer>` — which installer to use: `vp`, `npm`, `pnpm`, `yarn`, or `bun`. Auto-detected by default.
20
+
21
+ ## How it works
22
+
23
+ The CLI shells out to a package manager rather than replacing files itself, so global prefixes, permissions, and lockfiles stay the installer's concern. It detects which installer owns the running binary from the binary's own path (Vite+, pnpm, bun, and yarn each keep globals in a recognizable place) and defaults to npm otherwise. The detection matters: a Vite+-installed `canopy` upgraded via plain `npm install -g` would land in npm's separate prefix and leave the active binary untouched — `--pm` overrides the guess when it's wrong.
24
+
25
+ The command prints the exact install command it runs, streams the installer's output, and suggests `canopy --version` to confirm. If the repo you're in has the [Canopy agent skill](https://docs.canopy.website/cli/skill) installed, the upgrade finishes by running the **new** CLI's `canopy skill install` to keep the skill in sync (with a warning, not a failure, if that step can't run).
26
+
27
+ The passive hint that leads you here is a once-a-day background check of the npm registry, cached in `~/.canopy/version-check.json`. It never blocks or slows a command, stays silent in CI and piped output, and can be disabled with `CANOPY_NO_UPDATE_CHECK=1`. The hint itself is suppressed while you're running `upgrade`.
28
+
29
+ ## Examples
30
+
31
+ ```bash
32
+ canopy upgrade
33
+ ```
34
+
35
+ Detects that the CLI was installed with, say, Vite+ and runs `vp install -g @mediamonks/canopy-cli@latest`, then refreshes the repo's agent skill if one is installed.
36
+
37
+ ```bash
38
+ canopy upgrade --version 0.5.0 --pm npm
39
+ ```
40
+
41
+ Pins a specific release through npm — useful to roll back a release or to correct a wrong auto-detection.
42
+
43
+ See also [canopy skill](https://docs.canopy.website/cli/skill) and [Installing the CLI](https://docs.canopy.website/cli).
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: canopy usage
3
+ description: Show a project's AI spend, storage footprint, and deploy count from the terminal.
4
+ ---
5
+
6
+ `canopy usage` prints what a project is consuming — the same data as the dashboard's Usage tab, without leaving the terminal. Reach for it when you want to know what the AI features are costing, how big the database and blob store have grown, or which version is live.
7
+
8
+ ## Usage
9
+
10
+ ```bash
11
+ canopy usage [--project <slug>] [--json]
12
+ ```
13
+
14
+ ## Arguments & flags
15
+
16
+ - `--project <slug>` — project slug. Defaults to the `canopy.json` in the current directory.
17
+ - `--json` — print the raw JSON (same shape as the dashboard Usage API) instead of the formatted report. Default `false`.
18
+
19
+ ## How it works
20
+
21
+ The command resolves the project, fetches its usage from the platform, and prints a report covering (by default) the last 30 days:
22
+
23
+ - **AI** — total spend in USD, request count, and tokens in/out, with a per-model breakdown (top 8 models). If AI usage data isn't available for the project, the report says so with the reason. A note appears when the window held more requests than were summarized.
24
+ - **Storage** — database size and table count, and blob storage total bytes and object count (each shown as `—` when the project has none).
25
+ - **Deploys** — how many deploys the project has had, and which version is currently live.
26
+
27
+ It's read-only: nothing is changed, and no confirmation is needed. With `--json`, the report goes to stdout as `{ slug, usage }` for scripts and agents; the human view is plain text either way.
28
+
29
+ ## Examples
30
+
31
+ ```bash
32
+ canopy usage
33
+ ```
34
+
35
+ From inside a project directory: prints the AI spend, storage, and deploy summary for the project pinned in `canopy.json`.
36
+
37
+ ```bash
38
+ canopy usage --project my-app --json | jq .usage.ai.costUsd
39
+ ```
40
+
41
+ Pulls one number — the project's AI spend over the window — for a script or a quick answer.
42
+
43
+ See also [AI usage](https://docs.canopy.website/platform/ai-usage) for how spend is measured, and [canopy projects](https://docs.canopy.website/cli/projects) to find a slug.