|
2 | 2 | sidebar_position: 5 |
3 | 3 | --- |
4 | 4 |
|
5 | | -# CLI |
| 5 | +# CLI Reference |
6 | 6 |
|
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. |
8 | 29 |
|
9 | 30 | ```bash |
10 | | -perry agent run [--port PORT] |
11 | 31 | 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 |
12 | 43 | perry agent uninstall |
| 44 | +``` |
| 45 | + |
| 46 | +### `perry agent status` |
| 47 | + |
| 48 | +Show agent service status. |
| 49 | + |
| 50 | +```bash |
13 | 51 | perry agent status |
14 | 52 | ``` |
15 | 53 |
|
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. |
17 | 105 |
|
18 | 106 | ```bash |
19 | | -perry start <name> [--clone URL] # Start (creates if doesn't exist) |
20 | | -perry stop <name> |
21 | | -perry delete <name> |
22 | 107 | perry list |
23 | | -perry logs <name> |
24 | | -perry sync <name> |
| 108 | +perry ls # alias |
25 | 109 | ``` |
26 | 110 |
|
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. |
28 | 121 |
|
29 | 122 | ```bash |
30 | | -perry build [--no-cache] |
| 123 | +perry info # Agent info |
| 124 | +perry info myproject # Workspace info |
31 | 125 | ``` |
32 | 126 |
|
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. |
34 | 190 |
|
35 | 191 | ```bash |
36 | 192 | 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 |
38 | 210 | perry config agent |
39 | 211 | ``` |
| 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