usepilot 0.4.0 → 0.5.0
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 +31 -76
- package/cli/index.js +606 -65
- package/dist/mount-C8kQoeYt.js +8618 -0
- package/dist/pilot-auto.js +1 -1
- package/dist/pilot.js +1 -1
- package/package.json +2 -2
- package/dist/mount-DXKhU5DD.js +0 -7077
package/README.md
CHANGED
|
@@ -1,104 +1,59 @@
|
|
|
1
1
|
# Pilot
|
|
2
2
|
|
|
3
|
-
**Take the controls from your coding agent
|
|
3
|
+
**Take the controls from your coding agent.**
|
|
4
4
|
|
|
5
|
-
Pilot
|
|
6
|
-
search a property the way you'd type a Tailwind class (`pt`, `gap-x`,
|
|
7
|
-
`size`), adjust it in a visual editor and see the change live. Then send your
|
|
8
|
-
changes to your coding agent: plain-CSS intent it translates into
|
|
9
|
-
your project's own conventions (Tailwind classes, CSS modules, design tokens…).
|
|
10
|
-
Pilot never edits your files.
|
|
5
|
+
Pilot lets you point at your running app and tell your coding agent exactly what to change. It runs inside your app in development, so you work on the real page with real data, not on a separate canvas:
|
|
11
6
|
|
|
12
|
-
|
|
7
|
+
- **Edit.** Select an element, type a property the way you'd type a Tailwind class (`pt`, `w`, `gap-x`), and set it with a visual control. You see the change live.
|
|
8
|
+
- **Comment.** Leave a note on an element ("make this feel less cramped") and get the agent's reply right there.
|
|
9
|
+
- **Ask for a task.** Use **Make responsive** on a section and the agent makes it work at every screen width.
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install -D usepilot
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Load it in development only. Pilot runs in its own Shadow DOM, so it doesn't
|
|
21
|
-
touch your app's styles or framework.
|
|
11
|
+
Then press **Send**. Your agent writes the changes into your code using your project's own conventions (Tailwind classes, CSS modules, design tokens). Pilot never edits your files itself. It checks the result on the page: what landed stops being previewed, and what didn't goes back to the agent. You see what the code does, not what the agent says it did.
|
|
22
12
|
|
|
23
|
-
**
|
|
24
|
-
`main.ts`…):
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
if (import.meta.env.DEV) import("usepilot/auto");
|
|
28
|
-
```
|
|
13
|
+
> **Early preview (0.x).** It works, and things will change between versions.
|
|
29
14
|
|
|
30
|
-
|
|
31
|
-
layout:
|
|
15
|
+
## Install
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
// app/pilot.tsx
|
|
35
|
-
"use client";
|
|
36
|
-
import { useEffect } from "react";
|
|
17
|
+
Paste this into your coding agent, in your project. Any agent that supports MCP works: Claude Code, Codex, Cursor, VS Code and others.
|
|
37
18
|
|
|
38
|
-
export function Pilot() {
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (process.env.NODE_ENV === "development") import("usepilot/auto");
|
|
41
|
-
}, []);
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
19
|
```
|
|
45
|
-
|
|
46
|
-
```tsx
|
|
47
|
-
// app/layout.tsx: inside <body>
|
|
48
|
-
<Pilot />
|
|
20
|
+
Set up Pilot in this project: run `npx usepilot@latest init` and follow what it prints.
|
|
49
21
|
```
|
|
50
22
|
|
|
51
|
-
|
|
52
|
-
browser, in development.
|
|
23
|
+
The agent installs Pilot as a dev dependency, connects itself to it, and loads it in your app, in development only. Then open a new chat and ask it to **launch Pilot** (`/pilot` in Claude Code). It opens Pilot in your app.
|
|
53
24
|
|
|
54
|
-
|
|
25
|
+
Commit the files it adds (the MCP config for your agents, and Claude Code's `/pilot`), and everyone on the project gets Pilot.
|
|
55
26
|
|
|
56
|
-
Pilot
|
|
57
|
-
in your app. Design, press **Send**, and the agent applies your edits while
|
|
58
|
-
you keep going. Pilot shows each change until it's really in your code, and
|
|
59
|
-
sends back to the agent what didn't land.
|
|
27
|
+
**No agent?** Run `npx usepilot@latest init` yourself and do the step it prints for loading Pilot. Then press **Option+P** (Alt+P on Windows and Linux) in your app, and **Copy prompt** hands your changes to any chat.
|
|
60
28
|
|
|
61
|
-
|
|
62
|
-
writes (`.claude/skills/pilot/SKILL.md` and `.mcp.json`), so everyone working
|
|
63
|
-
in the repo gets `/pilot`:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
npx usepilot setup --project
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**Just for you, in every project** (nothing goes in the repo):
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npx usepilot setup
|
|
73
|
-
claude mcp add --scope user pilot -- npx -y usepilot mcp
|
|
74
|
-
```
|
|
29
|
+
### If something doesn't work
|
|
75
30
|
|
|
76
|
-
|
|
31
|
+
- **The toolbar doesn't appear.** Pilot only loads in development, in the browser. Ask your agent to check where `usepilot/auto` is imported. The shortcut is ignored while you're typing in a text field.
|
|
32
|
+
- **The agent doesn't know Pilot.** Start a new chat: agents load their MCP servers when a chat starts. Some ask once to approve the project's server: say yes.
|
|
33
|
+
- **"Another Pilot version (bridge …) runs on port 4747".** Another open chat runs a different Pilot version. Update with `npx usepilot@latest init` and restart that chat.
|
|
77
34
|
|
|
78
|
-
##
|
|
35
|
+
## Using Pilot
|
|
79
36
|
|
|
80
|
-
1. **Launch
|
|
81
|
-
2. **Select
|
|
82
|
-
3. **Search and edit
|
|
83
|
-
`
|
|
84
|
-
Type `
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
they're applied).
|
|
37
|
+
1. **Launch:** ask your agent to launch Pilot (`/pilot` in Claude Code), or press **Option+P** on any page of your app.
|
|
38
|
+
2. **Select** with the cursor button in the toolbar, then click any element. Its property dialog opens next to it.
|
|
39
|
+
3. **Search and edit.** Type a property (`p`, `pt`, `w`, `gap`, `display`, `aspect`…), press Tab to go into its editor, then type or drag a value. Cmd/Ctrl+Z undoes.
|
|
40
|
+
- Type `from-768 ` first to make the change only for some screen widths.
|
|
41
|
+
- Type `hover:` to change the hover state.
|
|
42
|
+
- Type `/` to see every modifier.
|
|
43
|
+
4. **Send** your changes to the agent with the toolbar's Send button. Keep designing while it works. Each change stays previewed until it's really in your code.
|
|
44
|
+
5. **Comment** with the speech-bubble tool: click an element and write to the agent.
|
|
45
|
+
6. **Edit text** in place: with the cursor tool on, double-click it.
|
|
90
46
|
|
|
91
|
-
Your changes survive reloads in the same browser tab. Quit with the toolbar's
|
|
92
|
-
last button.
|
|
47
|
+
Your changes survive reloads in the same browser tab. Quit with the toolbar's last button.
|
|
93
48
|
|
|
94
|
-
|
|
49
|
+
### Options
|
|
95
50
|
|
|
96
51
|
```ts
|
|
97
52
|
import { mountPilot } from "usepilot";
|
|
98
53
|
|
|
99
54
|
mountPilot({
|
|
100
|
-
shortcut: "alt+p",
|
|
101
|
-
launch: false,
|
|
55
|
+
shortcut: "alt+p", // or "ctrl+shift+e", or false
|
|
56
|
+
launch: false, // true: open on load
|
|
102
57
|
nameAttributes: ["data-block"], // attributes your project names elements with
|
|
103
58
|
});
|
|
104
59
|
```
|