@usepowerplant/cli 0.4.5 → 0.4.6
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 +93 -20
- package/dist/cli.js +739 -523
- package/dist/menubar/Powerplant.app.zip +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,26 +143,66 @@ it is no longer tested or fixed, so update when you see it.
|
|
|
143
143
|
|
|
144
144
|
### How a release reaches production
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
146
|
+
The same CLI package serves every environment. Staging, development, and
|
|
147
|
+
agent installs follow npm's `next` tag; enrolled production installs follow
|
|
148
|
+
the exact version promoted through the production API. Fresh installs
|
|
149
|
+
without a tag resolve npm's `latest`. Use a separate staging install below
|
|
150
|
+
to test `next` while keeping your production install on its promoted version.
|
|
151
|
+
|
|
152
|
+
1. **Release.** The "Release CLI to next" workflow (GitHub Actions,
|
|
153
|
+
manual) builds the CLI, signs and notarizes the menu bar app into the
|
|
154
|
+
package, and publishes to the `next` tag. Staging, development, and
|
|
155
|
+
agent installs with automatic updates enabled check at boot and hourly
|
|
156
|
+
while the service is running. Sleeping machines, disabled updates, and
|
|
157
|
+
failed installs can leave a machine behind. Verify the installed staging
|
|
158
|
+
version and exercise sync and the menu actions you changed before
|
|
159
|
+
promoting; elapsed time alone is not evidence of testing.
|
|
160
|
+
2. **Promote.** From a repo checkout with npm package access and `gh`
|
|
161
|
+
signed in, name the version you tested:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
pnpm cli:promote:release 0.5.0
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Or, if `next` still points at that tested version:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
pnpm cli:promote:release
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Omitting the version resolves `next` when the command runs.
|
|
174
|
+
The script moves npm's `latest` from your terminal, with your security
|
|
175
|
+
key in the browser (npm requires a live second factor for every
|
|
176
|
+
dist-tag move, so no CI credential can do this half), then dispatches
|
|
177
|
+
the Promote CLI workflow, which verifies the tag and points production
|
|
178
|
+
machines at the same artifact. The script watches the workflow; confirm
|
|
179
|
+
the pointer write succeeded before calling the promotion complete.
|
|
180
|
+
If the tag moved but that write failed, fresh installs are ahead of
|
|
181
|
+
enrolled machines. Re-dispatch **the same version**, then check that run:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
gh workflow run promote-cli.yml -f version=0.5.0
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
A failed Slack announcement after a successful pointer write does not
|
|
188
|
+
undo promotion. Read the failed step before retrying.
|
|
189
|
+
3. **Adopt.** Running production services with automatic updates enabled
|
|
190
|
+
check for the promoted version at boot and hourly. Other users can
|
|
191
|
+
update from the menu bar or `powerplant update`; `powerplant status`
|
|
192
|
+
reports the available version. Until something is promoted, production
|
|
193
|
+
sees no update target, only the supported-version floor.
|
|
194
|
+
|
|
195
|
+
Promoting an older version is the brake: production holds there, `latest`
|
|
196
|
+
moves back for new installs, and no enrolled machine ever downgrades. A
|
|
197
|
+
bad release is undone by a new release and a new promotion.
|
|
163
198
|
|
|
164
199
|
### Staging beside production on one Mac
|
|
165
200
|
|
|
201
|
+
Use production for day-to-day team work. Staging is for testing enrollment,
|
|
202
|
+
onboarding, and releases. See the [internal machine setup guide](../../README.md#set-up-your-machine)
|
|
203
|
+
for access and data boundaries: running sync in both environments uploads
|
|
204
|
+
and processes eligible sessions twice.
|
|
205
|
+
|
|
166
206
|
A machine has one global `powerplant` by default, and the background sync
|
|
167
207
|
for each environment runs whatever copy `init` was run from. To try
|
|
168
208
|
releases on staging while production keeps the promoted version, give
|
|
@@ -173,6 +213,12 @@ npm install -g --prefix ~/.powerplant-staging @usepowerplant/cli@next
|
|
|
173
213
|
~/.powerplant-staging/bin/powerplant init --env staging
|
|
174
214
|
```
|
|
175
215
|
|
|
216
|
+
`init --env staging` also points each selected agent's shared `powerplant`
|
|
217
|
+
MCP connection at staging. Separate npm prefixes do not isolate that entry.
|
|
218
|
+
After testing, run `powerplant connect` from your production install to
|
|
219
|
+
restore the agents' production connection; the staging sync service keeps
|
|
220
|
+
running. Include `--env staging` on every staging command.
|
|
221
|
+
|
|
176
222
|
The `@next` pin matters: a bare install resolves `latest`, the production
|
|
177
223
|
channel, so the new staging copy would start on the promoted release and
|
|
178
224
|
test nothing until its first update.
|
|
@@ -181,9 +227,36 @@ The staging daemon runs that copy and updates it in place (the updater
|
|
|
181
227
|
pins npm to the prefix the running copy lives under), so
|
|
182
228
|
`~/.powerplant-staging` follows the `next` channel while the production
|
|
183
229
|
install follows the promoted one. Run staging commands through that path,
|
|
184
|
-
`~/.powerplant-staging/bin/powerplant status --env staging
|
|
185
|
-
|
|
186
|
-
|
|
230
|
+
`~/.powerplant-staging/bin/powerplant status --env staging`.
|
|
231
|
+
Use `~/.powerplant-staging/bin/powerplant update --env staging` to update
|
|
232
|
+
now, then `~/.powerplant-staging/bin/powerplant doctor --env staging` to
|
|
233
|
+
check the installed version, service, and install location.
|
|
234
|
+
|
|
235
|
+
### Menu bar apps during release testing
|
|
236
|
+
|
|
237
|
+
The npm package, including `@next`, contains **Powerplant.app**, the
|
|
238
|
+
production app. Only production `init` installs it and the production
|
|
239
|
+
service refreshes it after CLI updates. Staging `init` does neither.
|
|
240
|
+
|
|
241
|
+
Run **Powerplant Staging.app** separately, alongside production. Its icon
|
|
242
|
+
has an "S", and it uses the CLI at `~/.powerplant-staging/bin/powerplant`
|
|
243
|
+
when present. Follow the menu bar app's [local build instructions](../../apps/menubar/README.md#development)
|
|
244
|
+
or [signed release instructions](../../apps/menubar/README.md#release).
|
|
245
|
+
Rebuild or replace that staging app when testing native app changes;
|
|
246
|
+
updating the staging CLI does not update it. This tests the staging variant,
|
|
247
|
+
not the exact signed production bundle embedded in the npm package.
|
|
248
|
+
|
|
249
|
+
### Web and API promotion is separate
|
|
250
|
+
|
|
251
|
+
Merges to `main` deploy to staging automatically. The
|
|
252
|
+
[Promote to Production workflow](../../.github/workflows/promote.yml) can
|
|
253
|
+
promote the live staging API commit after its E2E check passes, with the
|
|
254
|
+
production schema and web build from that commit. Automatic runs happen
|
|
255
|
+
on CI completion and an hourly catch-up during weekdays, 09:00 to before
|
|
256
|
+
16:00 America/Vancouver, unless `AUTO_PROMOTE_PAUSED=true`. A manual
|
|
257
|
+
workflow dispatch can promote outside that window. Staging does not wait
|
|
258
|
+
indefinitely for manual QA. This workflow does not promote the CLI;
|
|
259
|
+
`pnpm cli:promote:release` does not deploy the web or API.
|
|
187
260
|
|
|
188
261
|
### Moving from @powerplant-sh/cli
|
|
189
262
|
|