homeboy 0.76.0

CLI for multi-component deployment and development workflow automation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# `homeboy project`

## Synopsis

```sh
homeboy project [OPTIONS] <COMMAND>
```

## Common Workflows

### Linking Components to a Project

After creating components, link them to a project:

```sh
# Add components to existing project
homeboy project components add my-project component-1 component-2

# Or set all components at once (replaces existing)
homeboy project components set my-project component-1 component-2
```

Components must exist (created via `homeboy component create`) before linking.

## Subcommands

### `list`

```sh
homeboy project list
```

### `show`

```sh
homeboy project show <project_id>
```

Arguments:

- `<project_id>`: project ID

### `create`

```sh
homeboy project create [OPTIONS] [<id>] [<domain>]
```

`create` supports two modes:

- **CLI mode**: pass `[<id>] [<domain>]` as positional arguments.
- **JSON mode**: pass `--json <spec>` (CLI mode arguments are not required).

Options:

- `--json <spec>`: JSON input spec for create/update (single object or bulk; see below)
- `--skip-existing`: skip items that already exist (JSON mode only)
- `--server-id <server_id>`: optional server ID
- `--base-path <path>`: optional base path (local or remote depending on server configuration)
- `--table-prefix <prefix>`: optional table prefix (only used by extensions that care about table naming)

Arguments (CLI mode):

- `[<id>]`: project ID
- `[<domain>]`: public site domain

JSON mode:

- `<spec>` accepts `-` (stdin), `@file.json`, or an inline JSON string.
- The payload is the project object (single or array for bulk).

Single:

```json
{ "id": "my-project", "domain": "example.com" }
```

Bulk:

```json
[
  { "id": "my-project", "domain": "example.com" },
  { "id": "my-project-2", "domain": "example.com" }
]
```

JSON output:

> Note: all command output is wrapped in the global JSON envelope described in the [JSON output contract]../architecture/output-system.md. The object below is the `data` payload.

CLI mode:

```json
{
  "command": "project.create",
  "project_id": "<project_id>",
  "project": { }
}
```

JSON mode:

```json
{
  "command": "project.create",
  "import": {
    "results": [{ "id": "<project_id>", "action": "created|updated|skipped|error" }],
    "created": 1,
    "updated": 0,
    "skipped": 0,
    "errors": 0
  }
}
```

## Local Projects

Projects without a `--server-id` execute commands locally instead of via SSH. Homeboy is environment-agnostic - it works the same way regardless of whether your local environment uses Docker, native installs, or any other setup.


### Creating a Local Project

```sh
homeboy project create <id> <domain> --base-path <local-path>
```

Example:

```sh
homeboy project create my-site my-site.local \
    --base-path "/path/to/site/public"
```

### What Works Locally

All commands execute locally when no `server_id` is configured:

- **CLI tools** (`homeboy wp`, `homeboy composer`) - execute in local shell
- **Database** (`homeboy db`) - uses extension templates, executes locally
- **Logs** (`homeboy logs`) - reads files from `base_path`
- **Files** (`homeboy file`) - browses/edits files at `base_path`
- **Extension platform behaviors** - project discovery, version patterns, etc.

### What Requires a Server

Only these commands require `server_id`:
- `homeboy deploy` - uploads artifacts to remote server
- `homeboy db tunnel` - creates SSH tunnel for database access

## Subcommands (continued)

### `set`

```sh
homeboy project set <project_id> --json <JSON>
homeboy project set <project_id> '<JSON>'
homeboy project set --json <JSON>   # project_id may be provided in JSON body
```

Updates a project by merging a JSON object into `projects/<id>.json`.

Options:

- `--json <JSON>`: JSON object to merge into config (supports `@file` and `-` for stdin)
- `--replace <field>`: replace array fields instead of union (repeatable)

Notes:

- `set` no longer supports individual field flags; use `--json` and provide the fields you want to update.
- Use `null` in JSON to clear a field (for example, `{"component_ids": null}`).

JSON output:

> Note: all command output is wrapped in the global JSON envelope described in the [JSON output contract]../architecture/output-system.md. The object below is the `data` payload.

```json
{
  "command": "project.set",
  "project_id": "<project_id>",
  "project": { },
  "updated": ["domain", "server_id"],
  "import": null
}
```

JSON output (`list`):

> Note: all command output is wrapped in the global JSON envelope described in the [JSON output contract]../architecture/output-system.md. The object below is the `data` payload.

```json
{
  "command": "project.list",
  "projects": [
    {
      "id": "<project_id>",
      "domain": "<domain>"
    }
  ]
}
```

