commercebuild-cli 0.0.32 → 0.0.33-rc.0

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # commercebuild-cli
2
2
 
3
- Command-line companion to the Commercebuild store admin's app editor: it
3
+ Command-line companion to the commercebuild store admin's app editor: it
4
4
  downloads a custom app to your machine, saves it back to the online draft,
5
5
  and builds or releases a version — the editor's Save / Deploy / Release
6
6
  buttons, as commands.
@@ -8,7 +8,7 @@ buttons, as commands.
8
8
  Run it through `npx`; nothing needs installing globally:
9
9
 
10
10
  ```
11
- npx commercebuild-cli@latest extension open <appId> --store https://<your-store>/
11
+ npx commercebuild-cli@rc extension open <appId> --store https://<your-store>/
12
12
  ```
13
13
 
14
14
  (`npm install -g commercebuild-cli` works too if you prefer a global
@@ -18,7 +18,7 @@ install.)
18
18
 
19
19
  The store admin's app editor has an open-in-editor button (VS Code by
20
20
  default; the dropdown next to it picks Cursor, and the choice is
21
- remembered). With the **Commercebuild Apps** extension installed in that
21
+ remembered). With the **commercebuild App Studio** extension installed in that
22
22
  editor it opens
23
23
  `vscode://commercebuild.vscode-store-app/open?app=<appId>&store=<url>`
24
24
  (`cursor://…` for Cursor); the extension confirms the working folder, runs
@@ -69,9 +69,25 @@ What `open` does:
69
69
  - No editor installed? The download still succeeds (exit 0); the command
70
70
  prints the folder and a warning instead of launching anything.
71
71
  - `--json` prints `{dir, source, files}` on stdout (errors as `{error}`);
72
- the Commercebuild Apps extension uses it with `--no-editor` to open the
72
+ the commercebuild App Studio extension uses it with `--no-editor` to open the
73
73
  folder in its own window.
74
74
 
75
+ ## Signing in (`auth`)
76
+
77
+ `auth login --store <url>` signs in through the store admin's consent page
78
+ in your browser and keeps the token pair in your operating system's
79
+ keychain; `auth info` lists the stores you are signed in to and `auth
80
+ logout` signs out.
81
+
82
+ `auth token [--store <url>] [--json]` prints a current access token for a
83
+ signed-in store (the current one by default), renewed first when it has
84
+ less than 5 minutes left. Only the token goes to stdout; `--json` prints
85
+ `{accessToken, expiresAt, storeUrl, adminUrl, storeId}` instead, and an
86
+ error as `{error, code}` (`code` is `not-signed-in` when there is no
87
+ sign-in to use), with exit code 1. The commercebuild App Studio
88
+ extension's assistant panel gets its token this way. Treat the output like
89
+ a password.
90
+
75
91
  ## Working locally
76
92
 
77
93
  The online editor's actions have these equivalents, all run in the
@@ -79,12 +95,12 @@ project folder (npm shown; yarn and pnpm work the same — the project
79
95
  declares no package manager, and `open` writes an `.npmrc` so pnpm hoists
80
96
  like npm):
81
97
 
82
- | Online editor | Local | What it does |
83
- | ---------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
84
- | (build errors) | `npm run type-check` | The SDK's TypeScript over the project (`tsc --noEmit`), exit code = tsc's. Run after every change; the online editor's compile errors are the equivalent. |
85
- | Save | `npm run save` (`extension save`) | Zips the project (minus `node_modules`, `dist`, `.git`, `.env*`, `.npmrc`, lockfiles, logs, binary files) and **replaces** the online draft — the editor shows it on next load. No conflict check: the last writer wins, so pick one place to edit an app. 700 KB cap, same as the editor. |
86
- | Deploy | `npm run deploy` (`extension commit`) | Builds a new version from `src/**` plus the root manifests, `.gitignore` and the AI / README files. |
87
- | Deploy → Release | `npm run release` (`extension release`) | Builds and makes the version live. Waits up to 15 min for the build, retrying failed status polls; if it stops waiting, the build continues on the server — finish with `npx commercebuild-cli@latest extension release --upload <uploadId>` (printed in the message) or release the version in the store admin. |
98
+ | Online editor | Local | What it does |
99
+ | ---------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100
+ | (build errors) | `npm run type-check` | The SDK's TypeScript over the project (`tsc --noEmit`), exit code = tsc's. Run after every change; the online editor's compile errors are the equivalent. |
101
+ | Save | `npm run save` (`extension save`) | Zips the project (minus `node_modules`, `dist`, `.git`, `.env*`, `.npmrc`, lockfiles, logs, binary files) and **replaces** the online draft — the editor shows it on next load. A save based on an older revision than the online one is refused unless `--force` is given. Held to the platform's draft cap (5 MB by default), same as the editor. |
102
+ | Deploy | `npm run deploy` (`extension commit`) | Builds a new version from `src/**` plus the root manifests, `.gitignore` and the AI / README files. `-m "…"` gives the build's description; without it the CLI asks (a script must pass it). |
103
+ | Deploy → Release | `npm run release` (`extension release`) | Builds and makes the version live. Waits up to 15 min for the build, retrying failed status polls; if it stops waiting, the build continues on the server — finish with `npx commercebuild-cli@rc extension release --build <buildRef>` (printed in the message) or release the version in the store admin. |
88
104
 
89
105
  `npm run dev` previews the app against your store (open the storefront with
90
106
  `?devSource=http://localhost:25521`).