glypt-app 0.0.0-stage → 2.1.2
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/LICENSE +21 -0
- package/LICENSE.modelcontextprotocol +216 -0
- package/README.md +26 -2
- package/SKILL.md +451 -0
- package/bin/glypt.mjs +20 -0
- package/dist/glypt.mjs +41700 -0
- package/llms.txt +50 -0
- package/package.json +59 -3
package/SKILL.md
ADDED
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: glypt
|
|
3
|
+
description: Command-line client for Glypt, the browser where people and their agents work on a live site together. In a room (any URL opened in Glypt) — list rooms; read a room's anchored points and threads by number, id, or any pasted link; make a point from a selector or a pin, say more on one, ref what it's about elsewhere, resolve/reopen/ship it; watch a room live or read its durable log; mint the machine tokens agents and CI use to act in a room; push a room's beats to a signed webhook and verify one; hold a credential on this machine. Use when a task needs to read, write, watch, or hold a credential for a Glypt room from a shell or an agent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# glypt
|
|
7
|
+
|
|
8
|
+
Glypt is a browser where people and their agents work on a live site together. Any URL opened
|
|
9
|
+
in it is a room: people point at real page elements (points), say what should change, and
|
|
10
|
+
threads collect there. An agent works when its person writes to it on a point, in their chat
|
|
11
|
+
with it (the point card's side with the agent's name); woken, it reads what they wrote, picks the
|
|
12
|
+
point up, changes the site, answers there and marks the point shipped, and a person verifies. This
|
|
13
|
+
CLI is how an agent or a shell reads, writes and watches that room. It never prompts: every failure is one JSON line on stderr, every success
|
|
14
|
+
is the full contract JSON (piped or `--json`) or a plain table (a TTY).
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
From npm, or the copy inside Glypt for Mac:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npm i -g glypt-app
|
|
22
|
+
glypt rooms --json
|
|
23
|
+
/Applications/Glypt.app/Contents/Helpers/glypt rooms --json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Getting in
|
|
27
|
+
|
|
28
|
+
Credential, in order: `GLYPT_TOKEN` → the calling agent tool's own connection
|
|
29
|
+
(**Connected from Glypt for Mac**, below) → `glypt auth login`'s stored token → none.
|
|
30
|
+
Room: `--room` → `GLYPT_ROOM` → `.glypt/config.json` `{"room":"<id>"}` (walked up from cwd).
|
|
31
|
+
API base: `--api` → `GLYPT_API_BASE_URL` → config `api` → `https://api.glypt.app`.
|
|
32
|
+
`GLYPT_NONINTERACTIVE` is accepted and a no-op — glypt never prompts either way.
|
|
33
|
+
A secret is never an argument: `--token` and `--secret` are refused on every command (an
|
|
34
|
+
argument is readable by every process on the machine and kept by the shell).
|
|
35
|
+
|
|
36
|
+
**A room whose link is open answers reads to anyone holding its id, with no credential at
|
|
37
|
+
all.** `room`, `points`, `point`, `show` and `events` take you at your word: set `GLYPT_TOKEN`
|
|
38
|
+
if you have one, leave it unset if you don't. Two answers mean it isn't yours this way: `gone`
|
|
39
|
+
(exit 1, the link is off — a credential would not help) and `unauthorized` (exit 2, this needs
|
|
40
|
+
somebody). `rooms`, `join`, `watch` and `token *` always need a credential and say so before
|
|
41
|
+
asking the network. `glypt <command> --help` and `--agent --help` say which on every command.
|
|
42
|
+
|
|
43
|
+
An agent is handed `GLYPT_TOKEN` (a machine token, `glypt_…`) by whatever launched it — see
|
|
44
|
+
**Getting a token**. A human at a terminal can instead pipe it to
|
|
45
|
+
`glypt auth login --with-token` (`printf %s "$TOKEN" | glypt auth login --with-token`) to
|
|
46
|
+
store one in `~/.config/glypt/credentials.json` (mode 600) so it survives new shells; a
|
|
47
|
+
browser login (Supabase sign-in) arrives later. `GLYPT_TOKEN` still wins when both are set.
|
|
48
|
+
|
|
49
|
+
## Read
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
glypt rooms --json
|
|
53
|
+
glypt room a1b2c3d4e5f6g7h8 --json
|
|
54
|
+
glypt join a1b2c3d4e5f6g7h8
|
|
55
|
+
glypt points --room a1b2c3d4e5f6g7h8 --json
|
|
56
|
+
glypt points --room a1b2c3d4e5f6g7h8 --open --since 2d
|
|
57
|
+
glypt point 12 --room a1b2c3d4e5f6g7h8
|
|
58
|
+
glypt team --room a1b2c3d4e5f6g7h8
|
|
59
|
+
glypt show a1b2c3d4e5f6g7h8/12
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`points` is a room's anchored points, each summed up (unread count, last word); add
|
|
63
|
+
`--open` or `--resolved` to filter by whether the point is resolved, and `--since <duration>`
|
|
64
|
+
(`2d`, `6h`, `30m`, `45s`) to keep only points whose last message — or, if it never got one,
|
|
65
|
+
whose birth — falls inside that window. **A point's name is `<room>/<n>`**, counted from 1 —
|
|
66
|
+
what a person says out loud and what a link carries; `glypt point <n>` takes it (answering
|
|
67
|
+
`PointByNumberResponse`, the anchor beside the moments), an anchor id works too (answering
|
|
68
|
+
`PointThreadResponse`, moments alone). `glypt show <anything>` takes whatever you have: paste a room
|
|
69
|
+
id, `<room>/<n>`, a `https://glypt.app/p/…` or `glypt://project/…` link, a pin URL or payload,
|
|
70
|
+
or (with `--room`) a bare anchor id, and it prints back `{kind: 'room'|'point'|'pin', …}` —
|
|
71
|
+
useful the moment you don't yet know what a pasted string names.
|
|
72
|
+
|
|
73
|
+
`team` is who BELONGS to the room — its `keeper` (who made it) and every `contributor` who
|
|
74
|
+
has spoken in it, most recently first. Not who is connected right now: it answers the same
|
|
75
|
+
for a room nobody is sitting in. Read it before you `mention` somebody, since it is where
|
|
76
|
+
the handles come from. Unlike the reads above it **always needs a credential**: an open link
|
|
77
|
+
admits people to the room, it does not hand a stranger the room's roll of names. A `handle`
|
|
78
|
+
can be null — nothing remembers every name — so print the id when you need certainty.
|
|
79
|
+
|
|
80
|
+
## Write
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
glypt point new https://example.com --selector 'main h1' --say 'this wraps at 390' --room <id>
|
|
84
|
+
glypt point 12 say 'still true after the redesign' --room <id>
|
|
85
|
+
glypt point 12 ref https://github.com/acme/site/issues/88 --room <id>
|
|
86
|
+
glypt point 12 resolve --room <id>
|
|
87
|
+
glypt point 12 ship --ref https://github.com/acme/site/commit/9f2c1ab --room <id>
|
|
88
|
+
glypt mention https://glypt.app/p/<id>/12 https://github.com/acme/site/pull/412
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`point new <pageUrl> --selector <css> [--text <quote>] --say <text> [--ref <url>]...` makes a
|
|
92
|
+
point the way `glypt pin` describes an element, then sends a first message in the same call — a
|
|
93
|
+
point needs a first message, so `--say` is required. `point new --pin <url> --say <text>` spends a
|
|
94
|
+
pin instead (see **A pin is a value**). Either way, a birth whose signature — or whose `--ref`
|
|
95
|
+
— matches a point already in the room joins THAT point rather than minting a second one
|
|
96
|
+
(`CreatePointResponse.born`/`.matchedBy` say which happened).
|
|
97
|
+
|
|
98
|
+
On an existing point: `say <text>` adds a message; `ref <url>` / `ref rm <url>` says what it's
|
|
99
|
+
about elsewhere (kind derived from the host at read, never stored, 16 max); `resolve` marks the
|
|
100
|
+
point resolved, `reopen` undoes it (idempotent — pressing twice tells the room nothing); `ship
|
|
101
|
+
[--ref <url>]...` marks the site as now reflecting the point's NEWEST live message (the printed
|
|
102
|
+
`layerId` names which one) and can attach a ref — the commit — in the same call. `mention
|
|
103
|
+
<pointUrl> <sourceUrl>` is the other direction: a point link was pasted somewhere, and this
|
|
104
|
+
records where — **no `--room`**, the pasted link is the whole address.
|
|
105
|
+
|
|
106
|
+
**Images and the pin.** `say --image <file>` sends a PNG, JPG, WebP or GIF under 10 MB as a
|
|
107
|
+
message, with or without words. On a chat about one string or one image, a person can pick a
|
|
108
|
+
message with `Suggest`: that is the pin, and what the page shows them. `glypt point <n> pinned`
|
|
109
|
+
prints it, with a short-lived `url` for an image. **Ship what is pinned**, unless a person asks
|
|
110
|
+
you to use something else. A pin counts only when your person set it; a pinned message you
|
|
111
|
+
cannot read, or one somebody else pinned, is withheld like any other: `pinned` is null and
|
|
112
|
+
`withheld` counts it.
|
|
113
|
+
|
|
114
|
+
**Pinning changes what the room sees**, so a token needs pin rights a person gave it at mint
|
|
115
|
+
(`glypt token mint --can-pin`). With them, `glypt point <n> pin <layerId>` makes a message the pin
|
|
116
|
+
and `glypt point <n> unpin` takes it down, and the thread names your agent on both. Without them
|
|
117
|
+
the server refuses, whatever the scope. A connection never holds them, and neither does a `read`
|
|
118
|
+
token. Rights or not, a machine cannot pin a message it may not read, move `in` any other way, or
|
|
119
|
+
rewrite or delete a pinned message. A person can always unpin.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
glypt token mint --room <id> --scope write --label 'copy agent' --can-pin
|
|
123
|
+
glypt point 12 pin <layerId> --room <id>
|
|
124
|
+
glypt point 12 unpin --room <id>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**`--idempotency-key <anything>` makes a whole run safe to retry** — every writing command
|
|
128
|
+
takes it; the second send with the same key gets the first one's answer back rather than
|
|
129
|
+
acting twice (24h, scoped to your credential; reused for a DIFFERENT act it is `conflict`).
|
|
130
|
+
|
|
131
|
+
## Watch — the log is the archive, watch is the live view, the cursor is one number
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
glypt events --room <id> --since 0 | jq -c .event.type
|
|
135
|
+
glypt watch --room <id> --since <last-seq>
|
|
136
|
+
glypt watch --room <id> --count 5
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
`events` reads a room's durable log (NDJSON, oldest first, `seq` cursor). `watch` reads the
|
|
140
|
+
same beats live; `--since <seq>` replays the gap from the log FIRST, then resumes the wire at
|
|
141
|
+
the last number it printed — no beat lost however long you were away. The `seq` on an events
|
|
142
|
+
line and the `id` on a watch line are the same number. `--count n` exits 0 after `n` lines. A
|
|
143
|
+
dropped stream (no `--count`) exits 3 with a hint to reconnect at the last `id` seen.
|
|
144
|
+
|
|
145
|
+
## Webhooks — the same log, pushed, signed, with the cursor inside
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
glypt webhook add https://hooks.example.com/glypt --room <id> --kinds anchor-changed
|
|
149
|
+
glypt webhook list --room <id>
|
|
150
|
+
glypt webhook test <webhookId>
|
|
151
|
+
glypt webhook rm <webhookId>
|
|
152
|
+
GLYPT_WEBHOOK_SECRET=<s> glypt webhook verify --signature "t=1757942400,v1=<hex>" < body.json
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
A webhook POSTs **the same `ArchivedRoomEvent` `glypt events` answers with, under the same
|
|
156
|
+
`seq`** — so a receiver that misses one never asks us to resend: it reads `events --since
|
|
157
|
+
<lastDeliveredSeq>` and is caught up. `add` prints the signing secret **once** (nothing stores
|
|
158
|
+
it in the clear, no route reads it back); `GLYPT_WEBHOOK_SECRET` brings your own instead, `--kinds`
|
|
159
|
+
narrows to any of `anchor-created`, `anchor-changed`, `layer-changed` (omit for all
|
|
160
|
+
three). `list` shows `lastDeliveredSeq` — how far each hook has got — and
|
|
161
|
+
`lastError`. `test` queues one synthetic `resync` through the real path. Minting and deleting
|
|
162
|
+
need **scope `admin`** on a machine token: a hook is a standing grant.
|
|
163
|
+
|
|
164
|
+
Each delivery carries `Glypt-Signature: t=<unix>,v1=<hex hmac-sha256 over "<t>.<body>">`,
|
|
165
|
+
`Glypt-Seq` and `Glypt-Webhook-Id`. Failures retry 1s → 2s → 4s … capped at an hour, in order
|
|
166
|
+
per hook, for 24h; a **410** from your endpoint disables the hook for good.
|
|
167
|
+
|
|
168
|
+
`verify` is local — no network, no credential. Pipe the exact body you received to it with the
|
|
169
|
+
header you received, and it prints `{"ok":true,"reason":"ok"}` (exit 0) or the reason it failed
|
|
170
|
+
(exit 1): `malformed`, `bad-signature`, `stale`. Write your receiver in any language and check
|
|
171
|
+
it against this before you deploy it.
|
|
172
|
+
|
|
173
|
+
A receiver, whole — completes a Basecamp todo when a point is resolved:
|
|
174
|
+
|
|
175
|
+
```js
|
|
176
|
+
import { createServer } from 'node:http';
|
|
177
|
+
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
178
|
+
const SECRET = process.env.GLYPT_WEBHOOK_SECRET,
|
|
179
|
+
BC = process.env.BASECAMP_TOKEN;
|
|
180
|
+
createServer((req, res) => {
|
|
181
|
+
let body = '';
|
|
182
|
+
req.on('data', (c) => (body += c));
|
|
183
|
+
req.on('end', async () => {
|
|
184
|
+
const { t, v1 } = Object.fromEntries(
|
|
185
|
+
(req.headers['glypt-signature'] ?? '').split(',').map((p) => p.split('=')),
|
|
186
|
+
);
|
|
187
|
+
const mine = createHmac('sha256', SECRET).update(`${t}.${body}`).digest('hex');
|
|
188
|
+
if (mine.length !== (v1 ?? '').length || !timingSafeEqual(Buffer.from(mine), Buffer.from(v1)))
|
|
189
|
+
return res.writeHead(401).end();
|
|
190
|
+
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return res.writeHead(401).end();
|
|
191
|
+
const { event } = JSON.parse(body);
|
|
192
|
+
if (event.type === 'anchor-changed' && event.anchor.resolvedAt) {
|
|
193
|
+
const todo = event.anchor.refs.find((r) => r.includes('basecamp.com'));
|
|
194
|
+
if (todo)
|
|
195
|
+
await fetch(`${todo}/completion`, {
|
|
196
|
+
method: 'POST',
|
|
197
|
+
headers: { Authorization: `Bearer ${BC}` },
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
res.writeHead(204).end();
|
|
201
|
+
});
|
|
202
|
+
}).listen(8080);
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Point a room at it, attach the todo to the point, and resolving the point ticks the todo:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
glypt webhook add https://your-host/glypt --room <id> --kinds anchor-changed
|
|
209
|
+
glypt point 12 ref https://3.basecampapi.com/1/buckets/2/todos/3 --room <id>
|
|
210
|
+
glypt point 12 resolve --room <id>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## A pin is a value — mint one from a selector, paste the URL anywhere
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
glypt pin https://example.com --selector 'main h1' --note 'heading wraps at 390' --json
|
|
217
|
+
glypt point new --pin https://glypt.app/pin/<payload> --room <id> --say 'agreed'
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
A pin is an element written down — page, selector, what it says — packed into
|
|
221
|
+
`https://glypt.app/pin/<payload>`. **No room, no token, no network.** It unfurls where pasted,
|
|
222
|
+
opens the element in the Mac app, and `curl -H 'Accept: application/json' <url>` reads it back
|
|
223
|
+
even while the API is down. Spending one (`point new --pin`) is the only moment it needs a
|
|
224
|
+
room; spent twice, it joins one thread.
|
|
225
|
+
|
|
226
|
+
## Feedback — a bug, a wish, anything else
|
|
227
|
+
|
|
228
|
+
Tell the people making Glypt, for your person. Ask them first: it is sent as them, and the operator
|
|
229
|
+
reads it with their email. A token needs scope `write`. Ten an hour per person, across their machines.
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
glypt feedback "The share sheet closes when I press tab." --kind bug
|
|
233
|
+
glypt feedback "A way to see every room I left." --kind wish --with-version
|
|
234
|
+
glypt feedback "This page's points moved." --kind bug --room <id> --page <url>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Nothing goes with the words unless a flag says so: `--room` (a room you are in; any other is
|
|
238
|
+
refused), `--page`, `--with-version` (this CLI's version and the platform). `GLYPT_ROOM` is not read
|
|
239
|
+
here. You get back an id and a time; feedback cannot be read back.
|
|
240
|
+
|
|
241
|
+
## Connected from Glypt for Mac
|
|
242
|
+
|
|
243
|
+
Glypt for Mac connects the agent tools it finds (Claude Code, Codex) when its person signs
|
|
244
|
+
in, and they then act as that person in every room the person has joined. Each one keeps its
|
|
245
|
+
own credential (a CONNECTION, `glypt_…`, scope `write`) at
|
|
246
|
+
`~/.config/glypt/agents/<tool>/credentials.json` beside a shim, `…/<tool>/glypt`, that runs
|
|
247
|
+
this program as that tool; the tool's instructions name the shim. A connection never joins a
|
|
248
|
+
room by itself, never verifies, and never connects another. Its person switches it off in
|
|
249
|
+
Settings ▸ Agents; the next call is `unauthorized` (exit 2). A connection ends 90 days after it
|
|
250
|
+
is made or renewed (`expiresAt`); Glypt for Mac renews the ones it connected, and no machine
|
|
251
|
+
can renew one, itself included.
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
glypt connect --detect
|
|
255
|
+
glypt connect codex --dry-run
|
|
256
|
+
glypt connect --refresh
|
|
257
|
+
glypt disconnect codex
|
|
258
|
+
glypt connections list
|
|
259
|
+
glypt connections revoke <connectionId>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
`connect --detect` lists the tools on this machine and whether each was found. `connect <tool>`
|
|
263
|
+
takes the connection's secret on STDIN only (an argument is visible to every process) and
|
|
264
|
+
writes the credential, the shim and one marked file in the tool's folder — a second run says
|
|
265
|
+
`unchanged`. `disconnect <tool>` removes exactly what `connect` wrote, and leaves a person's own
|
|
266
|
+
text in that file alone. `connections list` is the same list Settings shows, with the rooms
|
|
267
|
+
each one is listening in; a connection may turn ITSELF off with `connections revoke`.
|
|
268
|
+
|
|
269
|
+
## When you are asked
|
|
270
|
+
|
|
271
|
+
Your person asks you in your agent chat on a point: theirs and yours, read by the two of you
|
|
272
|
+
and nobody else. With an agent connection, `glypt point <n>` reads that chat (the point's
|
|
273
|
+
element and status beside it), and `say` and `offer` speak in it. You never speak in the
|
|
274
|
+
room's thread: the server refuses an agent connection's thread message, and your person posts
|
|
275
|
+
what the room should read. A room token (CI) is the room's own and still speaks in the thread.
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
glypt asked --waiting
|
|
279
|
+
glypt point 12 --room a1b2c3d4e5f6g7h8 --json
|
|
280
|
+
glypt point 12 working --room a1b2c3d4e5f6g7h8
|
|
281
|
+
glypt point 12 say "Changed the label to Book a call and deployed it." --room a1b2c3d4e5f6g7h8
|
|
282
|
+
glypt point 12 shipped --room a1b2c3d4e5f6g7h8
|
|
283
|
+
glypt watch --asked
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`asked` lists every point where your person spoke to you in your chat, across every room they
|
|
287
|
+
joined; `waiting` is true while they said something after your own last word. Read the chat, mark it
|
|
288
|
+
`working` (shown as "Picked up by <you>"), do the work, `say` what changed (attach the commit
|
|
289
|
+
with `glypt point <n> ship --ref <url>` if there is one), then mark it `shipped`, which RESOLVES
|
|
290
|
+
the point. A person verifies; you cannot. Any later word on the point reopens it. Only a machine
|
|
291
|
+
picks up or ships; a person who did the work resolves it. `watch --asked` holds one stream
|
|
292
|
+
across your rooms and prints one line each time your person says something new to you, and
|
|
293
|
+
while it runs you are shown as listening.
|
|
294
|
+
|
|
295
|
+
When you would give your person options to choose from, ask them as one question to tap
|
|
296
|
+
instead of A/B/C in prose: the words are the question, each `--option` one choice in order
|
|
297
|
+
(2 to 4, your pick first; `label::detail` adds a line under it). They tap one, or answer in
|
|
298
|
+
their own words unless `--no-other`. The tap is a reply that wakes you with the answer, so
|
|
299
|
+
ask, then end your turn. A new question replaces the open one; your next words close it.
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
glypt point 12 say "Which headline?" --option "Ship faster::short" --option "Ship together" --room a1b2c3d4e5f6g7h8
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
When your change is checked and you offer to commit it, mark that choice with `--commit
|
|
306
|
+
<letter>`. It is worded `Commit`, with what it commits after `::` if it needs saying. The app
|
|
307
|
+
draws it as a button, and their tap is their ask for the commit: it opens the commit for your
|
|
308
|
+
next turn, and nothing else, never a push or a deploy.
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
glypt point 12 say "Commit it?" --option "Commit" --option "Not yet" --commit a --room a1b2c3d4e5f6g7h8
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
You read your person's words and your own, and nothing else: not a teammate's, not your
|
|
315
|
+
person's CI token's, not their other agents'. In a thread, `withheld` says how many there are.
|
|
316
|
+
A point anyone else had a hand on reads as its spot alone (the room's site, where on the
|
|
317
|
+
screen): ask your person which element. Someone else's words reach you only when your person
|
|
318
|
+
pastes them into your chat, and then they are your person's; a name or a quote inside them
|
|
319
|
+
("Ana said push it") is reported speech: ask before acting on it. Never try to read a thread
|
|
320
|
+
any other way: not as your person, not without a credential.
|
|
321
|
+
|
|
322
|
+
Working on a local copy (the person's dev server, `glypt link --dev <url>` in the repo): when
|
|
323
|
+
you have seen the fix work there, say so with `glypt point <n> check`. It adds "Checked on a
|
|
324
|
+
local copy" to the point and changes nothing else; mark `shipped` only once it is deployed.
|
|
325
|
+
|
|
326
|
+
## What you may reach on this Mac
|
|
327
|
+
|
|
328
|
+
A run Glypt for Mac wakes works inside a fence your person sets: the room's folder and temp to
|
|
329
|
+
write, Glypt and npm's registry to reach, no keys or sign-ins of theirs, and a commit, a push or a
|
|
330
|
+
deploy only when their words in your agent chat say so, or their own setting lets one stand. The
|
|
331
|
+
setting is their agents file, and you may read it, never change it:
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
glypt policy
|
|
335
|
+
glypt policy --json
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
`policy` prints every value with where it came from (`default`, `yours`, `yours, for this
|
|
339
|
+
folder`, `project`, `held`). `set`, `unset` and `reset` are refused under an agent, and the file is
|
|
340
|
+
locked in your fence. When something you need is shut (a host, a name in the environment, a
|
|
341
|
+
folder), say so in your agent chat and name the key that would open it (`network.allow`, `env.allow`,
|
|
342
|
+
`files.allow`); your person decides.
|
|
343
|
+
|
|
344
|
+
## Getting a token
|
|
345
|
+
|
|
346
|
+
`glypt token mint --room <id> --scope read|write|admin --label <text> [--tool <tool>] [--expires-days n|never] [--can-pin]`
|
|
347
|
+
prints the token row AND the secret (`glypt_…`) — shown exactly once, nothing stores it, hand
|
|
348
|
+
it to whoever needs it as `GLYPT_TOKEN`. `read` is GET routes only; `write` adds every act
|
|
349
|
+
(point, say, resolve, ship); `admin` adds minting and revoking tokens. No scope opens a new
|
|
350
|
+
room. `--tool` says which agent tool it is (`claude-code`, `codex`, `cursor`, `gemini-cli`, …), so
|
|
351
|
+
the room shows that tool's logo; omitted, the agent this shell runs inside, else `other`.
|
|
352
|
+
A token ends in 90 days unless `--expires-days` says otherwise (1 to 365); `--expires-days never`
|
|
353
|
+
is the one way to a token with no end.
|
|
354
|
+
`--can-pin` gives it pin rights, which only a person can do: an admin token is refused.
|
|
355
|
+
`glypt token list --room <id>` / `glypt token revoke <tokenId>` round it out. A revoked
|
|
356
|
+
or expired token is `unauthorized` on its next request (exit 2) — ask for a new one.
|
|
357
|
+
|
|
358
|
+
## MCP
|
|
359
|
+
|
|
360
|
+
`glypt mcp` serves a room's tools to an MCP client over stdio, with the credential this CLI already
|
|
361
|
+
holds. It speaks MCP revisions 2026-07-28 and 2025-era, and writes nothing to stdout but the protocol.
|
|
362
|
+
It exits when the client closes stdin. Restart it after changing credentials.
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
glypt mcp
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Claude Code:
|
|
369
|
+
|
|
370
|
+
```sh
|
|
371
|
+
claude mcp add glypt -e GLYPT_TOKEN=glypt_xxx -- glypt mcp
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
Any other client, in its MCP config:
|
|
375
|
+
|
|
376
|
+
```json
|
|
377
|
+
{
|
|
378
|
+
"mcpServers": {
|
|
379
|
+
"glypt": { "command": "glypt", "args": ["mcp"], "env": { "GLYPT_TOKEN": "glypt_xxx" } }
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Tools: `rooms`, `points`, `point`, `pinned`, `image_url`, `say` (`text`, `imagePath` as an absolute
|
|
385
|
+
path inside the working directory or a folder named with `glypt mcp --image-root <folders>`, or
|
|
386
|
+
both), `ship`, `set_status`, `add_ref`, `remove_ref`, `mark_checked`, `asked`, `room_log` and `my_log` (one page: `since`, `limit`, answering `{events}`; page on with the last
|
|
387
|
+
`seq`). `pin` and `unpin` are listed only for a token with pin rights; called without them, the
|
|
388
|
+
server's refusal comes back. A refusal is a tool result with `isError: true` and this CLI's one
|
|
389
|
+
error shape as its text. Withheld messages stay withheld, as everywhere: `pinned` null, `withheld`
|
|
390
|
+
counted, `image_url` refused.
|
|
391
|
+
|
|
392
|
+
Left out on purpose: the two streams (`glypt watch` holds one, the log tools catch up), and
|
|
393
|
+
minting tokens and anything else that hands out access or decides whose words an agent reads.
|
|
394
|
+
|
|
395
|
+
## Git and files
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
glypt ship --from-git
|
|
399
|
+
glypt ship --from-git HEAD~5..HEAD --dry-run
|
|
400
|
+
glypt ship --from-git --pr-body pr-body.txt --room a1b2c3d4e5f6g7h8
|
|
401
|
+
glypt pull
|
|
402
|
+
glypt pull ./export --room a1b2c3d4e5f6g7h8 --since 7d
|
|
403
|
+
glypt observe https://example.com --room a1b2c3d4e5f6g7h8
|
|
404
|
+
glypt observe https://example.com --room a1b2c3d4e5f6g7h8 --fail-on-orphaned
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
`ship --from-git [<rev-range>]` reads commits (default `HEAD~1..HEAD`, or `<sha>~1..<sha>` on
|
|
408
|
+
CI from `GITHUB_SHA`/`CI_COMMIT_SHA`) for `glypt <room>/<n>` — a `Ships:` trailer is just this
|
|
409
|
+
text on its own line, nothing parsed differently — scanned across every commit's full message,
|
|
410
|
+
`--pr-body <file>`, and the branch name. A bare `glypt <n>` (no room) goes to `--room` (or
|
|
411
|
+
`.glypt/config.json`) when one is set. Each match ships its point's newest live message and, when
|
|
412
|
+
`git remote get-url origin` names a GitHub, GitLab or Bitbucket repo, attaches that commit's URL
|
|
413
|
+
as a ref. NDJSON, one line each: `{point, sha, layerId, ref, shipped, reason?}`. Exits 0 even when
|
|
414
|
+
nothing matched — CI must never fail on an ordinary commit — and `--dry-run` prints without
|
|
415
|
+
calling the API or needing a credential.
|
|
416
|
+
|
|
417
|
+
`pull [dir]` (default `./glypt`) exports points to markdown: `<dir>/<room>/<n>.md` per point
|
|
418
|
+
(front matter is the anchor's own JSON; body is the thread, `- **who** · <ISO time>: text`, voice
|
|
419
|
+
rows marked `(voice)`, a `Resolved:` line when resolved) plus `<dir>/<room>/README.md` naming the
|
|
420
|
+
room. No `--room` pulls every room the credential is in. Deterministic — an unchanged room
|
|
421
|
+
re-pulls byte-identical — and never deletes a file it did not write this run. `--since
|
|
422
|
+
<duration>` skips points untouched since.
|
|
423
|
+
|
|
424
|
+
`observe <pageUrl> --room <id>` drives the page with a real, already-installed Chrome
|
|
425
|
+
(`playwright-core`, an optional peer you install yourself — `pnpm add -D playwright-core`) and
|
|
426
|
+
the product's own capture bundle, then prints the room's anchors against the live page: NDJSON,
|
|
427
|
+
one `resolved`/`drifted`/`orphaned` line per anchor. Exits 0 unless `--fail-on-orphaned` finds
|
|
428
|
+
one, for a CI gate.
|
|
429
|
+
|
|
430
|
+
A site's own `/.well-known/glypt.json` (see `docs/well-known.md`) is read once per origin — 2s
|
|
431
|
+
timeout, silent on any failure — by `point new <pageUrl> --selector …`, and its `repo`/`build`/
|
|
432
|
+
`tracker` ride along as refs behind whatever `--ref` already named.
|
|
433
|
+
|
|
434
|
+
## Output, errors, exit codes
|
|
435
|
+
|
|
436
|
+
`--json` (or stdout not a TTY): full contract JSON, re-parsed through its schema before
|
|
437
|
+
printing. A TTY with neither `--json` nor `--fields`: a plain table. `events`/`watch` are
|
|
438
|
+
always NDJSON. `--fields a,b`: NDJSON of picked keys; an unknown field names the row's real
|
|
439
|
+
keys. `glypt --agent --help`: one JSON descriptor (every command, its schema name, env vars,
|
|
440
|
+
exit codes) built from the one registry that also drives `--help` and `schema`.
|
|
441
|
+
|
|
442
|
+
Every failure is `{"error": {"code", "message", "hint"}}` on stderr. `0` ok · `1` your mistake
|
|
443
|
+
(bad args, `not_found`, `conflict`, or `forbidden` naming the scope) · `2` no or bad credential
|
|
444
|
+
(`unauthorized` — set `GLYPT_TOKEN` or `glypt auth login`) · `3` the network or a dropped
|
|
445
|
+
stream. `glypt schema [command]` prints a command's output as JSON Schema.
|
|
446
|
+
|
|
447
|
+
**The full API is `openapi.json`.** `glypt schema --openapi` prints the whole document — every
|
|
448
|
+
route in one OpenAPI 3.1 file, generated from the same contracts this CLI's own output is
|
|
449
|
+
re-parsed through, so it cannot drift from what the API actually does (`pnpm lint` holds it
|
|
450
|
+
current). Point any OpenAPI-aware tool — a codegen, a request collection, another agent's
|
|
451
|
+
tool-builder — at it instead of hand-describing routes it can already read off the wire.
|
package/bin/glypt.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The bin is a shim, not the program: the program is `src/main.ts`,
|
|
3
|
+
// bundled by esbuild into `dist/glypt.mjs` so Node runs it with no loader.
|
|
4
|
+
import { existsSync } from 'node:fs';
|
|
5
|
+
|
|
6
|
+
const dist = new URL('../dist/glypt.mjs', import.meta.url);
|
|
7
|
+
if (!existsSync(dist)) {
|
|
8
|
+
process.stderr.write(
|
|
9
|
+
JSON.stringify({
|
|
10
|
+
error: {
|
|
11
|
+
code: 'not_built',
|
|
12
|
+
message: 'glypt is not built',
|
|
13
|
+
hint: 'run `pnpm -F glypt-app build` at the repo root',
|
|
14
|
+
},
|
|
15
|
+
}) + '\n',
|
|
16
|
+
);
|
|
17
|
+
process.exit(3);
|
|
18
|
+
}
|
|
19
|
+
const { main } = await import(dist);
|
|
20
|
+
process.exitCode = await main(process.argv.slice(2));
|