@pingroom/cli 0.7.2 → 0.7.3
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 +41 -11
- package/bin/pingroom.js +22 -3016
- package/lib/commands/ask.js +146 -0
- package/lib/commands/config.js +114 -0
- package/lib/commands/connect.js +726 -0
- package/lib/commands/handoff.js +149 -0
- package/lib/commands/hook.js +301 -0
- package/lib/commands/listen.js +83 -0
- package/lib/commands/live.js +165 -0
- package/lib/commands/mcp.js +47 -0
- package/lib/commands/ping.js +123 -0
- package/lib/config.js +206 -0
- package/lib/constants.js +7 -0
- package/lib/github-output.js +76 -0
- package/lib/help.js +305 -0
- package/lib/http.js +214 -0
- package/lib/parser.js +214 -0
- package/lib/render.js +174 -0
- package/lib/util.js +105 -0
- package/lib/version.js +10 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -6,11 +6,6 @@ from CI, scripts, and agents. Delivered as push straight to your phone.
|
|
|
6
6
|
One dependency (`qrcode-terminal`, used only to draw the pairing QR). Works
|
|
7
7
|
anywhere Node ≥ 20 runs.
|
|
8
8
|
|
|
9
|
-
> **Release status:** 0.7.2 is prepared for publish — the room grant, the
|
|
10
|
-
> `attachments:write` scope `--attach` always needed, and actionable text on the
|
|
11
|
-
> refusals you can fix. The GitHub Action pins 0.7.2, so publish before relying
|
|
12
|
-
> on it.
|
|
13
|
-
|
|
14
9
|
## Install and first run
|
|
15
10
|
|
|
16
11
|
Install globally, then connect:
|
|
@@ -106,8 +101,9 @@ Approving on the phone grants two separate things, and both are enforced:
|
|
|
106
101
|
`handoffs:create`, `live:write`. Nothing widens them later; a command needing
|
|
107
102
|
one you did not approve returns `403 insufficient_scope`.
|
|
108
103
|
- **Rooms** — one room, several, or all of them. A room outside that grant
|
|
109
|
-
returns `403 room_not_granted` on
|
|
110
|
-
live streams
|
|
104
|
+
returns `403 room_not_granted` on every room-scoped call — writes such as
|
|
105
|
+
pings, questions and live streams, and reads such as listing a room's quick
|
|
106
|
+
actions or webhooks. Widen it under Connected Agents in the app.
|
|
111
107
|
|
|
112
108
|
Both refusals print the fix, not just the code. A credential paired by an older
|
|
113
109
|
CLI carries the scope set that version asked for — reconnect to re-approve if a
|
|
@@ -205,8 +201,9 @@ pingroom ping --token "$PINGROOM_TOKEN" --room AB12 -m "Nightly report" \
|
|
|
205
201
|
--attach ./report.pdf --attach ./summary.md
|
|
206
202
|
```
|
|
207
203
|
|
|
208
|
-
Accepted types are `md`, `pdf`, `html`, `txt`, `jpg`, `jpeg`, `png`, up to
|
|
209
|
-
5 MiB each and at most 4 per Ping.
|
|
204
|
+
Accepted types are `md`, `pdf`, `html`, `txt`, `jpg`, `jpeg`, `png`, `zip`, up to
|
|
205
|
+
5 MiB each and at most 4 per Ping. A `.zip` must be a real archive starting at
|
|
206
|
+
byte zero — the server rejects one with any payload prefixed to it. `--attach` needs an agent token — a webhook ping
|
|
210
207
|
has no uploader identity to bind private files to — and the bound account must
|
|
211
208
|
hold Pro (otherwise the upload fails with `pro_required`). An upload that never
|
|
212
209
|
reaches a ping expires by itself after 24 hours.
|
|
@@ -364,15 +361,48 @@ Full protocol: <https://pingroom.io/liveactivities.md>
|
|
|
364
361
|
message: 'Ship ${{ github.sha }} to production?'
|
|
365
362
|
handoff: 'true'
|
|
366
363
|
question: 'true'
|
|
367
|
-
options:
|
|
364
|
+
options: |
|
|
365
|
+
deploy:Deploy
|
|
366
|
+
hold:Hold
|
|
368
367
|
idempotency-key: 'deploy-${{ github.run_id }}'
|
|
369
368
|
wait: 'true'
|
|
370
369
|
- if: steps.gate.outputs.answer == 'deploy'
|
|
371
370
|
run: ./deploy-prod.sh
|
|
371
|
+
|
|
372
|
+
# Or ask the whole room instead of one person. Same outputs, plus question-id.
|
|
373
|
+
# Requires v0.7.3 or newer — see the note below before copying this block.
|
|
374
|
+
- id: env
|
|
375
|
+
uses: pingroom/cli@v0.7.3
|
|
376
|
+
with:
|
|
377
|
+
token: ${{ secrets.PINGROOM_TOKEN }}
|
|
378
|
+
room: ab12cd
|
|
379
|
+
ask: 'true'
|
|
380
|
+
message: 'Which environment?'
|
|
381
|
+
context: 'build ${{ github.run_number }}'
|
|
382
|
+
options: |
|
|
383
|
+
prod:Production
|
|
384
|
+
staging:Staging
|
|
385
|
+
wait: 'true'
|
|
372
386
|
```
|
|
373
387
|
|
|
388
|
+
### Version requirements
|
|
389
|
+
|
|
390
|
+
`ask`, `context`, `timeout`, `api` and the `question-id` output were added in
|
|
391
|
+
**v0.7.3**. Pin at least `pingroom/cli@v0.7.3` to use them. On an older pin —
|
|
392
|
+
including `@v0` before it is moved to v0.7.3 — GitHub treats them as unexpected
|
|
393
|
+
inputs, warns, and drops them; the step then falls through to the plain `ping`
|
|
394
|
+
path, `outputs.answer` is never set, and any job gated on it silently proceeds.
|
|
395
|
+
Everything else on this page (ping, `require-ack`, and the whole `handoff`
|
|
396
|
+
family) works on `@v0`.
|
|
397
|
+
|
|
398
|
+
`options` is one `value:label` per line. Trailing newlines are ignored first, so
|
|
399
|
+
a value that is a single line after trimming — including a one-line `options: |`
|
|
400
|
+
block — still splits on commas. A label that contains a comma must therefore be
|
|
401
|
+
written one-per-line.
|
|
402
|
+
|
|
374
403
|
The handoff action exposes outputs `handoff-id`, `state`, `acknowledged-by`,
|
|
375
|
-
`answer`, and `delivery-state
|
|
404
|
+
`answer`, and `delivery-state`; the ask action exposes `question-id`, `state`,
|
|
405
|
+
and `answer`. `api` overrides the API base URL for every mode.
|
|
376
406
|
|
|
377
407
|
## GitLab CI
|
|
378
408
|
|