ghostdock 0.0.14 → 0.0.15
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/dist/cli-reference.md +122 -6
- package/dist/cli.md +8 -2
- package/dist/index.js +546 -14
- package/package.json +1 -1
package/dist/cli-reference.md
CHANGED
|
@@ -118,17 +118,19 @@ MCP tool: `images_add`.
|
|
|
118
118
|
|
|
119
119
|
### `ghostdock images add-compose`
|
|
120
120
|
|
|
121
|
-
Add Compose
|
|
121
|
+
Add a Compose project to the organization’s image catalog. Give its files, or a reference: a Compose project published as an OCI artifact (oci://…), used through include: with an optional override. ghostdock.* service labels (of the files, or of the override) become its manifest. Fails if the name is taken.
|
|
122
122
|
|
|
123
123
|
```
|
|
124
|
-
ghostdock images add-compose --name <string>
|
|
124
|
+
ghostdock images add-compose --name <string> [flags]
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
| Argument | Description |
|
|
128
128
|
| --- | --- |
|
|
129
|
-
| `--name <string>` | Image name, unique in the organization. Required. |
|
|
130
|
-
| `--files <object>` | Compose files by file name. Must include docker-compose.yml/yaml or compose.yml/yaml. (JSON object) Required. |
|
|
131
129
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
130
|
+
| `--name <string>` | Image name, unique in the organization. Required. |
|
|
131
|
+
| `--files <object>` | Compose files by file name. Must include docker-compose.yml/yaml or compose.yml/yaml. (JSON object) |
|
|
132
|
+
| `--reference <string>` | A published Compose project instead of files, e.g. oci://docker.io/ghostdockhq/vm-compose:ubuntu-26.04. |
|
|
133
|
+
| `--override <string>` | With reference: a Compose file merged into it (services, environment, labels). |
|
|
132
134
|
|
|
133
135
|
MCP tool: `images_add_compose`.
|
|
134
136
|
|
|
@@ -194,7 +196,7 @@ MCP tool: `images_remove`.
|
|
|
194
196
|
|
|
195
197
|
### `ghostdock images update-compose`
|
|
196
198
|
|
|
197
|
-
Replace a catalog Compose image’s files and/or name. Re-parses its labels.
|
|
199
|
+
Replace a catalog Compose image’s files, reference, override and/or name. Re-parses its labels.
|
|
198
200
|
|
|
199
201
|
```
|
|
200
202
|
ghostdock images update-compose <image-id> [flags]
|
|
@@ -205,6 +207,8 @@ ghostdock images update-compose <image-id> [flags]
|
|
|
205
207
|
| `<image-id>` | Catalog image id, from images list or images get. Required. |
|
|
206
208
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
207
209
|
| `--files <object>` | New Compose files by file name. Omit to keep the current files. (JSON object) |
|
|
210
|
+
| `--reference <string>` | A new reference (oci://…): the image becomes a Compose reference. |
|
|
211
|
+
| `--override <string>` | A reference’s new override; null removes it. |
|
|
208
212
|
| `--name <string>` | New image name. Omit to keep it. |
|
|
209
213
|
|
|
210
214
|
MCP tool: `images_update_compose`.
|
|
@@ -751,6 +755,7 @@ ghostdock sandboxes commands get <command-id> --sandbox-id <string> --session-id
|
|
|
751
755
|
| `--sandbox-id <string>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
752
756
|
| `--container <string>` | Container to work in, by name, from sandboxes containers list. Default: the sandbox’s default container, else the one running container. With several running and no default the call fails and lists them. |
|
|
753
757
|
| `--session-id <string>` | Session id returned by sandboxes commands run together with the commandId. Required. |
|
|
758
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
754
759
|
|
|
755
760
|
MCP tool: `sandboxes_commands_get`.
|
|
756
761
|
|
|
@@ -769,6 +774,7 @@ ghostdock sandboxes commands kill <command-id> --sandbox-id <string> --session-i
|
|
|
769
774
|
| `--sandbox-id <string>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
770
775
|
| `--container <string>` | Container to work in, by name, from sandboxes containers list. Default: the sandbox’s default container, else the one running container. With several running and no default the call fails and lists them. |
|
|
771
776
|
| `--session-id <string>` | Session id returned by sandboxes commands run together with the commandId. Required. |
|
|
777
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
772
778
|
|
|
773
779
|
MCP tool: `sandboxes_commands_kill`.
|
|
774
780
|
|
|
@@ -788,6 +794,7 @@ ghostdock sandboxes commands logs <command-id> --sandbox-id <string> --session-i
|
|
|
788
794
|
| `--container <string>` | Container to work in, by name, from sandboxes containers list. Default: the sandbox’s default container, else the one running container. With several running and no default the call fails and lists them. |
|
|
789
795
|
| `--session-id <string>` | Session id returned by sandboxes commands run together with the commandId. Required. |
|
|
790
796
|
| `--offset <integer>` | Character offset to continue reading from. Default 0. |
|
|
797
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
791
798
|
|
|
792
799
|
MCP tool: `sandboxes_commands_logs`.
|
|
793
800
|
|
|
@@ -808,6 +815,7 @@ ghostdock sandboxes commands run <sandbox-id> --command <string> [flags]
|
|
|
808
815
|
| `--session-id <string>` | Session from sandboxes shells create, to keep cwd and environment from earlier commands. Omit for a one-off session. |
|
|
809
816
|
| `--cwd <string>` | Directory to run the command in. |
|
|
810
817
|
| `--wait-seconds <number>` | Seconds to wait before returning handles to poll: 1 to 120, default 120. |
|
|
818
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
811
819
|
|
|
812
820
|
MCP tool: `sandboxes_commands_run`.
|
|
813
821
|
|
|
@@ -830,6 +838,26 @@ ghostdock sandboxes containers list <sandbox-id> [flags]
|
|
|
830
838
|
|
|
831
839
|
MCP tool: `sandboxes_containers_list`.
|
|
832
840
|
|
|
841
|
+
### `ghostdock sandboxes containers logs`
|
|
842
|
+
|
|
843
|
+
Read a container’s output, as docker logs does. Oldest first, each line with its stream (stdout, stderr) and time. The last tail lines (default 200), or with after only the lines after that time: pass the last line’s time to follow. truncated says lines were left out. A stopped sandbox has none (it is not started for this).
|
|
844
|
+
|
|
845
|
+
```
|
|
846
|
+
ghostdock sandboxes containers logs <sandbox-id> <container> [flags]
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
| Argument | Description |
|
|
850
|
+
| --- | --- |
|
|
851
|
+
| `<sandbox-id>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
852
|
+
| `<container>` | Container, by name. Required. |
|
|
853
|
+
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
854
|
+
| `--tail <integer>` | The last N lines (at most 5000). |
|
|
855
|
+
| `--after <string>` | Only lines after this time: the time of the last line already read. |
|
|
856
|
+
| `--follow` | Keep printing new lines until Ctrl-C. |
|
|
857
|
+
| `--timestamps` | Put each line's time in front of it. |
|
|
858
|
+
|
|
859
|
+
MCP tool: `sandboxes_containers_logs`.
|
|
860
|
+
|
|
833
861
|
### `ghostdock sandboxes containers protection`
|
|
834
862
|
|
|
835
863
|
Switch a container’s deletion protection on or off. A protected container cannot be removed or recreated (docker rm, compose down) until its protection is off. Starts the sandbox when needed.
|
|
@@ -847,6 +875,54 @@ ghostdock sandboxes containers protection <sandbox-id> <container> --protected <
|
|
|
847
875
|
|
|
848
876
|
MCP tool: `sandboxes_containers_protection`.
|
|
849
877
|
|
|
878
|
+
### `ghostdock sandboxes containers restart`
|
|
879
|
+
|
|
880
|
+
Restart a container, as docker restart does (stopping as docker stop does). Starts the sandbox when needed.
|
|
881
|
+
|
|
882
|
+
```
|
|
883
|
+
ghostdock sandboxes containers restart <sandbox-id> <container> [flags]
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
| Argument | Description |
|
|
887
|
+
| --- | --- |
|
|
888
|
+
| `<sandbox-id>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
889
|
+
| `<container>` | Container, by name. Required. |
|
|
890
|
+
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
891
|
+
|
|
892
|
+
MCP tool: `sandboxes_containers_restart`.
|
|
893
|
+
|
|
894
|
+
### `ghostdock sandboxes containers start`
|
|
895
|
+
|
|
896
|
+
Start a stopped container, as docker start does. A running container stays as it is. Starts the sandbox when needed.
|
|
897
|
+
|
|
898
|
+
```
|
|
899
|
+
ghostdock sandboxes containers start <sandbox-id> <container> [flags]
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
| Argument | Description |
|
|
903
|
+
| --- | --- |
|
|
904
|
+
| `<sandbox-id>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
905
|
+
| `<container>` | Container, by name. Required. |
|
|
906
|
+
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
907
|
+
|
|
908
|
+
MCP tool: `sandboxes_containers_start`.
|
|
909
|
+
|
|
910
|
+
### `ghostdock sandboxes containers stop`
|
|
911
|
+
|
|
912
|
+
Stop a container, as docker stop does. It gets its own stop signal, then a kill after its own stop timeout. It stays stopped while the sandbox sleeps and wakes, as Docker keeps a stopped container stopped, unless its restart policy is always. On a stopped sandbox it does nothing (note sandbox_stopped). The container main runs the sandbox: its stop is refused (main_is_the_sandbox), pause the sandbox instead. Deletion protection does not block it. note says when it was the default container or the last one running: then SSH, commands and files have nowhere to land until one runs.
|
|
913
|
+
|
|
914
|
+
```
|
|
915
|
+
ghostdock sandboxes containers stop <sandbox-id> <container> [flags]
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
| Argument | Description |
|
|
919
|
+
| --- | --- |
|
|
920
|
+
| `<sandbox-id>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
921
|
+
| `<container>` | Container, by name. Required. |
|
|
922
|
+
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
923
|
+
|
|
924
|
+
MCP tool: `sandboxes_containers_stop`.
|
|
925
|
+
|
|
850
926
|
### `ghostdock sandboxes create`
|
|
851
927
|
|
|
852
928
|
Create a sandbox from a snapshot, OCI image, Dockerfile or Compose files. Inline content only: for a directory or ZIP (Dockerfile COPY/ADD, Compose build files) use `ghostdock sandboxes build`. Snapshots and catalog images can require environment entries, URL ports and MCP names (requiredEnvironment / requiredUrls / requiredMcps); a missing environment entry fails with its names (missingEnvironment), and removing a required URL or MCP fails with them (missingUrls / missingMcps). Returns once the sandbox is running, with `boot`: how long the sandbox (VM) and, when one was started, its container took to start, each in ms. Idle-stop and auto-delete apply (defaults 20 minutes / 14 days). Read the sandboxes skill (`ghostdock skills get sandboxes`) for sources, manifests, lifecycle and providers.
|
|
@@ -859,7 +935,7 @@ ghostdock sandboxes create --source <object> [flags]
|
|
|
859
935
|
| --- | --- |
|
|
860
936
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
861
937
|
| `--display-name <string>` | Display name for the sandbox. Optional. |
|
|
862
|
-
| `--source <object>` | What the sandbox boots from. Required. "image" boots an org catalog row by id ({ id } from images list / images get — images add OCI bookmarks, images add-dockerfile, and images add-compose rows) or any OCI ref ({ ref }); "dockerfile" builds inline Dockerfile text only (ghostdock.* LABEL lines parsed for manifest; this tool has no build directory, so COPY/ADD of local files fails — use the CLI `ghostdock sandboxes build --kind dockerfile` with a directory or ZIP); "compose" boots Docker-in-Docker from the given inline files (must include docker-compose.yml/yaml or compose.yml/yaml; ghostdock.* service labels parsed for manifest). A Compose project that needs extra files is not accepted here — use `ghostdock sandboxes build --kind compose`. Image, dockerfile, and compose sources never appear in snapshots list. Published static sites use sites publish (CDN), not a snapshot. (JSON object) Required. |
|
|
938
|
+
| `--source <object>` | What the sandbox boots from. Required. "image" boots an org catalog row by id ({ id } from images list / images get — images add OCI bookmarks, images add-dockerfile, and images add-compose rows) or any OCI ref ({ ref }); "dockerfile" builds inline Dockerfile text only (ghostdock.* LABEL lines parsed for manifest; this tool has no build directory, so COPY/ADD of local files fails — use the CLI `ghostdock sandboxes build --kind dockerfile` with a directory or ZIP); "compose" boots Docker-in-Docker from the given inline files (must include docker-compose.yml/yaml or compose.yml/yaml; ghostdock.* service labels parsed for manifest). A Compose project that needs extra files is not accepted here — use `ghostdock sandboxes build --kind compose`. "compose" also takes a published Compose project instead of files ({ reference: "oci://…", override? }): it runs through include:, the override merged into it. Image, dockerfile, and compose sources never appear in snapshots list. Published static sites use sites publish (CDN), not a snapshot. (JSON object) Required. |
|
|
863
939
|
| `--resources <object>` | Compute sizing. For image/dockerfile/compose: layered on platform defaults when omitted. For snapshot: optional override applied via resize after create. (JSON object) |
|
|
864
940
|
| `--auto-stop-interval-minutes <number>` | Minutes of inactivity before the platform worker idle-stops the sandbox. -1 means always on. 0 is rejected. Omit for the platform default. Provider-native timers are optional backup. |
|
|
865
941
|
| `--auto-delete-interval-minutes <number>` | Minutes the sandbox stays stopped before the platform worker deletes the record. 0 deletes it when it stops. -1 keeps it until a person deletes it. Omit for the platform default. Provider-native timers are optional backup. |
|
|
@@ -885,6 +961,7 @@ ghostdock sandboxes default-container <sandbox-id> [flags]
|
|
|
885
961
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
886
962
|
| `--container <string>` | Container to make the default, by name. The running sandbox must have it. |
|
|
887
963
|
| `--clear` | Clear the default. |
|
|
964
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
888
965
|
|
|
889
966
|
MCP tool: `sandboxes_default_container`.
|
|
890
967
|
|
|
@@ -995,6 +1072,7 @@ ghostdock sandboxes files list <sandbox-id> [flags]
|
|
|
995
1072
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
996
1073
|
| `--container <string>` | Container to work in, by name, from sandboxes containers list. Default: the sandbox’s default container, else the one running container. With several running and no default the call fails and lists them. |
|
|
997
1074
|
| `--path <string>` | Directory to list. Absolute or relative to /. Defaults to /workspace. |
|
|
1075
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
998
1076
|
|
|
999
1077
|
MCP tool: `sandboxes_files_list`.
|
|
1000
1078
|
|
|
@@ -1012,6 +1090,7 @@ ghostdock sandboxes files read <path> --sandbox-id <string> [flags]
|
|
|
1012
1090
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
1013
1091
|
| `--sandbox-id <string>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
1014
1092
|
| `--container <string>` | Container to work in, by name, from sandboxes containers list. Default: the sandbox’s default container, else the one running container. With several running and no default the call fails and lists them. |
|
|
1093
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
1015
1094
|
|
|
1016
1095
|
MCP tool: `sandboxes_files_read`.
|
|
1017
1096
|
|
|
@@ -1185,6 +1264,7 @@ ghostdock sandboxes shells close <session-id> --sandbox-id <string> [flags]
|
|
|
1185
1264
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
1186
1265
|
| `--sandbox-id <string>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
1187
1266
|
| `--container <string>` | Container to work in, by name, from sandboxes containers list. Default: the sandbox’s default container, else the one running container. With several running and no default the call fails and lists them. |
|
|
1267
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
1188
1268
|
|
|
1189
1269
|
MCP tool: `sandboxes_shells_close`.
|
|
1190
1270
|
|
|
@@ -1202,6 +1282,7 @@ ghostdock sandboxes shells create <sandbox-id> [flags]
|
|
|
1202
1282
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
1203
1283
|
| `--container <string>` | Container to work in, by name, from sandboxes containers list. Default: the sandbox’s default container, else the one running container. With several running and no default the call fails and lists them. |
|
|
1204
1284
|
| `--session-id <string>` | Id for the new session: a slug; user-cmd, image-cmd and compose are reserved. Omit to generate one. |
|
|
1285
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
1205
1286
|
|
|
1206
1287
|
MCP tool: `sandboxes_shells_create`.
|
|
1207
1288
|
|
|
@@ -1222,6 +1303,7 @@ ghostdock sandboxes ssh get <sandbox-id> [flags]
|
|
|
1222
1303
|
| `<sandbox-id>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
1223
1304
|
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
1224
1305
|
| `--container <string>` | Container to work in, by name, from sandboxes containers list. Default: the sandbox’s default container, else the one running container. With several running and no default the call fails and lists them. |
|
|
1306
|
+
| `--start` | Start the container first when it is not running, without asking. |
|
|
1225
1307
|
|
|
1226
1308
|
MCP tool: `sandboxes_ssh_get`.
|
|
1227
1309
|
|
|
@@ -1270,6 +1352,40 @@ ghostdock sandboxes stop <sandbox-id> [flags]
|
|
|
1270
1352
|
|
|
1271
1353
|
MCP tool: `sandboxes_stop`.
|
|
1272
1354
|
|
|
1355
|
+
### `ghostdock sandboxes storage`
|
|
1356
|
+
|
|
1357
|
+
### `ghostdock sandboxes storage delete`
|
|
1358
|
+
|
|
1359
|
+
Delete a named volume or a top-level sandbox folder, with everything in it. Refused while a container mounts it (in any state: a stopped one counts, so stopping does not help), mounts a folder above it (a bind of /), or a volume keeps its data in the folder: remove those first.
|
|
1360
|
+
|
|
1361
|
+
```
|
|
1362
|
+
ghostdock sandboxes storage delete <sandbox-id> --kind <string> --name <string> [flags]
|
|
1363
|
+
```
|
|
1364
|
+
|
|
1365
|
+
| Argument | Description |
|
|
1366
|
+
| --- | --- |
|
|
1367
|
+
| `<sandbox-id>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
1368
|
+
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
1369
|
+
| `--kind <string>` | volume or folder. Required. |
|
|
1370
|
+
| `--name <string>` | The volume’s name, or the folder’s path in the sandbox (/srv, not /srv/app). Required. |
|
|
1371
|
+
|
|
1372
|
+
MCP tool: `sandboxes_storage_delete`.
|
|
1373
|
+
|
|
1374
|
+
### `ghostdock sandboxes storage list`
|
|
1375
|
+
|
|
1376
|
+
List a sandbox’s volumes and sandbox folders. The sandbox folders are where bind mounts land. Each with its size and sizeState (measured; measuring: ask again in a few seconds; tooBig: too big to measure cheaply; outside: a volume bound outside the sandbox folders, not measured nor browsable) and the containers using it, plus every container’s mounts. truncated says entries were left out. A stopped sandbox lists none (it is not started for this).
|
|
1377
|
+
|
|
1378
|
+
```
|
|
1379
|
+
ghostdock sandboxes storage list <sandbox-id> [flags]
|
|
1380
|
+
```
|
|
1381
|
+
|
|
1382
|
+
| Argument | Description |
|
|
1383
|
+
| --- | --- |
|
|
1384
|
+
| `<sandbox-id>` | Sandbox name (e.g. quiet-harbor) or id, from sandboxes list or sandboxes create. Names are unique within the organization. Required. |
|
|
1385
|
+
| `--org <string>` | Organization id or slug, from organizations list. Ids survive renames; slugs change when the organization is renamed. Defaults to GHOSTDOCK_ORG, then `organizations use`. |
|
|
1386
|
+
|
|
1387
|
+
MCP tool: `sandboxes_storage_list`.
|
|
1388
|
+
|
|
1273
1389
|
### `ghostdock sandboxes tools`
|
|
1274
1390
|
|
|
1275
1391
|
Tools of the MCP servers inside a sandbox.
|
package/dist/cli.md
CHANGED
|
@@ -631,12 +631,12 @@ or read [`cli-reference.md`](cli-reference.md) for every command's full descript
|
|
|
631
631
|
| Command | What it does |
|
|
632
632
|
| --- | --- |
|
|
633
633
|
| `ghostdock images add --ref <string> [flags]` | Bookmark an OCI image ref in the organization’s image catalog. |
|
|
634
|
-
| `ghostdock images add-compose --name <string>
|
|
634
|
+
| `ghostdock images add-compose --name <string> [flags]` | Add a Compose project to the organization’s image catalog. |
|
|
635
635
|
| `ghostdock images add-dockerfile --name <string> --dockerfile <string> [flags]` | Add a Dockerfile to the organization’s image catalog. |
|
|
636
636
|
| `ghostdock images get <image-id> [flags]` | Get one catalog image with its spec, manifest and requirements. |
|
|
637
637
|
| `ghostdock images list [flags]` | List the images an organization can boot sandboxes from. |
|
|
638
638
|
| `ghostdock images remove <image-id> [flags]` | Remove an image from the organization’s catalog. |
|
|
639
|
-
| `ghostdock images update-compose <image-id> [flags]` | Replace a catalog Compose image’s files and/or name. |
|
|
639
|
+
| `ghostdock images update-compose <image-id> [flags]` | Replace a catalog Compose image’s files, reference, override and/or name. |
|
|
640
640
|
| `ghostdock images update-dockerfile <image-id> --dockerfile <string> [flags]` | Replace a catalog Dockerfile, optionally renaming it. |
|
|
641
641
|
|
|
642
642
|
#### login
|
|
@@ -715,7 +715,11 @@ or read [`cli-reference.md`](cli-reference.md) for every command's full descript
|
|
|
715
715
|
| `ghostdock sandboxes commands logs <command-id> --sandbox-id <string> --session-id <string> [flags]` | Get a page of a shell command’s stdout and stderr. |
|
|
716
716
|
| `ghostdock sandboxes commands run <sandbox-id> --command <string> [flags]` | Run a shell command in a sandbox. |
|
|
717
717
|
| `ghostdock sandboxes containers list <sandbox-id> [flags]` | List the containers of a sandbox, running or not. |
|
|
718
|
+
| `ghostdock sandboxes containers logs <sandbox-id> <container> [flags]` | Read a container’s output, as docker logs does. |
|
|
718
719
|
| `ghostdock sandboxes containers protection <sandbox-id> <container> --protected <value> [flags]` | Switch a container’s deletion protection on or off. |
|
|
720
|
+
| `ghostdock sandboxes containers restart <sandbox-id> <container> [flags]` | Restart a container, as docker restart does (stopping as docker stop does). |
|
|
721
|
+
| `ghostdock sandboxes containers start <sandbox-id> <container> [flags]` | Start a stopped container, as docker start does. |
|
|
722
|
+
| `ghostdock sandboxes containers stop <sandbox-id> <container> [flags]` | Stop a container, as docker stop does. |
|
|
719
723
|
| `ghostdock sandboxes create --source <object> [flags]` | Create a sandbox from a snapshot, OCI image, Dockerfile or Compose files. |
|
|
720
724
|
| `ghostdock sandboxes default-container <sandbox-id> [flags]` | Show, set or clear the sandbox’s default container. |
|
|
721
725
|
| `ghostdock sandboxes delete <sandbox-id> [flags]` | Permanently delete a sandbox and its files. |
|
|
@@ -740,6 +744,8 @@ or read [`cli-reference.md`](cli-reference.md) for every command's full descript
|
|
|
740
744
|
| `ghostdock sandboxes ssh revoke <sandbox-id> [flags]` | Revoke a sandbox’s active SSH access. |
|
|
741
745
|
| `ghostdock sandboxes status <sandbox-id> [flags]` | Get a sandbox’s status and lifecycle deadlines without waking it. |
|
|
742
746
|
| `ghostdock sandboxes stop <sandbox-id> [flags]` | Stop a running sandbox without deleting its files. |
|
|
747
|
+
| `ghostdock sandboxes storage delete <sandbox-id> --kind <string> --name <string> [flags]` | Delete a named volume or a top-level sandbox folder, with everything in it. |
|
|
748
|
+
| `ghostdock sandboxes storage list <sandbox-id> [flags]` | List a sandbox’s volumes and sandbox folders. |
|
|
743
749
|
| `ghostdock sandboxes tools call <name> --sandbox-id <string> --arguments <object> [flags]` | Call a tool on an MCP server inside a sandbox. |
|
|
744
750
|
| `ghostdock sandboxes tools list <sandbox-id> [flags]` | List the tools of the MCP servers a sandbox exposes. |
|
|
745
751
|
| `ghostdock sandboxes update <sandbox-id> [flags]` | Change a sandbox’s display name, idle-stop or auto-delete interval. |
|
package/dist/index.js
CHANGED
|
@@ -718,9 +718,33 @@ var GENERATED_TOOL_CATALOG = [
|
|
|
718
718
|
"files"
|
|
719
719
|
],
|
|
720
720
|
additionalProperties: false
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
type: "object",
|
|
724
|
+
properties: {
|
|
725
|
+
type: {
|
|
726
|
+
type: "string",
|
|
727
|
+
const: "compose"
|
|
728
|
+
},
|
|
729
|
+
reference: {
|
|
730
|
+
type: "string",
|
|
731
|
+
minLength: 1,
|
|
732
|
+
maxLength: 512,
|
|
733
|
+
pattern: "^oci:\\/\\/(?:[a-z0-9]+(?:[.-][a-z0-9]+)*(?::\\d{1,5})?\\/)?[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*(?:\\/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})?(?:@sha256:[a-f0-9]{64})?$"
|
|
734
|
+
},
|
|
735
|
+
override: {
|
|
736
|
+
type: "string",
|
|
737
|
+
maxLength: 262144
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
required: [
|
|
741
|
+
"type",
|
|
742
|
+
"reference"
|
|
743
|
+
],
|
|
744
|
+
additionalProperties: false
|
|
721
745
|
}
|
|
722
746
|
],
|
|
723
|
-
description: 'What the sandbox boots from. Required. "image" boots an org catalog row by id ({ id } from images_list / images_get — images_add OCI bookmarks, images_add_dockerfile, and images_add_compose rows) or any OCI ref ({ ref }); "dockerfile" builds inline Dockerfile text only (ghostdock.* LABEL lines parsed for manifest; this tool has no build directory, so COPY/ADD of local files fails — use the CLI `ghostdock sandboxes build --kind dockerfile` with a directory or ZIP); "compose" boots Docker-in-Docker from the given inline files (must include docker-compose.yml/yaml or compose.yml/yaml; ghostdock.* service labels parsed for manifest). A Compose project that needs extra files is not accepted here — use `ghostdock sandboxes build --kind compose`. Image, dockerfile, and compose sources never appear in snapshots_list. Published static sites use sites_publish (CDN), not a snapshot.'
|
|
747
|
+
description: 'What the sandbox boots from. Required. "image" boots an org catalog row by id ({ id } from images_list / images_get — images_add OCI bookmarks, images_add_dockerfile, and images_add_compose rows) or any OCI ref ({ ref }); "dockerfile" builds inline Dockerfile text only (ghostdock.* LABEL lines parsed for manifest; this tool has no build directory, so COPY/ADD of local files fails — use the CLI `ghostdock sandboxes build --kind dockerfile` with a directory or ZIP); "compose" boots Docker-in-Docker from the given inline files (must include docker-compose.yml/yaml or compose.yml/yaml; ghostdock.* service labels parsed for manifest). A Compose project that needs extra files is not accepted here — use `ghostdock sandboxes build --kind compose`. "compose" also takes a published Compose project instead of files ({ reference: "oci://…", override? }): it runs through include:, the override merged into it. Image, dockerfile, and compose sources never appear in snapshots_list. Published static sites use sites_publish (CDN), not a snapshot.'
|
|
724
748
|
},
|
|
725
749
|
resources: {
|
|
726
750
|
type: "object",
|
|
@@ -4454,11 +4478,16 @@ var GENERATED_TOOL_CATALOG = [
|
|
|
4454
4478
|
"images",
|
|
4455
4479
|
"add-compose"
|
|
4456
4480
|
],
|
|
4457
|
-
description: "Add Compose
|
|
4481
|
+
description: "Add a Compose project to the organization’s image catalog. Give its files, or a reference: a Compose project published as an OCI artifact (oci://…), used through include: with an optional override. ghostdock.* service labels (of the files, or of the override) become its manifest. Fails if the name is taken.",
|
|
4458
4482
|
inputSchema: {
|
|
4459
4483
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4460
4484
|
type: "object",
|
|
4461
4485
|
properties: {
|
|
4486
|
+
organization: {
|
|
4487
|
+
type: "string",
|
|
4488
|
+
minLength: 1,
|
|
4489
|
+
description: "Organization id or slug, from organizations_list. Ids survive renames; slugs change when the organization is renamed."
|
|
4490
|
+
},
|
|
4462
4491
|
name: {
|
|
4463
4492
|
type: "string",
|
|
4464
4493
|
minLength: 1,
|
|
@@ -4466,6 +4495,7 @@ var GENERATED_TOOL_CATALOG = [
|
|
|
4466
4495
|
description: "Image name, unique in the organization."
|
|
4467
4496
|
},
|
|
4468
4497
|
files: {
|
|
4498
|
+
description: "Compose files by file name. Must include docker-compose.yml/yaml or compose.yml/yaml.",
|
|
4469
4499
|
type: "object",
|
|
4470
4500
|
propertyNames: {
|
|
4471
4501
|
type: "string"
|
|
@@ -4474,19 +4504,24 @@ var GENERATED_TOOL_CATALOG = [
|
|
|
4474
4504
|
type: "string",
|
|
4475
4505
|
minLength: 1,
|
|
4476
4506
|
maxLength: 512000
|
|
4477
|
-
}
|
|
4478
|
-
description: "Compose files by file name. Must include docker-compose.yml/yaml or compose.yml/yaml."
|
|
4507
|
+
}
|
|
4479
4508
|
},
|
|
4480
|
-
|
|
4509
|
+
reference: {
|
|
4510
|
+
description: "A published Compose project instead of files, e.g. oci://docker.io/ghostdockhq/vm-compose:ubuntu-26.04.",
|
|
4481
4511
|
type: "string",
|
|
4482
4512
|
minLength: 1,
|
|
4483
|
-
|
|
4513
|
+
maxLength: 512,
|
|
4514
|
+
pattern: "^oci:\\/\\/(?:[a-z0-9]+(?:[.-][a-z0-9]+)*(?::\\d{1,5})?\\/)?[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*(?:\\/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})?(?:@sha256:[a-f0-9]{64})?$"
|
|
4515
|
+
},
|
|
4516
|
+
override: {
|
|
4517
|
+
description: "With reference: a Compose file merged into it (services, environment, labels).",
|
|
4518
|
+
type: "string",
|
|
4519
|
+
maxLength: 262144
|
|
4484
4520
|
}
|
|
4485
4521
|
},
|
|
4486
4522
|
required: [
|
|
4487
|
-
"
|
|
4488
|
-
"
|
|
4489
|
-
"organization"
|
|
4523
|
+
"organization",
|
|
4524
|
+
"name"
|
|
4490
4525
|
],
|
|
4491
4526
|
additionalProperties: false
|
|
4492
4527
|
},
|
|
@@ -4509,7 +4544,7 @@ var GENERATED_TOOL_CATALOG = [
|
|
|
4509
4544
|
cliArgs: [
|
|
4510
4545
|
"imageId"
|
|
4511
4546
|
],
|
|
4512
|
-
description: "Replace a catalog Compose image’s files and/or name. Re-parses its labels.",
|
|
4547
|
+
description: "Replace a catalog Compose image’s files, reference, override and/or name. Re-parses its labels.",
|
|
4513
4548
|
inputSchema: {
|
|
4514
4549
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4515
4550
|
type: "object",
|
|
@@ -4536,6 +4571,25 @@ var GENERATED_TOOL_CATALOG = [
|
|
|
4536
4571
|
maxLength: 512000
|
|
4537
4572
|
}
|
|
4538
4573
|
},
|
|
4574
|
+
reference: {
|
|
4575
|
+
description: "A new reference (oci://…): the image becomes a Compose reference.",
|
|
4576
|
+
type: "string",
|
|
4577
|
+
minLength: 1,
|
|
4578
|
+
maxLength: 512,
|
|
4579
|
+
pattern: "^oci:\\/\\/(?:[a-z0-9]+(?:[.-][a-z0-9]+)*(?::\\d{1,5})?\\/)?[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*(?:\\/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})?(?:@sha256:[a-f0-9]{64})?$"
|
|
4580
|
+
},
|
|
4581
|
+
override: {
|
|
4582
|
+
description: "A reference’s new override; null removes it.",
|
|
4583
|
+
anyOf: [
|
|
4584
|
+
{
|
|
4585
|
+
type: "string",
|
|
4586
|
+
maxLength: 262144
|
|
4587
|
+
},
|
|
4588
|
+
{
|
|
4589
|
+
type: "null"
|
|
4590
|
+
}
|
|
4591
|
+
]
|
|
4592
|
+
},
|
|
4539
4593
|
name: {
|
|
4540
4594
|
description: "New image name. Omit to keep it.",
|
|
4541
4595
|
type: "string",
|
|
@@ -6159,6 +6213,320 @@ var GENERATED_TOOL_CATALOG = [
|
|
|
6159
6213
|
additionalProperties: {}
|
|
6160
6214
|
}
|
|
6161
6215
|
},
|
|
6216
|
+
{
|
|
6217
|
+
id: "sandboxes_containers_start",
|
|
6218
|
+
name: "sandboxes_containers_start",
|
|
6219
|
+
cli: [
|
|
6220
|
+
"sandboxes",
|
|
6221
|
+
"containers",
|
|
6222
|
+
"start"
|
|
6223
|
+
],
|
|
6224
|
+
cliArgs: [
|
|
6225
|
+
"sandboxId",
|
|
6226
|
+
"container"
|
|
6227
|
+
],
|
|
6228
|
+
description: "Start a stopped container, as docker start does. A running container stays as it is. Starts the sandbox when needed.",
|
|
6229
|
+
inputSchema: {
|
|
6230
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6231
|
+
type: "object",
|
|
6232
|
+
properties: {
|
|
6233
|
+
organization: {
|
|
6234
|
+
type: "string",
|
|
6235
|
+
minLength: 1,
|
|
6236
|
+
description: "Organization id or slug, from organizations_list. Ids survive renames; slugs change when the organization is renamed."
|
|
6237
|
+
},
|
|
6238
|
+
sandboxId: {
|
|
6239
|
+
type: "string",
|
|
6240
|
+
minLength: 1,
|
|
6241
|
+
description: "Sandbox name (e.g. quiet-harbor) or id, from sandboxes_list or sandboxes_create. Names are unique within the organization."
|
|
6242
|
+
},
|
|
6243
|
+
container: {
|
|
6244
|
+
type: "string",
|
|
6245
|
+
minLength: 1,
|
|
6246
|
+
maxLength: 255,
|
|
6247
|
+
pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$",
|
|
6248
|
+
description: "Container, by name."
|
|
6249
|
+
}
|
|
6250
|
+
},
|
|
6251
|
+
required: [
|
|
6252
|
+
"organization",
|
|
6253
|
+
"sandboxId",
|
|
6254
|
+
"container"
|
|
6255
|
+
],
|
|
6256
|
+
additionalProperties: false
|
|
6257
|
+
},
|
|
6258
|
+
outputSchema: {
|
|
6259
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6260
|
+
type: "object",
|
|
6261
|
+
propertyNames: {
|
|
6262
|
+
type: "string"
|
|
6263
|
+
},
|
|
6264
|
+
additionalProperties: {}
|
|
6265
|
+
}
|
|
6266
|
+
},
|
|
6267
|
+
{
|
|
6268
|
+
id: "sandboxes_containers_stop",
|
|
6269
|
+
name: "sandboxes_containers_stop",
|
|
6270
|
+
cli: [
|
|
6271
|
+
"sandboxes",
|
|
6272
|
+
"containers",
|
|
6273
|
+
"stop"
|
|
6274
|
+
],
|
|
6275
|
+
cliArgs: [
|
|
6276
|
+
"sandboxId",
|
|
6277
|
+
"container"
|
|
6278
|
+
],
|
|
6279
|
+
description: "Stop a container, as docker stop does. It gets its own stop signal, then a kill after its own stop timeout. It stays stopped while the sandbox sleeps and wakes, as Docker keeps a stopped container stopped, unless its restart policy is always. On a stopped sandbox it does nothing (note sandbox_stopped). The container main runs the sandbox: its stop is refused (main_is_the_sandbox), pause the sandbox instead. Deletion protection does not block it. note says when it was the default container or the last one running: then SSH, commands and files have nowhere to land until one runs.",
|
|
6280
|
+
inputSchema: {
|
|
6281
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6282
|
+
type: "object",
|
|
6283
|
+
properties: {
|
|
6284
|
+
organization: {
|
|
6285
|
+
type: "string",
|
|
6286
|
+
minLength: 1,
|
|
6287
|
+
description: "Organization id or slug, from organizations_list. Ids survive renames; slugs change when the organization is renamed."
|
|
6288
|
+
},
|
|
6289
|
+
sandboxId: {
|
|
6290
|
+
type: "string",
|
|
6291
|
+
minLength: 1,
|
|
6292
|
+
description: "Sandbox name (e.g. quiet-harbor) or id, from sandboxes_list or sandboxes_create. Names are unique within the organization."
|
|
6293
|
+
},
|
|
6294
|
+
container: {
|
|
6295
|
+
type: "string",
|
|
6296
|
+
minLength: 1,
|
|
6297
|
+
maxLength: 255,
|
|
6298
|
+
pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$",
|
|
6299
|
+
description: "Container, by name."
|
|
6300
|
+
}
|
|
6301
|
+
},
|
|
6302
|
+
required: [
|
|
6303
|
+
"organization",
|
|
6304
|
+
"sandboxId",
|
|
6305
|
+
"container"
|
|
6306
|
+
],
|
|
6307
|
+
additionalProperties: false
|
|
6308
|
+
},
|
|
6309
|
+
outputSchema: {
|
|
6310
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6311
|
+
type: "object",
|
|
6312
|
+
propertyNames: {
|
|
6313
|
+
type: "string"
|
|
6314
|
+
},
|
|
6315
|
+
additionalProperties: {}
|
|
6316
|
+
}
|
|
6317
|
+
},
|
|
6318
|
+
{
|
|
6319
|
+
id: "sandboxes_containers_restart",
|
|
6320
|
+
name: "sandboxes_containers_restart",
|
|
6321
|
+
cli: [
|
|
6322
|
+
"sandboxes",
|
|
6323
|
+
"containers",
|
|
6324
|
+
"restart"
|
|
6325
|
+
],
|
|
6326
|
+
cliArgs: [
|
|
6327
|
+
"sandboxId",
|
|
6328
|
+
"container"
|
|
6329
|
+
],
|
|
6330
|
+
description: "Restart a container, as docker restart does (stopping as docker stop does). Starts the sandbox when needed.",
|
|
6331
|
+
inputSchema: {
|
|
6332
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6333
|
+
type: "object",
|
|
6334
|
+
properties: {
|
|
6335
|
+
organization: {
|
|
6336
|
+
type: "string",
|
|
6337
|
+
minLength: 1,
|
|
6338
|
+
description: "Organization id or slug, from organizations_list. Ids survive renames; slugs change when the organization is renamed."
|
|
6339
|
+
},
|
|
6340
|
+
sandboxId: {
|
|
6341
|
+
type: "string",
|
|
6342
|
+
minLength: 1,
|
|
6343
|
+
description: "Sandbox name (e.g. quiet-harbor) or id, from sandboxes_list or sandboxes_create. Names are unique within the organization."
|
|
6344
|
+
},
|
|
6345
|
+
container: {
|
|
6346
|
+
type: "string",
|
|
6347
|
+
minLength: 1,
|
|
6348
|
+
maxLength: 255,
|
|
6349
|
+
pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$",
|
|
6350
|
+
description: "Container, by name."
|
|
6351
|
+
}
|
|
6352
|
+
},
|
|
6353
|
+
required: [
|
|
6354
|
+
"organization",
|
|
6355
|
+
"sandboxId",
|
|
6356
|
+
"container"
|
|
6357
|
+
],
|
|
6358
|
+
additionalProperties: false
|
|
6359
|
+
},
|
|
6360
|
+
outputSchema: {
|
|
6361
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6362
|
+
type: "object",
|
|
6363
|
+
propertyNames: {
|
|
6364
|
+
type: "string"
|
|
6365
|
+
},
|
|
6366
|
+
additionalProperties: {}
|
|
6367
|
+
}
|
|
6368
|
+
},
|
|
6369
|
+
{
|
|
6370
|
+
id: "sandboxes_containers_logs",
|
|
6371
|
+
name: "sandboxes_containers_logs",
|
|
6372
|
+
cli: [
|
|
6373
|
+
"sandboxes",
|
|
6374
|
+
"containers",
|
|
6375
|
+
"logs"
|
|
6376
|
+
],
|
|
6377
|
+
cliArgs: [
|
|
6378
|
+
"sandboxId",
|
|
6379
|
+
"container"
|
|
6380
|
+
],
|
|
6381
|
+
description: "Read a container’s output, as docker logs does. Oldest first, each line with its stream (stdout, stderr) and time. The last tail lines (default 200), or with after only the lines after that time: pass the last line’s time to follow. truncated says lines were left out. A stopped sandbox has none (it is not started for this).",
|
|
6382
|
+
inputSchema: {
|
|
6383
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6384
|
+
type: "object",
|
|
6385
|
+
properties: {
|
|
6386
|
+
organization: {
|
|
6387
|
+
type: "string",
|
|
6388
|
+
minLength: 1,
|
|
6389
|
+
description: "Organization id or slug, from organizations_list. Ids survive renames; slugs change when the organization is renamed."
|
|
6390
|
+
},
|
|
6391
|
+
sandboxId: {
|
|
6392
|
+
type: "string",
|
|
6393
|
+
minLength: 1,
|
|
6394
|
+
description: "Sandbox name (e.g. quiet-harbor) or id, from sandboxes_list or sandboxes_create. Names are unique within the organization."
|
|
6395
|
+
},
|
|
6396
|
+
container: {
|
|
6397
|
+
type: "string",
|
|
6398
|
+
minLength: 1,
|
|
6399
|
+
maxLength: 255,
|
|
6400
|
+
pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$",
|
|
6401
|
+
description: "Container, by name."
|
|
6402
|
+
},
|
|
6403
|
+
tail: {
|
|
6404
|
+
description: "The last N lines (at most 5000).",
|
|
6405
|
+
type: "integer",
|
|
6406
|
+
minimum: 1,
|
|
6407
|
+
maximum: 5000
|
|
6408
|
+
},
|
|
6409
|
+
after: {
|
|
6410
|
+
description: "Only lines after this time: the time of the last line already read.",
|
|
6411
|
+
type: "string",
|
|
6412
|
+
pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?(Z|[+-]\\d{2}:\\d{2})$"
|
|
6413
|
+
}
|
|
6414
|
+
},
|
|
6415
|
+
required: [
|
|
6416
|
+
"organization",
|
|
6417
|
+
"sandboxId",
|
|
6418
|
+
"container"
|
|
6419
|
+
],
|
|
6420
|
+
additionalProperties: false
|
|
6421
|
+
},
|
|
6422
|
+
outputSchema: {
|
|
6423
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6424
|
+
type: "object",
|
|
6425
|
+
propertyNames: {
|
|
6426
|
+
type: "string"
|
|
6427
|
+
},
|
|
6428
|
+
additionalProperties: {}
|
|
6429
|
+
}
|
|
6430
|
+
},
|
|
6431
|
+
{
|
|
6432
|
+
id: "sandboxes_storage_list",
|
|
6433
|
+
name: "sandboxes_storage_list",
|
|
6434
|
+
cli: [
|
|
6435
|
+
"sandboxes",
|
|
6436
|
+
"storage",
|
|
6437
|
+
"list"
|
|
6438
|
+
],
|
|
6439
|
+
cliArgs: [
|
|
6440
|
+
"sandboxId"
|
|
6441
|
+
],
|
|
6442
|
+
description: "List a sandbox’s volumes and sandbox folders. The sandbox folders are where bind mounts land. Each with its size and sizeState (measured; measuring: ask again in a few seconds; tooBig: too big to measure cheaply; outside: a volume bound outside the sandbox folders, not measured nor browsable) and the containers using it, plus every container’s mounts. truncated says entries were left out. A stopped sandbox lists none (it is not started for this).",
|
|
6443
|
+
inputSchema: {
|
|
6444
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6445
|
+
type: "object",
|
|
6446
|
+
properties: {
|
|
6447
|
+
organization: {
|
|
6448
|
+
type: "string",
|
|
6449
|
+
minLength: 1,
|
|
6450
|
+
description: "Organization id or slug, from organizations_list. Ids survive renames; slugs change when the organization is renamed."
|
|
6451
|
+
},
|
|
6452
|
+
sandboxId: {
|
|
6453
|
+
type: "string",
|
|
6454
|
+
minLength: 1,
|
|
6455
|
+
description: "Sandbox name (e.g. quiet-harbor) or id, from sandboxes_list or sandboxes_create. Names are unique within the organization."
|
|
6456
|
+
}
|
|
6457
|
+
},
|
|
6458
|
+
required: [
|
|
6459
|
+
"organization",
|
|
6460
|
+
"sandboxId"
|
|
6461
|
+
],
|
|
6462
|
+
additionalProperties: false
|
|
6463
|
+
},
|
|
6464
|
+
outputSchema: {
|
|
6465
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6466
|
+
type: "object",
|
|
6467
|
+
propertyNames: {
|
|
6468
|
+
type: "string"
|
|
6469
|
+
},
|
|
6470
|
+
additionalProperties: {}
|
|
6471
|
+
}
|
|
6472
|
+
},
|
|
6473
|
+
{
|
|
6474
|
+
id: "sandboxes_storage_delete",
|
|
6475
|
+
name: "sandboxes_storage_delete",
|
|
6476
|
+
cli: [
|
|
6477
|
+
"sandboxes",
|
|
6478
|
+
"storage",
|
|
6479
|
+
"delete"
|
|
6480
|
+
],
|
|
6481
|
+
cliArgs: [
|
|
6482
|
+
"sandboxId"
|
|
6483
|
+
],
|
|
6484
|
+
description: "Delete a named volume or a top-level sandbox folder, with everything in it. Refused while a container mounts it (in any state: a stopped one counts, so stopping does not help), mounts a folder above it (a bind of /), or a volume keeps its data in the folder: remove those first.",
|
|
6485
|
+
inputSchema: {
|
|
6486
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6487
|
+
type: "object",
|
|
6488
|
+
properties: {
|
|
6489
|
+
organization: {
|
|
6490
|
+
type: "string",
|
|
6491
|
+
minLength: 1,
|
|
6492
|
+
description: "Organization id or slug, from organizations_list. Ids survive renames; slugs change when the organization is renamed."
|
|
6493
|
+
},
|
|
6494
|
+
sandboxId: {
|
|
6495
|
+
type: "string",
|
|
6496
|
+
minLength: 1,
|
|
6497
|
+
description: "Sandbox name (e.g. quiet-harbor) or id, from sandboxes_list or sandboxes_create. Names are unique within the organization."
|
|
6498
|
+
},
|
|
6499
|
+
kind: {
|
|
6500
|
+
type: "string",
|
|
6501
|
+
enum: [
|
|
6502
|
+
"volume",
|
|
6503
|
+
"folder"
|
|
6504
|
+
],
|
|
6505
|
+
description: "volume or folder."
|
|
6506
|
+
},
|
|
6507
|
+
name: {
|
|
6508
|
+
type: "string",
|
|
6509
|
+
minLength: 1,
|
|
6510
|
+
description: "The volume’s name, or the folder’s path in the sandbox (/srv, not /srv/app)."
|
|
6511
|
+
}
|
|
6512
|
+
},
|
|
6513
|
+
required: [
|
|
6514
|
+
"organization",
|
|
6515
|
+
"sandboxId",
|
|
6516
|
+
"kind",
|
|
6517
|
+
"name"
|
|
6518
|
+
],
|
|
6519
|
+
additionalProperties: false
|
|
6520
|
+
},
|
|
6521
|
+
outputSchema: {
|
|
6522
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
6523
|
+
type: "object",
|
|
6524
|
+
propertyNames: {
|
|
6525
|
+
type: "string"
|
|
6526
|
+
},
|
|
6527
|
+
additionalProperties: {}
|
|
6528
|
+
}
|
|
6529
|
+
},
|
|
6162
6530
|
{
|
|
6163
6531
|
id: "sandboxes_commands_run",
|
|
6164
6532
|
name: "sandboxes_commands_run",
|
|
@@ -8808,7 +9176,7 @@ function getCliName(argv = process.argv) {
|
|
|
8808
9176
|
return CLI_NAMES.find((name) => name === invoked) ?? "ghostdock";
|
|
8809
9177
|
}
|
|
8810
9178
|
// package.json
|
|
8811
|
-
var version = "0.0.
|
|
9179
|
+
var version = "0.0.15";
|
|
8812
9180
|
var package_default = {
|
|
8813
9181
|
name: "ghostdock",
|
|
8814
9182
|
description: "Ghostdock CLI — device login and agent tool invocation from the command line",
|
|
@@ -9413,8 +9781,88 @@ var envCommand = defineCommand({
|
|
|
9413
9781
|
}
|
|
9414
9782
|
});
|
|
9415
9783
|
|
|
9784
|
+
// src/container-logs.ts
|
|
9785
|
+
var FOLLOW_INTERVAL_MS = 2000;
|
|
9786
|
+
function defaultLogsDeps(follow) {
|
|
9787
|
+
let stop = false;
|
|
9788
|
+
if (follow) {
|
|
9789
|
+
process.once("SIGINT", () => {
|
|
9790
|
+
stop = true;
|
|
9791
|
+
});
|
|
9792
|
+
}
|
|
9793
|
+
return {
|
|
9794
|
+
request: (input) => authorizedRequest("/api/v1/tools/sandboxes_containers_logs", {
|
|
9795
|
+
method: "POST",
|
|
9796
|
+
body: JSON.stringify(input)
|
|
9797
|
+
}),
|
|
9798
|
+
out: (line) => process.stdout.write(`${line}
|
|
9799
|
+
`),
|
|
9800
|
+
err: (line) => process.stderr.write(`${line}
|
|
9801
|
+
`),
|
|
9802
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
9803
|
+
stopped: () => stop
|
|
9804
|
+
};
|
|
9805
|
+
}
|
|
9806
|
+
async function runContainerLogs(input, options, deps = defaultLogsDeps(options.follow)) {
|
|
9807
|
+
const json = isJsonOutput();
|
|
9808
|
+
const color = colorEnabled(process.stdout);
|
|
9809
|
+
const print = (line) => {
|
|
9810
|
+
if (json) {
|
|
9811
|
+
deps.out(JSON.stringify(line));
|
|
9812
|
+
return;
|
|
9813
|
+
}
|
|
9814
|
+
const text = options.timestamps && line.time ? `${dim(line.time, color)} ${line.text}` : line.text;
|
|
9815
|
+
(line.stream === "stderr" ? deps.err : deps.out)(text);
|
|
9816
|
+
};
|
|
9817
|
+
let result = await deps.request(input);
|
|
9818
|
+
if (!result.running) {
|
|
9819
|
+
deps.err("The sandbox is stopped: it has no logs to show.");
|
|
9820
|
+
return 1;
|
|
9821
|
+
}
|
|
9822
|
+
let last = null;
|
|
9823
|
+
for (;; ) {
|
|
9824
|
+
for (const line of result.lines) {
|
|
9825
|
+
print(line);
|
|
9826
|
+
if (line.time)
|
|
9827
|
+
last = line.time;
|
|
9828
|
+
}
|
|
9829
|
+
if (!options.follow) {
|
|
9830
|
+
if (result.truncated && json) {
|
|
9831
|
+
deps.out(JSON.stringify({ truncated: true }));
|
|
9832
|
+
} else if (result.truncated) {
|
|
9833
|
+
deps.err(dim("(older lines left out: use --tail for more)", colorEnabled(process.stderr)));
|
|
9834
|
+
}
|
|
9835
|
+
return 0;
|
|
9836
|
+
}
|
|
9837
|
+
if (!result.truncated)
|
|
9838
|
+
await deps.sleep(FOLLOW_INTERVAL_MS);
|
|
9839
|
+
if (deps.stopped())
|
|
9840
|
+
return 0;
|
|
9841
|
+
const { tail: _tail, ...rest } = input;
|
|
9842
|
+
try {
|
|
9843
|
+
result = await deps.request(last ? { ...rest, after: last } : input);
|
|
9844
|
+
} catch (error) {
|
|
9845
|
+
deps.err(red(error instanceof Error ? error.message : String(error), colorEnabled(process.stderr)));
|
|
9846
|
+
return 1;
|
|
9847
|
+
}
|
|
9848
|
+
if (!result.running) {
|
|
9849
|
+
deps.err("The sandbox stopped.");
|
|
9850
|
+
return 0;
|
|
9851
|
+
}
|
|
9852
|
+
}
|
|
9853
|
+
}
|
|
9854
|
+
|
|
9416
9855
|
// src/container-picker.ts
|
|
9417
9856
|
import { createInterface } from "node:readline/promises";
|
|
9857
|
+
function notRunningContainerOf(error) {
|
|
9858
|
+
if (!(error instanceof ApiError) || !error.data || typeof error.data !== "object")
|
|
9859
|
+
return null;
|
|
9860
|
+
const { code, params } = error.data;
|
|
9861
|
+
if (code !== "container_not_running")
|
|
9862
|
+
return null;
|
|
9863
|
+
const container = params && typeof params === "object" ? params : {};
|
|
9864
|
+
return typeof container.container === "string" && container.container ? container.container : null;
|
|
9865
|
+
}
|
|
9418
9866
|
function containerQuestionOf(error) {
|
|
9419
9867
|
if (!(error instanceof ApiError) || !error.data || typeof error.data !== "object")
|
|
9420
9868
|
return null;
|
|
@@ -9460,8 +9908,21 @@ var confirmDefaultOnTerminal = async (container) => {
|
|
|
9460
9908
|
prompt.close();
|
|
9461
9909
|
}
|
|
9462
9910
|
};
|
|
9911
|
+
var confirmStartOnTerminal = async (container) => {
|
|
9912
|
+
const prompt = createInterface({ input: process.stdin, output: process.stderr });
|
|
9913
|
+
try {
|
|
9914
|
+
const answer = (await prompt.question(`Container ${container} is not running. Start it? [Y/n] `)).trim();
|
|
9915
|
+
return answer === "" || /^y(es)?$/i.test(answer);
|
|
9916
|
+
} finally {
|
|
9917
|
+
prompt.close();
|
|
9918
|
+
}
|
|
9919
|
+
};
|
|
9463
9920
|
function defaultContainerPickers() {
|
|
9464
|
-
return process.stdin.isTTY && process.stderr.isTTY ? {
|
|
9921
|
+
return process.stdin.isTTY && process.stderr.isTTY ? {
|
|
9922
|
+
choose: chooseContainerOnTerminal,
|
|
9923
|
+
confirmDefault: confirmDefaultOnTerminal,
|
|
9924
|
+
confirmStart: confirmStartOnTerminal
|
|
9925
|
+
} : undefined;
|
|
9465
9926
|
}
|
|
9466
9927
|
|
|
9467
9928
|
// src/progress.ts
|
|
@@ -9838,15 +10299,28 @@ async function runToolInvoke(tool, rawArgs, log = console.log, error = printErro
|
|
|
9838
10299
|
error(err instanceof Error ? err.message : String(err));
|
|
9839
10300
|
return 1;
|
|
9840
10301
|
}
|
|
10302
|
+
if (tool.name === "sandboxes_containers_logs") {
|
|
10303
|
+
try {
|
|
10304
|
+
return await runContainerLogs(input, {
|
|
10305
|
+
follow: rawArgs.follow === true,
|
|
10306
|
+
timestamps: rawArgs.timestamps === true
|
|
10307
|
+
});
|
|
10308
|
+
} catch (err) {
|
|
10309
|
+
error(err instanceof Error ? err.message : `${tool.name} failed.`);
|
|
10310
|
+
return 1;
|
|
10311
|
+
}
|
|
10312
|
+
}
|
|
9841
10313
|
try {
|
|
9842
|
-
const
|
|
10314
|
+
const send = () => authorizedRequest(`/api/v1/tools/${tool.name}`, {
|
|
9843
10315
|
method: "POST",
|
|
9844
10316
|
body: JSON.stringify(input)
|
|
9845
10317
|
});
|
|
10318
|
+
const request = () => withContainerStart(input, send, rawArgs.start === true, pickers, notice);
|
|
9846
10319
|
const waitMessage = PROGRESS_MESSAGES[tool.name];
|
|
9847
10320
|
if (!waitMessage) {
|
|
9848
10321
|
const result = await withContainerPick(tool, input, request, pickers, notice);
|
|
9849
10322
|
printResult(result, () => renderResult(result, colorEnabled(process.stdout)), log);
|
|
10323
|
+
stopNote(result, notice);
|
|
9850
10324
|
return 0;
|
|
9851
10325
|
}
|
|
9852
10326
|
const { value: result, elapsed } = await withContainerPick(tool, input, () => withProgress(waitMessage, request), pickers, notice);
|
|
@@ -9855,6 +10329,7 @@ async function runToolInvoke(tool, rawArgs, log = console.log, error = printErro
|
|
|
9855
10329
|
const lines = renderResult(result, color);
|
|
9856
10330
|
return bootLines(result, color).length > 0 ? lines : withElapsed(lines, elapsed);
|
|
9857
10331
|
}, log);
|
|
10332
|
+
stopNote(result, notice);
|
|
9858
10333
|
return 0;
|
|
9859
10334
|
} catch (err) {
|
|
9860
10335
|
error(err instanceof Error ? err.message : `${tool.name} failed.`);
|
|
@@ -9893,6 +10368,41 @@ async function withContainerPick(tool, input, send, pickers, notice) {
|
|
|
9893
10368
|
return result;
|
|
9894
10369
|
}
|
|
9895
10370
|
}
|
|
10371
|
+
async function withContainerStart(input, send, start, pickers, notice) {
|
|
10372
|
+
try {
|
|
10373
|
+
return await send();
|
|
10374
|
+
} catch (err) {
|
|
10375
|
+
const container = notRunningContainerOf(err);
|
|
10376
|
+
if (!container || typeof input.sandboxId !== "string")
|
|
10377
|
+
throw err;
|
|
10378
|
+
if (!start && !(pickers && await pickers.confirmStart(container)))
|
|
10379
|
+
throw err;
|
|
10380
|
+
await authorizedRequest("/api/v1/tools/sandboxes_containers_start", {
|
|
10381
|
+
method: "POST",
|
|
10382
|
+
body: JSON.stringify({
|
|
10383
|
+
organization: input.organization,
|
|
10384
|
+
sandboxId: input.sandboxId,
|
|
10385
|
+
container
|
|
10386
|
+
})
|
|
10387
|
+
});
|
|
10388
|
+
notice(eventLine("done", `Started ${container}.`));
|
|
10389
|
+
return await send();
|
|
10390
|
+
}
|
|
10391
|
+
}
|
|
10392
|
+
function stopNote(result, notice) {
|
|
10393
|
+
if (!result || typeof result !== "object")
|
|
10394
|
+
return;
|
|
10395
|
+
const { action, note, container } = result;
|
|
10396
|
+
if (action !== "stop" || typeof container !== "string")
|
|
10397
|
+
return;
|
|
10398
|
+
if (note === "default") {
|
|
10399
|
+
notice(`${container} is the sandbox's default container: SSH, commands and files ask which container until it runs again.`);
|
|
10400
|
+
} else if (note === "last_running") {
|
|
10401
|
+
notice("No container is running now: SSH, commands and files have none to land in until one runs.");
|
|
10402
|
+
} else if (note === "sandbox_stopped") {
|
|
10403
|
+
notice(`The sandbox is stopped, so ${container} is too: nothing was done.`);
|
|
10404
|
+
}
|
|
10405
|
+
}
|
|
9896
10406
|
var PROGRESS_MESSAGES = {
|
|
9897
10407
|
sandboxes_create: "Creating sandbox…",
|
|
9898
10408
|
sandboxes_wake: "Waking sandbox…",
|
|
@@ -9901,6 +10411,9 @@ var PROGRESS_MESSAGES = {
|
|
|
9901
10411
|
sandboxes_resize: "Resizing sandbox…",
|
|
9902
10412
|
sandboxes_resize_disk: "Resizing disk…",
|
|
9903
10413
|
sandboxes_commands_run: "Running command…",
|
|
10414
|
+
sandboxes_containers_start: "Starting container…",
|
|
10415
|
+
sandboxes_containers_stop: "Stopping container…",
|
|
10416
|
+
sandboxes_containers_restart: "Restarting container…",
|
|
9904
10417
|
snapshots_create: "Saving snapshot…",
|
|
9905
10418
|
projects_redeploy: "Redeploying…",
|
|
9906
10419
|
providers_verify_incus: "Checking the Incus host…"
|
|
@@ -9923,6 +10436,25 @@ function cliText(catalog, skills = BUILTIN_SKILL_NAMES) {
|
|
|
9923
10436
|
return commands.replace(/\bthe ([a-z][a-z0-9-]*) skill\b/g, (phrase, skill) => skills.includes(skill) ? `the ${skill} skill (\`${getCliName()} skills get ${skill}\`)` : phrase);
|
|
9924
10437
|
};
|
|
9925
10438
|
}
|
|
10439
|
+
function cliOnlyArgs(tool) {
|
|
10440
|
+
const schema = tool.inputSchema;
|
|
10441
|
+
const args = {};
|
|
10442
|
+
if (schema.properties && "container" in schema.properties && !schema.required?.includes("container")) {
|
|
10443
|
+
args.start = {
|
|
10444
|
+
type: "boolean",
|
|
10445
|
+
description: "Start the container first when it is not running, without asking."
|
|
10446
|
+
};
|
|
10447
|
+
}
|
|
10448
|
+
if (tool.name === "sandboxes_containers_logs") {
|
|
10449
|
+
args.follow = {
|
|
10450
|
+
type: "boolean",
|
|
10451
|
+
alias: "f",
|
|
10452
|
+
description: "Keep printing new lines until Ctrl-C."
|
|
10453
|
+
};
|
|
10454
|
+
args.timestamps = { type: "boolean", description: "Put each line's time in front of it." };
|
|
10455
|
+
}
|
|
10456
|
+
return args;
|
|
10457
|
+
}
|
|
9926
10458
|
var generatedToolCommands = new WeakSet;
|
|
9927
10459
|
function createToolCommands(catalog) {
|
|
9928
10460
|
const commands = {};
|
|
@@ -9933,7 +10465,7 @@ function createToolCommands(catalog) {
|
|
|
9933
10465
|
name: tool.cli?.at(-1) ?? tool.name,
|
|
9934
10466
|
description: toCliText(tool.description)
|
|
9935
10467
|
},
|
|
9936
|
-
args: buildToolArgs(tool.inputSchema, toCliText, tool.cliArgs),
|
|
10468
|
+
args: { ...buildToolArgs(tool.inputSchema, toCliText, tool.cliArgs), ...cliOnlyArgs(tool) },
|
|
9937
10469
|
async run({ args }) {
|
|
9938
10470
|
process.exitCode = await runToolInvoke(tool, args);
|
|
9939
10471
|
}
|