Skip to content

Commit bc60542

Browse files
grichaclaude
andauthored
Comprehensive documentation rewrite (#36)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ee26501 commit bc60542

23 files changed

+5233
-929
lines changed

docs/bun.lock

Lines changed: 2549 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docs/cli.md

Lines changed: 265 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,290 @@
22
sidebar_position: 5
33
---
44

5-
# CLI
5+
# CLI Reference
66

7-
## Agent
7+
## Agent Commands
8+
9+
### `perry agent run`
10+
11+
Start the agent daemon.
12+
13+
```bash
14+
perry agent run
15+
perry agent run --port 3000
16+
perry agent run --config-dir ~/.my-perry
17+
perry agent run --no-host-access
18+
```
19+
20+
| Option | Description |
21+
|--------|-------------|
22+
| `-p, --port <port>` | Port to listen on (default: 7391) |
23+
| `-c, --config-dir <dir>` | Configuration directory |
24+
| `--no-host-access` | Disable direct host machine access |
25+
26+
### `perry agent install`
27+
28+
Install agent as a systemd user service.
829

930
```bash
10-
perry agent run [--port PORT]
1131
perry agent install
32+
perry agent install --port 3000
33+
perry agent install --no-host-access
34+
```
35+
36+
Same options as `perry agent run`.
37+
38+
### `perry agent uninstall`
39+
40+
Remove the systemd service.
41+
42+
```bash
1243
perry agent uninstall
44+
```
45+
46+
### `perry agent status`
47+
48+
Show agent service status.
49+
50+
```bash
1351
perry agent status
1452
```
1553

16-
## Workspaces
54+
### `perry agent logs`
55+
56+
View agent service logs.
57+
58+
```bash
59+
perry agent logs
60+
perry agent logs -f # Follow logs
61+
perry agent logs -n 100 # Show last 100 lines
62+
```
63+
64+
| Option | Description |
65+
|--------|-------------|
66+
| `-f, --follow` | Follow log output |
67+
| `-n, --lines <n>` | Number of lines to show (default: 50) |
68+
69+
## Workspace Commands
70+
71+
### `perry start <name>`
72+
73+
Start a workspace. Creates it if it doesn't exist.
74+
75+
```bash
76+
perry start myproject
77+
perry start myproject --clone git@github.com:user/repo.git
78+
perry start myproject --clone https://github.com/user/repo.git
79+
```
80+
81+
| Option | Description |
82+
|--------|-------------|
83+
| `--clone <url>` | Git repository URL to clone |
84+
85+
### `perry stop <name>`
86+
87+
Stop a running workspace.
88+
89+
```bash
90+
perry stop myproject
91+
```
92+
93+
### `perry delete <name>`
94+
95+
Delete a workspace and its data.
96+
97+
```bash
98+
perry delete myproject
99+
perry rm myproject # alias
100+
```
101+
102+
### `perry list`
103+
104+
List all workspaces.
17105

18106
```bash
19-
perry start <name> [--clone URL] # Start (creates if doesn't exist)
20-
perry stop <name>
21-
perry delete <name>
22107
perry list
23-
perry logs <name>
24-
perry sync <name>
108+
perry ls # alias
25109
```
26110

27-
## Build
111+
Output shows:
112+
- Status indicator (running/stopped)
113+
- Workspace name
114+
- SSH port
115+
- Repository (if cloned)
116+
- Creation date
117+
118+
### `perry info [name]`
119+
120+
Show workspace or agent info.
28121

29122
```bash
30-
perry build [--no-cache]
123+
perry info # Agent info
124+
perry info myproject # Workspace info
31125
```
32126

33-
## Configuration
127+
### `perry logs <name>`
128+
129+
Show workspace container logs.
130+
131+
```bash
132+
perry logs myproject
133+
perry logs myproject -n 50 # Last 50 lines
134+
```
135+
136+
| Option | Description |
137+
|--------|-------------|
138+
| `-n, --tail <lines>` | Number of lines to show (default: 100) |
139+
140+
### `perry shell <name>`
141+
142+
Open interactive terminal to workspace.
143+
144+
```bash
145+
perry shell myproject
146+
```
147+
148+
Uses direct Docker exec for local agents, WebSocket for remote agents.
149+
150+
### `perry sync <name>`
151+
152+
Re-sync credentials and files to a running workspace.
153+
154+
```bash
155+
perry sync myproject
156+
```
157+
158+
Use after updating configuration to apply changes without restarting.
159+
160+
### `perry proxy <name> [ports...]`
161+
162+
Forward ports from workspace to local machine.
163+
164+
```bash
165+
perry proxy myproject 3000 # Forward port 3000
166+
perry proxy myproject 8080:3000 # Local 8080 -> remote 3000
167+
perry proxy myproject 3000 5173 # Multiple ports
168+
```
169+
170+
## Build Commands
171+
172+
### `perry build`
173+
174+
Build the workspace Docker image locally.
175+
176+
```bash
177+
perry build
178+
perry build --no-cache
179+
```
180+
181+
| Option | Description |
182+
|--------|-------------|
183+
| `--no-cache` | Build without Docker cache |
184+
185+
## Configuration Commands
186+
187+
### `perry config show`
188+
189+
Show current configuration.
34190

35191
```bash
36192
perry config show
37-
perry config worker [hostname]
193+
```
194+
195+
### `perry config worker [hostname]`
196+
197+
Get or set the worker hostname.
198+
199+
```bash
200+
perry config worker # Show current worker
201+
perry config worker myserver:7391 # Set worker
202+
perry config worker myserver.ts.net # Tailscale hostname
203+
```
204+
205+
### `perry config agent`
206+
207+
Show agent configuration.
208+
209+
```bash
38210
perry config agent
39211
```
212+
213+
## SSH Commands
214+
215+
### `perry ssh list`
216+
217+
List detected SSH keys on host.
218+
219+
```bash
220+
perry ssh list
221+
```
222+
223+
### `perry ssh show`
224+
225+
Show current SSH configuration.
226+
227+
```bash
228+
perry ssh show
229+
```
230+
231+
### `perry ssh auto-authorize [on|off]`
232+
233+
Toggle auto-authorization of host keys.
234+
235+
```bash
236+
perry ssh auto-authorize # Show current setting
237+
perry ssh auto-authorize on # Enable
238+
perry ssh auto-authorize off # Disable
239+
```
240+
241+
### `perry ssh copy <key-path>`
242+
243+
Add SSH key to copy list (for git operations).
244+
245+
```bash
246+
perry ssh copy ~/.ssh/id_ed25519
247+
perry ssh copy ~/.ssh/id_ed25519 -w myproject # Specific workspace
248+
```
249+
250+
| Option | Description |
251+
|--------|-------------|
252+
| `-w, --workspace <name>` | Apply to specific workspace only |
253+
254+
### `perry ssh authorize <key-path>`
255+
256+
Add SSH key to authorized_keys list (for SSH access).
257+
258+
```bash
259+
perry ssh authorize ~/.ssh/id_ed25519.pub
260+
perry ssh authorize ~/.ssh/id_ed25519.pub -w myproject
261+
```
262+
263+
| Option | Description |
264+
|--------|-------------|
265+
| `-w, --workspace <name>` | Apply to specific workspace only |
266+
267+
### `perry ssh remove <key-path>`
268+
269+
Remove SSH key from configuration.
270+
271+
```bash
272+
perry ssh remove ~/.ssh/id_ed25519
273+
perry ssh remove ~/.ssh/id_ed25519 --copy # Remove from copy list only
274+
perry ssh remove ~/.ssh/id_ed25519 --authorize # Remove from authorize list only
275+
perry ssh remove ~/.ssh/id_ed25519 -w myproject # Specific workspace
276+
```
277+
278+
| Option | Description |
279+
|--------|-------------|
280+
| `-w, --workspace <name>` | Apply to specific workspace only |
281+
| `--copy` | Remove from copy list only |
282+
| `--authorize` | Remove from authorize list only |
283+
284+
## Environment Variables
285+
286+
| Variable | Description |
287+
|----------|-------------|
288+
| `PERRY_CONFIG_DIR` | Override default config directory |
289+
| `PERRY_PORT` | Override default agent port (7391) |
290+
| `PERRY_NO_HOST_ACCESS` | Disable host access when set to `true` |
291+
| `WS_CONFIG_DIR` | Alternative config directory override |

0 commit comments

Comments
 (0)