JSON output (`show`):

> Note: all command output is wrapped in the global JSON envelope described in the [JSON output contract]../architecture/output-system.md. The object below is the `data` payload.

```json
{
  "command": "project.show",
  "project_id": "<project_id>",
  "project": { },
  "import": null
}
```

`project` is the serialized `ProjectRecord` (`{ id, config }`).

### `components`

```sh
homeboy project components <COMMAND>
```

Manage the list of components associated with a project.

#### `components list`

```sh
homeboy project components list <project_id>
```

Lists component IDs and the resolved component configs.

JSON output:

```json
{
  "command": "project.components.list",
  "project_id": "<project_id>",
  "components": {
    "action": "list",
    "project_id": "<project_id>",
    "component_ids": ["<component_id>", "<component_id>"],
    "components": [ { } ]
  }
}
```

#### `components add`

```sh
homeboy project components add <project_id> <component_id> [<component_id>...]
```

Adds components to the project if they are not already present.

#### `components remove`

```sh
homeboy project components remove <project_id> <component_id> [<component_id>...]
```

Removes components from the project. Errors if any provided component ID is not currently attached.

#### `components clear`

```sh
homeboy project components clear <project_id>
```

Removes all components from the project.

#### `components set`

```sh
homeboy project components set <project_id> <component_id> [<component_id>...]
```

Replaces the full `component_ids` list on the project (deduped, order-preserving). Component IDs must exist in `homeboy component list`.

You can also do this via `project set` by merging `component_ids`:

```sh
homeboy project set <project_id> --json '{"component_ids":["chubes-theme","chubes-blocks"]}'
```

Example:

```sh
homeboy project components set chubes chubes-theme chubes-blocks chubes-contact chubes-docs chubes-games
```

JSON output:

```json
{
  "command": "project.components.set",
  "project_id": "<project_id>",
  "components": {
    "action": "set",
    "project_id": "<project_id>",
    "component_ids": ["<component_id>", "<component_id>"],
    "components": [ { } ]
  },
  "updated": ["component_ids"]
}
```

### `pin`

```sh
homeboy project pin <COMMAND>
```

#### `pin list`

```sh
homeboy project pin list <project_id> --type <file|log>
```

JSON output:

```json
{
  "command": "project.pin.list",
  "project_id": "<project_id>",
  "pin": {
    "action": "list",
    "project_id": "<project_id>",
    "type": "file|log",
    "items": [
      {
        "path": "<path>",
        "label": "<label>|null",
        "display_name": "<display-name>",
        "tail_lines": 100
      }
    ]
  }
}
```

#### `pin add`

```sh
homeboy project pin add <project_id> <path> --type <file|log> [--label <label>] [--tail <lines>]
```

JSON output:

```json
{
  "command": "project.pin.add",
  "project_id": "<project_id>",
  "pin": {
    "action": "add",
    "project_id": "<project_id>",
    "type": "file|log",
    "added": { "path": "<path>", "type": "file|log" }
  }
}
```

#### `pin remove`

```sh
homeboy project pin remove <project_id> <path> --type <file|log>
```

JSON output:

```json
{
  "command": "project.pin.remove",
  "project_id": "<project_id>",
  "pin": {
    "action": "remove",
    "project_id": "<project_id>",
    "type": "file|log",
    "removed": { "path": "<path>", "type": "file|log" }
  }
}
```

### `rename`

```sh
homeboy project rename <project_id> <new_id>
```

Renames a project by changing its ID.

Notes:

- `new_id` is lowercased before writing.
- The project is moved from `projects/<old-id>.json` to `projects/<new-id>.json`.
- Component references are updated automatically.

Example:

```sh
homeboy project rename my-project my-new-project
```

JSON output:

```json
{
  "command": "project.rename",
  "project_id": "<project_id>",
  "new_id": "<new_id>",
  "renamed": true
}
```

### `remove`

```sh
homeboy project remove <project_id> --json '<JSON>'
homeboy project remove <project_id> '<JSON>'
```

Removes items from project configuration arrays.

Options:

- `--json <JSON>`: JSON object to remove from config (supports `@file` and `-` for stdin)

Note: Use this to remove specific fields or array items from project configuration.

Example:

```sh
# Remove a component
homeboy project remove my-project --json '{"component_ids": ["component-id"]}'
```

JSON output:

```json
{
  "command": "project.remove",
  "project_id": "<project_id>",
  "removed": ["component_ids"],
  "project": {}
}
```

## Related

- [JSON output contract]../architecture/output-system.md