leglas 1.0.0 → 1.1.1
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 +42 -374
- package/dist/bin.js +2384 -1629
- package/dist/index.d.ts +1 -1
- package/dist/index.js +143 -65
- package/dist/restart.d.ts +13 -0
- package/dist/run.d.ts +5 -0
- package/dist/shell/assets/index-BzaBzGEv.css +1 -0
- package/dist/shell/assets/index-CKmxj5gW.js +14 -0
- package/dist/shell/index.html +2 -2
- package/package.json +1 -1
- package/dist/shell/assets/index-BCvek69-.css +0 -1
- package/dist/shell/assets/index-BjY8sKEQ.js +0 -14
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/leglas"><img src="https://img.shields.io/npm/v/leglas" alt="npm"></a>
|
|
13
13
|
<a href="https://github.com/FredAmartey/leglas/actions/workflows/ci.yml"><img src="https://github.com/FredAmartey/leglas/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
14
|
-
<a href="LICENSE"><img src="https://img.shields.io/npm/l/leglas" alt="license"></a>
|
|
14
|
+
<a href="https://github.com/FredAmartey/leglas/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/leglas" alt="license"></a>
|
|
15
15
|
<a href="https://leglas.vercel.app/changelog/"><img src="https://img.shields.io/badge/changelog-what's%20new-0B1839" alt="changelog"></a>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
@@ -57,7 +57,7 @@ and sessions that clean up after themselves.
|
|
|
57
57
|
right. Your opinion of every idea survives a long exploration.
|
|
58
58
|
- Share the rail with someone who has no repo: a client, a cofounder, a
|
|
59
59
|
teammate on another machine. They get the real app, in your order, and
|
|
60
|
-
cannot change anything. See [Sharing](
|
|
60
|
+
cannot change anything. See [Sharing](https://github.com/FredAmartey/leglas/blob/main/docs/sharing.md).
|
|
61
61
|
- Compare things no design tool can hold: three git branches, a local build
|
|
62
62
|
against production, yesterday's direction against today's.
|
|
63
63
|
- Hand the workflow to your coding agent. `leglas init` teaches it, and
|
|
@@ -85,280 +85,32 @@ npx leglas
|
|
|
85
85
|
|
|
86
86
|
Leglas starts on port 4100, proxies your app and opens
|
|
87
87
|
`http://localhost:4100/leglas`. With no configuration you get a single
|
|
88
|
-
preview of your app root
|
|
89
|
-
|
|
90
|
-
compare.
|
|
91
|
-
If that port turns out to be served from outside your project, Leglas says
|
|
92
|
-
so and points at `devServer` and `--user-port` rather than quietly proxying
|
|
93
|
-
the wrong app.
|
|
94
|
-
|
|
95
|
-
It works with whatever you are building in. Leglas never imports or
|
|
96
|
-
executes your framework, so the target can be Next, Vite, Remix, SvelteKit,
|
|
97
|
-
Astro or a folder of static files. It needs Node 24 or newer, and nothing
|
|
98
|
-
else: `npx` fetches the CLI on first use and starts from the cache after
|
|
99
|
-
that. To pin a version for a project, `npm install -D leglas`; to type
|
|
100
|
-
`leglas` without the prefix, `npm install -g leglas`.
|
|
101
|
-
|
|
102
|
-
## Using Leglas
|
|
103
|
-
|
|
104
|
-
### The rail and the stage
|
|
105
|
-
|
|
106
|
-
Directions live in a rail on the left. The stage shows the active one in a
|
|
107
|
-
framed viewport at Full, 1440, 834 or 390 wide. Rename, reorder, hide and
|
|
108
|
-
tag directions from the rail; open the removed list to restore one, delete
|
|
109
|
-
it for good or clear the list. Your layout is saved per project and
|
|
110
|
-
survives restarts.
|
|
111
|
-
|
|
112
|
-
A small tools widget floats over the stage and can be dragged to any
|
|
113
|
-
corner. Its popover holds the viewport presets and a few preferences,
|
|
114
|
-
including hiding the dev badge your framework paints over the corner of
|
|
115
|
-
the app when it lands on the part you are judging.
|
|
116
|
-
|
|
117
|
-
### Comparing
|
|
118
|
-
|
|
119
|
-
Flipping shows a difference over time. A split shows it at once, which is
|
|
120
|
-
what you want for the last two in contention: press `C`, or hover a
|
|
121
|
-
direction and press its compare button, and it becomes the right pane
|
|
122
|
-
while the active direction holds the left.
|
|
123
|
-
|
|
124
|
-
Each side is drawn at the width it had on its own and scaled to fit, so
|
|
125
|
-
nothing reflows and flipping and splitting agree about what the design is.
|
|
126
|
-
An app given half the room would cross its own breakpoints and draw a
|
|
127
|
-
different design. If the narrow rendering is what you want, the tools
|
|
128
|
-
popover's "Scale each side to fit" switch is for that.
|
|
129
|
-
|
|
130
|
-
### Asking for a change
|
|
131
|
-
|
|
132
|
-
Type what you want into the field under the rail, or press `R`, and Leglas
|
|
133
|
-
composes a request naming the direction and the file behind it, copies it
|
|
134
|
-
to your clipboard and queues it. The direction it means is the one
|
|
135
|
-
highlighted directly above the field. By default the request asks for a
|
|
136
|
-
new variant beside that direction; the chip next to the send button
|
|
137
|
-
switches it to a change in place, for when a change really is a fix.
|
|
138
|
-
|
|
139
|
-
Pick an agent once from the picker beside the send button and the card
|
|
140
|
-
above the field shows it working: which file it is editing, how long it
|
|
141
|
-
has been, a stop if you change your mind, a retry when a run goes wrong.
|
|
142
|
-
Every request carries a screenshot of the direction at the width you are
|
|
143
|
-
looking at, a crop of anything you pointed at, the other pane when you are
|
|
144
|
-
comparing and any image you pasted in as a reference. Leglas runs no model
|
|
145
|
-
of its own; your agent already knows your conventions and your taste.
|
|
146
|
-
|
|
147
|
-
<p align="center">
|
|
148
|
-
<img src="https://raw.githubusercontent.com/FredAmartey/leglas/main/.github/assets/screenshots/field-idle.png" width="290" alt="The change field, empty, with its agent picker reading Choose an agent" />
|
|
149
|
-
<img src="https://raw.githubusercontent.com/FredAmartey/leglas/main/.github/assets/screenshots/field-queued.png" width="290" alt="A card above the change field reading: Change queued, pick who runs your changes" />
|
|
150
|
-
<img src="https://raw.githubusercontent.com/FredAmartey/leglas/main/.github/assets/screenshots/field-pickedup.png" width="290" alt="A card above the change field reading: Codex is on it, editing .leglas/variants/hero/poster.tsx, 56s, with a stop button" />
|
|
151
|
-
</p>
|
|
152
|
-
|
|
153
|
-
<p align="center"><i>Nothing waiting, then a request queued, then an agent that has taken it.</i></p>
|
|
154
|
-
|
|
155
|
-
Hover any direction to see what it was built from and the change that was
|
|
156
|
-
asked for, in the words that were typed.
|
|
157
|
-
|
|
158
|
-
### Pointing at the problem
|
|
159
|
-
|
|
160
|
-
Most of what you would type is the part describing where the problem is,
|
|
161
|
-
so point at it instead. Press `A` and the preview becomes a picker:
|
|
162
|
-
hovering outlines the element under the pointer, clicking drops a numbered
|
|
163
|
-
pin that takes a note, and dragging marks an area and names every element
|
|
164
|
-
inside it. Click a pin again to reread it, reword it or drop it. The page
|
|
165
|
-
still scrolls, so the thing three screens down is as easy to mark as the
|
|
166
|
-
headline.
|
|
167
|
-
|
|
168
|
-
Annotations are a request on their own, so the field can stay empty: leave
|
|
169
|
-
three and send once. Each carries the element's own words, its tag and
|
|
170
|
-
classes, a path and the box it filled, and tells your agent which of those
|
|
171
|
-
to trust first, because the design moves under them by design. A pin whose
|
|
172
|
-
element has since gone turns amber rather than pointing confidently at the
|
|
173
|
-
wrong thing.
|
|
174
|
-
|
|
175
|
-
### Sharing
|
|
176
|
-
|
|
177
|
-
The rail is local, and the person who most needs to see it often has no
|
|
178
|
-
repo. The share control in the rail's header fixes that: pick the whole rail
|
|
179
|
-
as you see it, or what is on stage (one direction, or the pair being
|
|
180
|
-
compared), and start sharing. Leglas opens a second listener on your
|
|
181
|
-
machine, points a tunnel at it and copies the link once it answers.
|
|
182
|
-
|
|
183
|
-
<p align="center">
|
|
184
|
-
<img src="https://raw.githubusercontent.com/FredAmartey/leglas/main/.github/assets/screenshots/share-links.png" width="426" alt="The share panel under the rail's header while sharing: the tunnel address, two links named Link 1 and Client review each with 24h left, the hovered row showing copy, extend and turn off, Another link, the scope line reading The whole rail, 6 directions, only what you shared, then Replace all and Stop" />
|
|
185
|
-
<img src="https://raw.githubusercontent.com/FredAmartey/leglas/main/.github/assets/screenshots/share-viewer.png" width="426" alt="The same rail as a viewer sees it: a strip reading Shared with you, the whole rail, then the directions in the sharer's order with no composer" />
|
|
186
|
-
</p>
|
|
187
|
-
|
|
188
|
-
<p align="center"><i>Sharing, and what the person on the other end gets.</i></p>
|
|
189
|
-
|
|
190
|
-
Whoever opens the link gets the real app, running, with your order, your
|
|
191
|
-
names, your folded families and your viewport. They can flip, compare,
|
|
192
|
-
search and change the width. They cannot change anything: the share
|
|
193
|
-
listener refuses every write, whoever the caller is, and answers every path
|
|
194
|
-
with 403 without the cookie the link sets, so your dev server never faces
|
|
195
|
-
the internet bare. Viewers do not get hot reload either, since an app's
|
|
196
|
-
live-reload socket is a way in; they refresh to see a change.
|
|
197
|
-
|
|
198
|
-
What a viewer can do is read what your dev server serves, and you choose
|
|
199
|
-
how much of it. **Anywhere in the app** is the whole dev server over GET,
|
|
200
|
-
source included, because Leglas proxies it faithfully and that is the
|
|
201
|
-
point; it suits a demo. **Only what you shared** serves the pages you shared
|
|
202
|
-
and the files they load, refuses the rest before the dev server hears of it
|
|
203
|
-
and holds against a console or curl as well as a browser. The list is read
|
|
204
|
-
off what your own directions loaded while you looked at them, not written
|
|
205
|
-
by hand, and anything it did not predict shows up in the panel with one
|
|
206
|
-
click to let that path or its folder through. Bounded still means a viewer
|
|
207
|
-
sees everything your shared pages themselves load. Either way Leglas
|
|
208
|
-
refuses the routes a dev server mounts to act on your machine, Vite's
|
|
209
|
-
editor launcher among them, hidden files like `.env` however the path is
|
|
210
|
-
spelled and a service worker that would outlive the share.
|
|
211
|
-
|
|
212
|
-
<p align="center">
|
|
213
|
-
<img src="https://raw.githubusercontent.com/FredAmartey/leglas/main/.github/assets/screenshots/share-reach.png" width="426" alt="The share panel before starting: The whole rail, 6 directions, 2 on branches left out; The direction on stage, Table; How far they can go: Anywhere in the app, Your whole dev server over GET; Only what you shared, These pages and the 22 files they loaded; a Start sharing button" />
|
|
214
|
-
</p>
|
|
215
|
-
|
|
216
|
-
<p align="center"><i>Choosing what to share, and how far a viewer goes.</i></p>
|
|
217
|
-
|
|
218
|
-
A share hands out links rather than a link. Name one for each person, up
|
|
219
|
-
to sixteen; each lasts a day, extends by another with one click and turns
|
|
220
|
-
off on its own without touching the others. The panel shows which links
|
|
221
|
-
are answering and how many sessions are on each. When your rail has moved
|
|
222
|
-
since you shared, it offers to push what you see now; stop the share from
|
|
223
|
-
the same place, and it stops with Leglas either way.
|
|
224
|
-
|
|
225
|
-
The tunnel is borrowed, not shipped. Leglas looks for `cloudflared` or
|
|
226
|
-
`ngrok` on your machine and runs whichever it finds; with neither, the link
|
|
227
|
-
only works on this machine and the panel says so. Branch directions run on
|
|
228
|
-
their own port and are left out of a share for now.
|
|
229
|
-
|
|
230
|
-
### Keys
|
|
231
|
-
|
|
232
|
-
Arrows move between directions and `1` to `9` jump straight to one. `R`
|
|
233
|
-
asks for a change, `A` annotates, `C` compares, `Cmd K` (`Ctrl K`
|
|
234
|
-
elsewhere) searches, `T` opens the tools popover and `B` collapses the
|
|
235
|
-
rail. Press `?` for the whole keymap.
|
|
236
|
-
|
|
237
|
-
## Setting up a project
|
|
238
|
-
|
|
239
|
-
### Configuration
|
|
240
|
-
|
|
241
|
-
Create `leglas.config.ts` at the project root. `.js`, `.mjs` and `.json`
|
|
242
|
-
work too. Resolution walks upward from the working directory, so in a
|
|
243
|
-
monorepo the nearest file wins. Node reads the TypeScript config natively;
|
|
244
|
-
there is no compiler or extra dependency involved.
|
|
88
|
+
preview of your app root. To compare more than one thing, create
|
|
89
|
+
`leglas.config.ts` at the project root:
|
|
245
90
|
|
|
246
91
|
```ts
|
|
247
92
|
export default {
|
|
248
93
|
devServer: "http://localhost:3000",
|
|
249
94
|
previews: [
|
|
250
95
|
{ title: "Current", url: "/" },
|
|
251
|
-
{ title: "Wave", url: "/?v-hero=wave", note: "Full-bleed, anchored low."
|
|
252
|
-
{
|
|
253
|
-
title: "Dot grid",
|
|
254
|
-
url: "/?v-hero=dotgrid",
|
|
255
|
-
note: "Lattice that wakes near the pointer.",
|
|
256
|
-
tags: ["Hero"],
|
|
257
|
-
},
|
|
96
|
+
{ title: "Wave", url: "/?v-hero=wave", note: "Full-bleed, anchored low." },
|
|
97
|
+
{ title: "Dot grid", url: "/?v-hero=dotgrid", note: "Lattice that wakes near the pointer." },
|
|
258
98
|
],
|
|
259
99
|
};
|
|
260
100
|
```
|
|
261
101
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
| `url` | unless `file` | Root relative (`/pricing`) or absolute (`https://staging.example.com`) |
|
|
266
|
-
| `note` | no | Second line under the title |
|
|
267
|
-
| `tags` | no | The first tag renders as a pill |
|
|
268
|
-
| `branch` | no | Preview a git branch instead of the running dev server |
|
|
269
|
-
| `file` | no | An HTML file served by Leglas itself, instead of `url` |
|
|
270
|
-
| `basedOn` | no | Title of the direction this is a variant of; the rail groups the family |
|
|
271
|
-
| `askedFor` | no | The change that was asked for, in the words that were typed |
|
|
272
|
-
| `devServer` | no | Defaults to `http://localhost:3000` |
|
|
273
|
-
| `devCommand` | with `branch` | How to start the app. Must contain `{port}`. |
|
|
274
|
-
| `installCommand` | no | Defaults to `npm install` |
|
|
275
|
-
| `scanPreviews` | no | Set `false` to skip background duplicate scans for expensive apps |
|
|
102
|
+
Each preview is a URL your dev server already answers. Every field, plain
|
|
103
|
+
HTML files with no dev server, git branches side by side and how the proxy
|
|
104
|
+
works are in [Setting up a project](https://github.com/FredAmartey/leglas/blob/main/docs/configuration.md).
|
|
276
105
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
preview on your machine only, in `.leglas/previews.json`, because
|
|
284
|
-
exploration is short-lived and its code lives in a gitignored directory;
|
|
285
|
-
`leglas list` shows both and marks which are local. Renaming a direction
|
|
286
|
-
in the rail is local in the same way, so the config title stays the one a
|
|
287
|
-
teammate sees, and `leglas show` and `leglas keep` take either name.
|
|
288
|
-
|
|
289
|
-
### Without a dev server
|
|
290
|
-
|
|
291
|
-
If the project exists but nothing is listening, set `devCommand` and
|
|
292
|
-
Leglas starts your app itself, proxies it and stops it on exit. When
|
|
293
|
-
`--user-port` names a server explicitly, Leglas never starts a different
|
|
294
|
-
one behind that flag.
|
|
295
|
-
|
|
296
|
-
If there is no app at all, a direction can be a plain HTML file:
|
|
297
|
-
|
|
298
|
-
```ts
|
|
299
|
-
export default {
|
|
300
|
-
previews: [
|
|
301
|
-
{ title: "Aurora", file: ".leglas/pages/aurora.html" },
|
|
302
|
-
{ title: "Ember", file: ".leglas/pages/ember.html" },
|
|
303
|
-
],
|
|
304
|
-
};
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
Leglas serves each file from its own origin, so the full interface works
|
|
308
|
-
with no dev server anywhere. The file's directory is mounted rather than
|
|
309
|
-
the lone file, so stylesheets and images beside it resolve. When the real
|
|
310
|
-
app arrives, directions graduate to app code and nothing about the
|
|
311
|
-
interface changes.
|
|
312
|
-
|
|
313
|
-
### Comparing branches
|
|
314
|
-
|
|
315
|
-
A preview with a `branch` field is served from its own checkout: Leglas
|
|
316
|
-
creates a worktree, installs, starts the app with your `devCommand` on a
|
|
317
|
-
free port and tears it all down when you quit. In the interface it looks
|
|
318
|
-
like any other direction, so a branch against your working tree, or three
|
|
319
|
-
branches against each other, compares the same way two query parameters
|
|
320
|
-
do.
|
|
321
|
-
|
|
322
|
-
### How it works
|
|
323
|
-
|
|
324
|
-
Leglas runs one local server that serves the interface at `/leglas` and
|
|
325
|
-
forwards every other request to your dev server. Previews load through
|
|
326
|
-
that proxy, so they are same origin with the interface: no CORS
|
|
327
|
-
configuration, no cookie special cases.
|
|
328
|
-
|
|
329
|
-
The proxy is designed to be invisible. Hot module replacement survives
|
|
330
|
-
the hop, redirects that point at your dev server are rewritten to keep
|
|
331
|
-
you inside the interface, and responses stream rather than buffer. If an
|
|
332
|
-
app behaves differently through Leglas than on its own port, that is a
|
|
333
|
-
bug.
|
|
334
|
-
|
|
335
|
-
Because a preview is a URL, the same interface compares two routes, two
|
|
336
|
-
implementations behind a query parameter or a local server against a
|
|
337
|
-
deployed one. Absolute URLs load directly rather than through the proxy,
|
|
338
|
-
so a site that refuses to be framed will not preview; the interface says
|
|
339
|
-
so instead of showing an empty pane.
|
|
340
|
-
|
|
341
|
-
Leglas also compares what each preview actually draws and warns when two
|
|
342
|
-
are identical. This catches a typo like `?v-hero=wavee` that your app
|
|
343
|
-
silently ignores while the rail implies a comparison. The check reads the
|
|
344
|
-
rendered page, runs only on previews you have opened and skips
|
|
345
|
-
cross-origin previews, which the browser will not let it read.
|
|
346
|
-
|
|
347
|
-
### Limitations
|
|
348
|
-
|
|
349
|
-
- Leglas runs no model of its own. Comparing existing routes costs
|
|
350
|
-
nothing, but a new direction is still code your agent writes; Leglas
|
|
351
|
-
hands it the request and shows the result.
|
|
352
|
-
- The duplicate check compares rendered markup only, and only when the
|
|
353
|
-
server renders some. Two previews that differ solely in a script are
|
|
354
|
-
reported as identical, and in a fully client-rendered app the check
|
|
355
|
-
says nothing.
|
|
356
|
-
- The interface is built for desktop widths.
|
|
357
|
-
- Leglas is a development tool. Nothing in it ships to production.
|
|
358
|
-
|
|
359
|
-
## Working with agents
|
|
106
|
+
It works with whatever you are building in. Leglas never imports or
|
|
107
|
+
executes your framework, so the target can be Next, Vite, Remix, SvelteKit,
|
|
108
|
+
Astro or a folder of static files. It needs Node 24 or newer, and nothing
|
|
109
|
+
else: `npx` fetches the CLI on first use and starts from the cache after
|
|
110
|
+
that. To pin a version for a project, `npm install -D leglas`; to type
|
|
111
|
+
`leglas` without the prefix, `npm install -g leglas`.
|
|
360
112
|
|
|
361
|
-
|
|
113
|
+
## With your agent
|
|
362
114
|
|
|
363
115
|
```sh
|
|
364
116
|
npx skills add FredAmartey/leglas
|
|
@@ -366,116 +118,32 @@ npx skills add FredAmartey/leglas
|
|
|
366
118
|
|
|
367
119
|
One install, and your agent recognises "give me a few directions for the
|
|
368
120
|
pricing page" as a Leglas exploration in any project, including ones that
|
|
369
|
-
have never seen Leglas.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
file
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
| `leglas new <surface> --from src/Hero.tsx` | Scaffolds a switcher under `.leglas/variants/`, with the baseline re-exporting your real component. Prints the one line to add and does not edit your file. Scaffolded branch points return the fallback in production builds. |
|
|
395
|
-
| `leglas classify --change … --rewrite …` | Says where a direction should live before it is written: in-app, where switching is instant, or on its own branch. |
|
|
396
|
-
| `leglas add --title … --url …` | Registers a direction on this machine. |
|
|
397
|
-
| `leglas show "Aurora" --json` | Everything about one direction: its entry, the file behind it, its variants, what it is compared against, what is pending. `--screenshot` renders it too, so an agent can look at what it built. |
|
|
398
|
-
| `leglas requests --json` | The change requests queued from the interface; `--clear` acknowledges them. |
|
|
399
|
-
| `leglas keep "Aurora" --to src/components/hero.tsx` | Moves the winner into real source and ends the exploration, writing what it decided into `design-log/` as markdown and PNGs. `leglas log` lists what is there. |
|
|
400
|
-
|
|
401
|
-
### Running requests
|
|
402
|
-
|
|
403
|
-
Requests made from the interface wait in a queue. An agent picked in the
|
|
404
|
-
interface drains it on its own. In a terminal, `npx leglas watch` is the
|
|
405
|
-
same loop with the agent's own output in view, and needs no flag once an
|
|
406
|
-
agent has been picked; for a CLI that is not in the picker, keep the
|
|
407
|
-
command explicit:
|
|
408
|
-
|
|
409
|
-
```sh
|
|
410
|
-
npx leglas watch --run "my-agent {prompt}"
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
### MCP server
|
|
414
|
-
|
|
415
|
-
For agent hosts that cannot run shell commands, `leglas-mcp` exposes the
|
|
416
|
-
same operations as MCP tools over stdio: `start`, `add`, `list`, `show`,
|
|
417
|
-
`classify`, `explore`, `scaffold`, `keep`, `requests` and `init`. Each
|
|
418
|
-
tool calls exactly what the CLI calls and returns the same envelope. The
|
|
419
|
-
`start` tool boots the viewer and returns its URL, and anything it started
|
|
420
|
-
stops when the session ends.
|
|
421
|
-
|
|
422
|
-
```sh
|
|
423
|
-
claude mcp add leglas -- npx -y leglas-mcp
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
Or in `.mcp.json`:
|
|
427
|
-
|
|
428
|
-
```json
|
|
429
|
-
{ "mcpServers": { "leglas": { "command": "npx", "args": ["-y", "leglas-mcp"] } } }
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
The host's working directory names the project, the same contract as the
|
|
433
|
-
CLI. A host that starts the server somewhere else is asked where the
|
|
434
|
-
project is, over MCP roots. On a host that speaks channels, the server
|
|
435
|
-
pushes each request into the session as it arrives.
|
|
436
|
-
|
|
437
|
-
### Agent Plugin
|
|
438
|
-
|
|
439
|
-
The repository is also an [Agent Plugin](https://agent-plugins.org), the
|
|
440
|
-
open standard for shipping a skill and MCP configuration together, so a
|
|
441
|
-
client that implements it installs both in one step. It is a layout, not a
|
|
442
|
-
build: `plugin.json` and `mcp.json` at the root, the skill in
|
|
443
|
-
`skills/leglas/`. Such a client starts the server in the plugin's own
|
|
444
|
-
directory, so the project is taken from the workspace the host declares
|
|
445
|
-
over MCP roots, or from `LEGLAS_PROJECT_DIR` when it declares none. The
|
|
446
|
-
plugin's version covers the skill and the configuration; the server it
|
|
447
|
-
launches is whatever `npx` fetches, the same as every command above.
|
|
448
|
-
|
|
449
|
-
## Command line
|
|
450
|
-
|
|
451
|
-
```text
|
|
452
|
-
leglas init Prepare a project and teach its agents
|
|
453
|
-
leglas [options] Start the server and open the interface
|
|
454
|
-
leglas new <surface> Scaffold a branch point for a surface
|
|
455
|
-
leglas explore <surface> Brief an agent's exploration of a surface
|
|
456
|
-
leglas classify Decide where a direction should live
|
|
457
|
-
leglas add --title T --url U Register a preview on this machine
|
|
458
|
-
leglas list Show every preview, shared and local
|
|
459
|
-
leglas log [entry] What past explorations decided
|
|
460
|
-
leglas show <title> Everything Leglas knows about one direction
|
|
461
|
-
leglas requests Show change requests made from the interface
|
|
462
|
-
leglas watch --run "<cmd>" Hand each request to your agent as it arrives
|
|
463
|
-
leglas keep <title> --to <path> Keep a winner and end the exploration
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
`--json` on any command prints a single machine-readable envelope.
|
|
467
|
-
`--port` chooses Leglas's own port and `--user-port` your dev server's;
|
|
468
|
-
`--config` names a config file instead of searching upward. Every
|
|
469
|
-
command's options are under `leglas <command> --help`.
|
|
470
|
-
|
|
471
|
-
## Development
|
|
472
|
-
|
|
473
|
-
This repository is a pnpm workspace: `pnpm install`, then `pnpm build`,
|
|
474
|
-
`pnpm test` and `pnpm typecheck`. Two packages are published, `leglas` and
|
|
475
|
-
`leglas-mcp`, and the repository is also the Agent Plugin. How to work on
|
|
476
|
-
it, what a pull request needs and how a release is cut are in
|
|
477
|
-
[CONTRIBUTING.md](CONTRIBUTING.md).
|
|
121
|
+
have never seen Leglas. In a project, `npx leglas init` writes the whole
|
|
122
|
+
workflow into `AGENTS.md`, so Claude Code, Cursor, Codex or whatever you
|
|
123
|
+
switch to next opens the project already knowing how to add design
|
|
124
|
+
directions to it. The one rule that workflow centers on, the commands an
|
|
125
|
+
agent runs, the MCP server and the Agent Plugin are in
|
|
126
|
+
[Working with agents](https://github.com/FredAmartey/leglas/blob/main/docs/agents.md).
|
|
127
|
+
|
|
128
|
+
## Documentation
|
|
129
|
+
|
|
130
|
+
| Page | What it covers |
|
|
131
|
+
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
132
|
+
| [Using Leglas](https://github.com/FredAmartey/leglas/blob/main/docs/guide.md) | The rail and the stage, comparing, asking for a change, pointing at the problem, the keys, updating |
|
|
133
|
+
| [Sharing](https://github.com/FredAmartey/leglas/blob/main/docs/sharing.md) | Sending the rail to someone with no repo, how far a viewer can go, links and the tunnel |
|
|
134
|
+
| [Setting up a project](https://github.com/FredAmartey/leglas/blob/main/docs/configuration.md) | The config file and every field, plain HTML without a dev server, comparing branches, how the proxy works, limitations |
|
|
135
|
+
| [Working with agents](https://github.com/FredAmartey/leglas/blob/main/docs/agents.md) | Add beside, never rewrite; the commands an agent runs; running requests; the MCP server; the Agent Plugin |
|
|
136
|
+
| [Command line](https://github.com/FredAmartey/leglas/blob/main/docs/cli.md) | Every command and the flags they share |
|
|
137
|
+
| [Changelog](https://leglas.vercel.app/changelog/) | What each release changed |
|
|
138
|
+
|
|
139
|
+
## Contributing
|
|
140
|
+
|
|
141
|
+
Bugs and ideas go in [issues](https://github.com/FredAmartey/leglas/issues).
|
|
142
|
+
Two packages are published from this repository, `leglas` and `leglas-mcp`,
|
|
143
|
+
and the repository is also the Agent Plugin. How to build, what a pull
|
|
144
|
+
request needs and how a release is cut are in
|
|
145
|
+
[CONTRIBUTING.md](https://github.com/FredAmartey/leglas/blob/main/CONTRIBUTING.md).
|
|
478
146
|
|
|
479
147
|
## License
|
|
480
148
|
|
|
481
|
-
[MIT](LICENSE)
|
|
149
|
+
[MIT](https://github.com/FredAmartey/leglas/blob/main/LICENSE)
|