@usepowerplant/cli 0.4.12 → 0.4.14
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 +16 -125
- package/dist/cli.js +733 -512
- package/dist/menubar/Powerplant.app.zip +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
This file is the public npm page of @usepowerplant/cli. Write only what a
|
|
3
|
+
customer needs. Team procedures go in RELEASING.md, which npm does not publish.
|
|
4
|
+
Rule: docs/client-engineering-rules.md, "Releases".
|
|
5
|
+
-->
|
|
6
|
+
|
|
1
7
|
# @usepowerplant/cli
|
|
2
8
|
|
|
3
9
|
Set up a machine for [Powerplant](https://powerplant.sh): enroll it into
|
|
@@ -19,7 +25,7 @@ re-run at any time — finished steps are skipped with a note:
|
|
|
19
25
|
1. **Enroll this machine.** Your browser opens so you can approve the
|
|
20
26
|
machine into your org. On macOS, the credential is encrypted in a local
|
|
21
27
|
file with its key in Keychain; other platforms use a file only your user
|
|
22
|
-
can read.
|
|
28
|
+
can read.
|
|
23
29
|
2. **Install the background service.** The sync service watches your local
|
|
24
30
|
coding-agent sessions (Claude Code, Codex, and Cursor) and uploads the
|
|
25
31
|
ones in scope. If recent sessions name repositories under a macOS-protected
|
|
@@ -119,8 +125,10 @@ powerplant update
|
|
|
119
125
|
That reinstalls `@usepowerplant/cli` with whichever package manager put it
|
|
120
126
|
on this machine (npm, pnpm, bun, or yarn), so the copy that is running is the
|
|
121
127
|
copy that gets replaced, then restarts the background sync onto the new
|
|
122
|
-
version.
|
|
123
|
-
|
|
128
|
+
version. When this machine already has the newest version available to it,
|
|
129
|
+
`update` says so and changes nothing. Running the manager's own global
|
|
130
|
+
install yourself works too: the service notices the new version on disk and
|
|
131
|
+
restarts itself within moments.
|
|
124
132
|
When the install can't be replaced this way (a folder only an administrator
|
|
125
133
|
can write, or a layout the CLI doesn't recognise), `update` says why and
|
|
126
134
|
prints the command to run instead. `powerplant status` tells you when a
|
|
@@ -144,134 +152,17 @@ The one exception is a registry that does not serve the release yet (npm's
|
|
|
144
152
|
cache can lag a publish by a few minutes): the sync tries that release
|
|
145
153
|
again on its next hourly checks, up to three times, and the menu says so.
|
|
146
154
|
|
|
155
|
+
Powerplant offers your machine a release only after the team has tested
|
|
156
|
+
it, so the version it offers can be older than the newest version listed on
|
|
157
|
+
npm. Powerplant never offers or automatically installs a version older
|
|
158
|
+
than the one you have.
|
|
159
|
+
|
|
147
160
|
Powerplant also publishes the oldest version it still supports. When yours
|
|
148
161
|
is older, `powerplant status`, `powerplant doctor`, the menu bar app, and
|
|
149
162
|
the sync service log all say so and point you at `powerplant update`. Nothing
|
|
150
163
|
stops working on that notice — an unsupported version keeps syncing, but
|
|
151
164
|
it is no longer tested or fixed, so update when you see it.
|
|
152
165
|
|
|
153
|
-
### How a release reaches production
|
|
154
|
-
|
|
155
|
-
The same CLI package serves every environment. Staging, development, and
|
|
156
|
-
agent installs follow npm's `next` tag; enrolled production installs follow
|
|
157
|
-
the exact version promoted through the production API. Fresh installs
|
|
158
|
-
without a tag resolve npm's `latest`. Use a separate staging install below
|
|
159
|
-
to test `next` while keeping your production install on its promoted version.
|
|
160
|
-
|
|
161
|
-
1. **Release.** The "Release CLI to next" workflow (GitHub Actions,
|
|
162
|
-
manual) builds the CLI, signs and notarizes the menu bar app into the
|
|
163
|
-
package, and publishes to the `next` tag. Staging, development, and
|
|
164
|
-
agent installs with automatic updates enabled check at boot and hourly
|
|
165
|
-
while the service is running. Sleeping machines, disabled updates, and
|
|
166
|
-
failed installs can leave a machine behind. Verify the installed staging
|
|
167
|
-
version and exercise sync and the menu actions you changed before
|
|
168
|
-
promoting; elapsed time alone is not evidence of testing. Promote only
|
|
169
|
-
after the workflow's "Wait until npm serves the release" step is green:
|
|
170
|
-
npm's CDN caches the package document for about five minutes after a
|
|
171
|
-
publish, and a production machine that checks inside that window gets
|
|
172
|
-
"no matching version" and waits an hour to try again.
|
|
173
|
-
2. **Promote.** From a repo checkout with npm package access and `gh`
|
|
174
|
-
signed in, name the version you tested:
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
pnpm cli:promote:release 0.5.0
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
Or, if `next` still points at that tested version:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
pnpm cli:promote:release
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Omitting the version resolves `next` when the command runs.
|
|
187
|
-
The script moves npm's `latest` from your terminal, with your security
|
|
188
|
-
key in the browser (npm requires a live second factor for every
|
|
189
|
-
dist-tag move, so no CI credential can do this half), then dispatches
|
|
190
|
-
the Promote CLI workflow, which verifies the tag and points production
|
|
191
|
-
machines at the same artifact. The script watches the workflow; confirm
|
|
192
|
-
the pointer write succeeded before calling the promotion complete.
|
|
193
|
-
If the tag moved but that write failed, fresh installs are ahead of
|
|
194
|
-
enrolled machines. Re-dispatch **the same version**, then check that run:
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
gh workflow run promote-cli.yml -f version=0.5.0
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
A failed Slack announcement after a successful pointer write does not
|
|
201
|
-
undo promotion. Read the failed step before retrying.
|
|
202
|
-
3. **Adopt.** Running production services with automatic updates enabled
|
|
203
|
-
check for the promoted version at boot and hourly. Other users can
|
|
204
|
-
update from the menu bar or `powerplant update`; `powerplant status`
|
|
205
|
-
reports the available version. Until something is promoted, production
|
|
206
|
-
sees no update target, only the supported-version floor.
|
|
207
|
-
|
|
208
|
-
Promoting an older version is the brake: production holds there, `latest`
|
|
209
|
-
moves back for new installs, and no enrolled machine ever downgrades. A
|
|
210
|
-
bad release is undone by a new release and a new promotion.
|
|
211
|
-
|
|
212
|
-
### Staging beside production on one Mac
|
|
213
|
-
|
|
214
|
-
Use production for day-to-day team work. Staging is for testing enrollment,
|
|
215
|
-
onboarding, and releases. See the [internal machine setup guide](../../README.md#set-up-your-machine)
|
|
216
|
-
for access and data boundaries: running sync in both environments uploads
|
|
217
|
-
and processes eligible sessions twice.
|
|
218
|
-
|
|
219
|
-
A machine has one global `powerplant` by default, and the background sync
|
|
220
|
-
for each environment runs whatever copy `init` was run from. To try
|
|
221
|
-
releases on staging while production keeps the promoted version, give
|
|
222
|
-
staging its own copy under its own npm prefix and set it up from there:
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
npm install -g --prefix ~/.powerplant-staging @usepowerplant/cli@next
|
|
226
|
-
~/.powerplant-staging/bin/powerplant init --env staging
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
`init --env staging` registers its own MCP entry, `powerplant-staging`, in each
|
|
230
|
-
selected agent, beside the production `powerplant` entry. Agents see its tools
|
|
231
|
-
as `mcp__powerplant-staging__*`. A CLI older than this change registered
|
|
232
|
-
staging as `powerplant`: if that entry still points at staging, run a bare
|
|
233
|
-
`powerplant connect` from your production install once to restore it. Include
|
|
234
|
-
`--env staging` on every staging command.
|
|
235
|
-
|
|
236
|
-
The `@next` pin matters: a bare install resolves `latest`, the production
|
|
237
|
-
channel, so the new staging copy would start on the promoted release and
|
|
238
|
-
test nothing until its first update.
|
|
239
|
-
|
|
240
|
-
The staging daemon runs that copy and updates it in place (the updater
|
|
241
|
-
pins npm to the prefix the running copy lives under), so
|
|
242
|
-
`~/.powerplant-staging` follows the `next` channel while the production
|
|
243
|
-
install follows the promoted one. Run staging commands through that path,
|
|
244
|
-
`~/.powerplant-staging/bin/powerplant status --env staging`.
|
|
245
|
-
Use `~/.powerplant-staging/bin/powerplant update --env staging` to update
|
|
246
|
-
now, then `~/.powerplant-staging/bin/powerplant doctor --env staging` to
|
|
247
|
-
check the installed version, service, and install location.
|
|
248
|
-
|
|
249
|
-
### Menu bar apps during release testing
|
|
250
|
-
|
|
251
|
-
The npm package, including `@next`, contains **Powerplant.app**, the
|
|
252
|
-
production app. Only production `init` installs it and the production
|
|
253
|
-
service refreshes it after CLI updates. Staging `init` does neither.
|
|
254
|
-
|
|
255
|
-
Run **Powerplant Staging.app** separately, alongside production. Its icon
|
|
256
|
-
has an "S", and it uses the CLI at `~/.powerplant-staging/bin/powerplant`
|
|
257
|
-
when present. Follow the menu bar app's [local build instructions](../../apps/menubar/README.md#development)
|
|
258
|
-
or [signed release instructions](../../apps/menubar/README.md#release).
|
|
259
|
-
Rebuild or replace that staging app when testing native app changes;
|
|
260
|
-
updating the staging CLI does not update it. This tests the staging variant,
|
|
261
|
-
not the exact signed production bundle embedded in the npm package.
|
|
262
|
-
|
|
263
|
-
### Web and API promotion is separate
|
|
264
|
-
|
|
265
|
-
Merges to `main` deploy to staging automatically. The
|
|
266
|
-
[Promote to Production workflow](../../.github/workflows/promote.yml) can
|
|
267
|
-
promote the live staging API commit after its E2E check passes, with the
|
|
268
|
-
production schema and web build from that commit. Automatic runs happen
|
|
269
|
-
on CI completion and an hourly catch-up during weekdays, 09:00 to before
|
|
270
|
-
16:00 America/Vancouver, unless `AUTO_PROMOTE_PAUSED=true`. A manual
|
|
271
|
-
workflow dispatch can promote outside that window. Staging does not wait
|
|
272
|
-
indefinitely for manual QA. This workflow does not promote the CLI;
|
|
273
|
-
`pnpm cli:promote:release` does not deploy the web or API.
|
|
274
|
-
|
|
275
166
|
### Moving from @powerplant-sh/cli
|
|
276
167
|
|
|
277
168
|
Releases up to 0.2.1 were published as `@powerplant-sh/cli`. That package
|