@getmonoceros/workbench 1.0.0 → 1.1.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 +7 -0
- package/dist/bin.js +308 -58
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,13 @@ monoceros apply hello
|
|
|
37
37
|
monoceros shell hello
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
Tab-Completion einmalig einrichten:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
monoceros completion zsh > ~/.oh-my-zsh/completions/_monoceros # zsh
|
|
44
|
+
monoceros completion bash > ~/.bash_completion.d/monoceros # bash
|
|
45
|
+
```
|
|
46
|
+
|
|
40
47
|
Volle Befehlsreferenz unter
|
|
41
48
|
[docs/commands/](https://github.com/getmonoceros/workbench/tree/main/docs/commands).
|
|
42
49
|
|
package/dist/bin.js
CHANGED
|
@@ -20,6 +20,13 @@ var bold = (s) => color(s, ANSI_BOLD);
|
|
|
20
20
|
var underline = (s) => color(s, ANSI_UNDERLINE);
|
|
21
21
|
var cyan = (s) => color(s, ANSI_CYAN);
|
|
22
22
|
var grey = (s) => color(s, ANSI_GREY);
|
|
23
|
+
var GROUPS = [
|
|
24
|
+
{ key: "lifecycle", label: "Container lifecycle" },
|
|
25
|
+
{ key: "run", label: "Run + inspect" },
|
|
26
|
+
{ key: "edit", label: "Edit container yml" },
|
|
27
|
+
{ key: "discovery", label: "Discovery" },
|
|
28
|
+
{ key: "tooling", label: "Tooling" }
|
|
29
|
+
];
|
|
23
30
|
function resolveArgs(argsDef) {
|
|
24
31
|
if (!argsDef) return [];
|
|
25
32
|
const out = [];
|
|
@@ -52,19 +59,91 @@ function renderArgDescription(arg, isRequired) {
|
|
|
52
59
|
return parts.join(" ");
|
|
53
60
|
}
|
|
54
61
|
var ANSI_RE = /\x1b\[[0-9;]*m/g;
|
|
62
|
+
function visibleLen(s) {
|
|
63
|
+
return s.replace(ANSI_RE, "").length;
|
|
64
|
+
}
|
|
65
|
+
function terminalWidth() {
|
|
66
|
+
return process.stdout.columns && process.stdout.columns > 40 ? process.stdout.columns : 100;
|
|
67
|
+
}
|
|
68
|
+
function wrapText(text, width, continuationIndent) {
|
|
69
|
+
if (visibleLen(text) <= width) return text;
|
|
70
|
+
const words = text.split(/(\s+)/);
|
|
71
|
+
const lines = [];
|
|
72
|
+
let current = "";
|
|
73
|
+
for (const w of words) {
|
|
74
|
+
if (visibleLen(current) + visibleLen(w) <= width) {
|
|
75
|
+
current += w;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (current.length > 0) lines.push(current.replace(/\s+$/, ""));
|
|
79
|
+
current = w.replace(/^\s+/, "");
|
|
80
|
+
}
|
|
81
|
+
if (current.length > 0) lines.push(current.replace(/\s+$/, ""));
|
|
82
|
+
return lines.map((l, i) => i === 0 ? l : continuationIndent + l).join("\n");
|
|
83
|
+
}
|
|
55
84
|
function alignTable(rows, indent) {
|
|
56
85
|
if (rows.length === 0) return "";
|
|
57
|
-
const
|
|
58
|
-
const
|
|
86
|
+
const labelWidth = Math.max(...rows.map((r) => visibleLen(r[0])));
|
|
87
|
+
const gutter = " ";
|
|
88
|
+
const descWidth = terminalWidth() - indent.length - labelWidth - gutter.length;
|
|
89
|
+
const continuationIndent = " ".repeat(
|
|
90
|
+
indent.length + labelWidth + gutter.length
|
|
91
|
+
);
|
|
59
92
|
return rows.map(([left, right]) => {
|
|
60
|
-
const pad = " ".repeat(
|
|
61
|
-
|
|
93
|
+
const pad = " ".repeat(labelWidth - visibleLen(left));
|
|
94
|
+
const wrapped = wrapText(right, descWidth, continuationIndent);
|
|
95
|
+
return `${indent}${left}${pad}${gutter}${wrapped}`;
|
|
62
96
|
}).join("\n");
|
|
63
97
|
}
|
|
98
|
+
function collectSubCommands(cmd) {
|
|
99
|
+
const subs = cmd.subCommands ?? {};
|
|
100
|
+
const out = [];
|
|
101
|
+
for (const [name, sub] of Object.entries(subs)) {
|
|
102
|
+
const meta = sub?.meta ?? {};
|
|
103
|
+
if (meta.hidden) continue;
|
|
104
|
+
out.push({
|
|
105
|
+
name,
|
|
106
|
+
description: meta.description ?? "",
|
|
107
|
+
group: meta.group ?? "other"
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
function renderCommandsBlock(entries) {
|
|
113
|
+
if (entries.length === 0) return [];
|
|
114
|
+
const lines = [];
|
|
115
|
+
lines.push(underline(bold("COMMANDS")));
|
|
116
|
+
const byGroup = /* @__PURE__ */ new Map();
|
|
117
|
+
for (const entry2 of entries) {
|
|
118
|
+
const arr = byGroup.get(entry2.group) ?? [];
|
|
119
|
+
arr.push(entry2);
|
|
120
|
+
byGroup.set(entry2.group, arr);
|
|
121
|
+
}
|
|
122
|
+
const renderSection = (label, items) => {
|
|
123
|
+
if (items.length === 0) return;
|
|
124
|
+
lines.push("");
|
|
125
|
+
lines.push(` ${grey(label)}`);
|
|
126
|
+
const rows = items.map((e) => [
|
|
127
|
+
cyan(e.name),
|
|
128
|
+
e.description
|
|
129
|
+
]);
|
|
130
|
+
lines.push(alignTable(rows, " "));
|
|
131
|
+
};
|
|
132
|
+
for (const { key, label } of GROUPS) {
|
|
133
|
+
renderSection(label, byGroup.get(key) ?? []);
|
|
134
|
+
byGroup.delete(key);
|
|
135
|
+
}
|
|
136
|
+
for (const [groupKey, items] of byGroup) {
|
|
137
|
+
const label = groupKey === "other" ? "Other" : groupKey;
|
|
138
|
+
renderSection(label, items);
|
|
139
|
+
}
|
|
140
|
+
lines.push("");
|
|
141
|
+
return lines;
|
|
142
|
+
}
|
|
64
143
|
function renderUsageBlock(cmd, commandPath) {
|
|
65
144
|
const meta = cmd.meta ?? {};
|
|
66
145
|
const args = resolveArgs(cmd.args ?? {});
|
|
67
|
-
const
|
|
146
|
+
const subCommandEntries = collectSubCommands(cmd);
|
|
68
147
|
const fullName = commandPath.join(" ") || meta.name || "monoceros";
|
|
69
148
|
const positionals = args.filter((a) => a.type === "positional");
|
|
70
149
|
const flags = args.filter((a) => a.type !== "positional");
|
|
@@ -74,17 +153,12 @@ function renderUsageBlock(cmd, commandPath) {
|
|
|
74
153
|
const t = p.name.toUpperCase();
|
|
75
154
|
usageTokens.push(isRequired ? `<${t}>` : `[${t}]`);
|
|
76
155
|
}
|
|
77
|
-
|
|
78
|
-
const sub = subCommands[n];
|
|
79
|
-
const subMeta = sub?.meta ?? {};
|
|
80
|
-
return !subMeta.hidden;
|
|
81
|
-
});
|
|
82
|
-
if (subCommandNames.length > 0) usageTokens.push(subCommandNames.join("|"));
|
|
156
|
+
if (subCommandEntries.length > 0) usageTokens.push("<command>");
|
|
83
157
|
if (flags.length > 0) usageTokens.push("[OPTIONS]");
|
|
84
158
|
const lines = [];
|
|
85
159
|
const version = meta.version;
|
|
86
160
|
const header = `${meta.description ?? ""} (${fullName}${version ? ` v${version}` : ""})`;
|
|
87
|
-
lines.push(grey(header));
|
|
161
|
+
lines.push(grey(wrapText(header, terminalWidth(), "")));
|
|
88
162
|
lines.push("");
|
|
89
163
|
lines.push(
|
|
90
164
|
`${underline(bold("USAGE"))} ${cyan([fullName, ...usageTokens].join(" "))}`
|
|
@@ -112,17 +186,10 @@ function renderUsageBlock(cmd, commandPath) {
|
|
|
112
186
|
lines.push(alignTable(rows, " "));
|
|
113
187
|
lines.push("");
|
|
114
188
|
}
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const rows = [];
|
|
119
|
-
for (const n of subCommandNames) {
|
|
120
|
-
const sub = subCommands[n];
|
|
121
|
-
const subMeta = sub?.meta ?? {};
|
|
122
|
-
rows.push([cyan(n), subMeta.description ?? ""]);
|
|
189
|
+
if (subCommandEntries.length > 0) {
|
|
190
|
+
for (const line of renderCommandsBlock(subCommandEntries)) {
|
|
191
|
+
lines.push(line);
|
|
123
192
|
}
|
|
124
|
-
lines.push(alignTable(rows, " "));
|
|
125
|
-
lines.push("");
|
|
126
193
|
lines.push(
|
|
127
194
|
`Use ${cyan(`${fullName} <command> --help`)} for more information about a command.`
|
|
128
195
|
);
|
|
@@ -185,7 +252,7 @@ function getInnerArgs() {
|
|
|
185
252
|
}
|
|
186
253
|
|
|
187
254
|
// src/main.ts
|
|
188
|
-
import { defineCommand as
|
|
255
|
+
import { defineCommand as defineCommand25 } from "citty";
|
|
189
256
|
|
|
190
257
|
// src/commands/add-apt-packages.ts
|
|
191
258
|
import { defineCommand } from "citty";
|
|
@@ -1279,6 +1346,7 @@ var defaultConfirm = async (message) => {
|
|
|
1279
1346
|
var addAptPackagesCommand = defineCommand({
|
|
1280
1347
|
meta: {
|
|
1281
1348
|
name: "add-apt-packages",
|
|
1349
|
+
group: "edit",
|
|
1282
1350
|
description: "Add Debian/Ubuntu apt packages to the container config. Pass package names after `--` (e.g. `monoceros add-apt-packages sandbox -- make openssh-client jq`). Idempotent. No curated whitelist \u2014 invalid names surface as apt errors at container build time."
|
|
1283
1351
|
},
|
|
1284
1352
|
args: {
|
|
@@ -1322,6 +1390,7 @@ import { consola as consola3 } from "consola";
|
|
|
1322
1390
|
var addFeatureCommand = defineCommand2({
|
|
1323
1391
|
meta: {
|
|
1324
1392
|
name: "add-feature",
|
|
1393
|
+
group: "edit",
|
|
1325
1394
|
description: "Add a devcontainer feature by ref to the container config. Options follow `--` as `key=value` pairs. Idempotent (same ref + same options is a no-op). Adding the same ref with different options is an error."
|
|
1326
1395
|
},
|
|
1327
1396
|
args: {
|
|
@@ -1395,6 +1464,7 @@ import { consola as consola4 } from "consola";
|
|
|
1395
1464
|
var addFromUrlCommand = defineCommand3({
|
|
1396
1465
|
meta: {
|
|
1397
1466
|
name: "add-from-url",
|
|
1467
|
+
group: "edit",
|
|
1398
1468
|
description: "Add an https:// install URL to the container config. The URL gets piped to sh on every container rebuild. Loudly warns about remote-code execution before persisting. Idempotent."
|
|
1399
1469
|
},
|
|
1400
1470
|
args: {
|
|
@@ -1466,6 +1536,7 @@ import { consola as consola5 } from "consola";
|
|
|
1466
1536
|
var addRepoCommand = defineCommand4({
|
|
1467
1537
|
meta: {
|
|
1468
1538
|
name: "add-repo",
|
|
1539
|
+
group: "edit",
|
|
1469
1540
|
description: "Add a git repo to the container config. Cloned into projects/<folder>/ on container build. Idempotent \u2014 existing project subfolders are left alone. Folder name derived from URL by default; override with --as."
|
|
1470
1541
|
},
|
|
1471
1542
|
args: {
|
|
@@ -1517,6 +1588,7 @@ import { consola as consola6 } from "consola";
|
|
|
1517
1588
|
var addLanguageCommand = defineCommand5({
|
|
1518
1589
|
meta: {
|
|
1519
1590
|
name: "add-language",
|
|
1591
|
+
group: "edit",
|
|
1520
1592
|
description: "Add a language toolchain (devcontainer feature) to the container config. Idempotent, prints a diff before writing."
|
|
1521
1593
|
},
|
|
1522
1594
|
args: {
|
|
@@ -1558,6 +1630,7 @@ import { consola as consola7 } from "consola";
|
|
|
1558
1630
|
var addServiceCommand = defineCommand6({
|
|
1559
1631
|
meta: {
|
|
1560
1632
|
name: "add-service",
|
|
1633
|
+
group: "edit",
|
|
1561
1634
|
description: "Add a compose service (postgres, mysql, redis, \u2026) to the container config. Idempotent, prints a diff before writing."
|
|
1562
1635
|
},
|
|
1563
1636
|
args: {
|
|
@@ -2289,7 +2362,7 @@ function warnOnDeprecatedFeatureRefs(containerFeatures, globalConfig, logger) {
|
|
|
2289
2362
|
}
|
|
2290
2363
|
|
|
2291
2364
|
// src/version.ts
|
|
2292
|
-
var CLI_VERSION = "1.
|
|
2365
|
+
var CLI_VERSION = "1.1.0";
|
|
2293
2366
|
|
|
2294
2367
|
// src/commands/_dispatch.ts
|
|
2295
2368
|
import { consola as consola11 } from "consola";
|
|
@@ -2307,6 +2380,7 @@ async function dispatch(runner) {
|
|
|
2307
2380
|
var applyCommand = defineCommand7({
|
|
2308
2381
|
meta: {
|
|
2309
2382
|
name: "apply",
|
|
2383
|
+
group: "lifecycle",
|
|
2310
2384
|
description: "Materialize a container config into $MONOCEROS_HOME/container/<name>/ and bring the dev-container up. Close any VS Code Remote Containers session for the target first \u2014 the extension auto-recreates and races with apply."
|
|
2311
2385
|
},
|
|
2312
2386
|
args: {
|
|
@@ -2327,8 +2401,167 @@ var applyCommand = defineCommand7({
|
|
|
2327
2401
|
}
|
|
2328
2402
|
});
|
|
2329
2403
|
|
|
2330
|
-
// src/commands/
|
|
2404
|
+
// src/commands/completion.ts
|
|
2331
2405
|
import { defineCommand as defineCommand8 } from "citty";
|
|
2406
|
+
var ALL_COMMANDS = [
|
|
2407
|
+
"init",
|
|
2408
|
+
"list-components",
|
|
2409
|
+
"shell",
|
|
2410
|
+
"run",
|
|
2411
|
+
"logs",
|
|
2412
|
+
"start",
|
|
2413
|
+
"stop",
|
|
2414
|
+
"status",
|
|
2415
|
+
"apply",
|
|
2416
|
+
"remove",
|
|
2417
|
+
"restore",
|
|
2418
|
+
"add-service",
|
|
2419
|
+
"add-language",
|
|
2420
|
+
"add-apt-packages",
|
|
2421
|
+
"add-feature",
|
|
2422
|
+
"add-from-url",
|
|
2423
|
+
"add-repo",
|
|
2424
|
+
"remove-service",
|
|
2425
|
+
"remove-language",
|
|
2426
|
+
"remove-apt-packages",
|
|
2427
|
+
"remove-feature",
|
|
2428
|
+
"remove-from-url",
|
|
2429
|
+
"remove-repo",
|
|
2430
|
+
"completion"
|
|
2431
|
+
];
|
|
2432
|
+
var COMMANDS_WITH_CONTAINER_ARG = [
|
|
2433
|
+
"shell",
|
|
2434
|
+
"run",
|
|
2435
|
+
"logs",
|
|
2436
|
+
"start",
|
|
2437
|
+
"stop",
|
|
2438
|
+
"status",
|
|
2439
|
+
"apply",
|
|
2440
|
+
"remove",
|
|
2441
|
+
"add-service",
|
|
2442
|
+
"add-language",
|
|
2443
|
+
"add-apt-packages",
|
|
2444
|
+
"add-feature",
|
|
2445
|
+
"add-from-url",
|
|
2446
|
+
"add-repo",
|
|
2447
|
+
"remove-service",
|
|
2448
|
+
"remove-language",
|
|
2449
|
+
"remove-apt-packages",
|
|
2450
|
+
"remove-feature",
|
|
2451
|
+
"remove-from-url",
|
|
2452
|
+
"remove-repo"
|
|
2453
|
+
];
|
|
2454
|
+
var SHELLS = ["bash", "zsh"];
|
|
2455
|
+
function renderCompletionScript(shell) {
|
|
2456
|
+
const commands = ALL_COMMANDS.join(" ");
|
|
2457
|
+
const containerCommandsRegex = COMMANDS_WITH_CONTAINER_ARG.join("|");
|
|
2458
|
+
if (shell === "bash") {
|
|
2459
|
+
return [
|
|
2460
|
+
"# bash completion for monoceros",
|
|
2461
|
+
"# install: source this file from .bashrc, e.g.",
|
|
2462
|
+
"# monoceros completion bash > ~/.bash_completion.d/monoceros",
|
|
2463
|
+
'# echo "source ~/.bash_completion.d/monoceros" >> ~/.bashrc',
|
|
2464
|
+
"",
|
|
2465
|
+
"_monoceros() {",
|
|
2466
|
+
" local cur prev cmd home configs_dir names",
|
|
2467
|
+
' cur="${COMP_WORDS[COMP_CWORD]}"',
|
|
2468
|
+
"",
|
|
2469
|
+
" if [[ $COMP_CWORD -eq 1 ]]; then",
|
|
2470
|
+
` COMPREPLY=( $(compgen -W "${commands}" -- "$cur") )`,
|
|
2471
|
+
" return",
|
|
2472
|
+
" fi",
|
|
2473
|
+
"",
|
|
2474
|
+
' cmd="${COMP_WORDS[1]}"',
|
|
2475
|
+
" if [[ $COMP_CWORD -eq 2 ]]; then",
|
|
2476
|
+
' case "$cmd" in',
|
|
2477
|
+
` ${containerCommandsRegex})`,
|
|
2478
|
+
' home="${MONOCEROS_HOME:-$HOME/.monoceros}"',
|
|
2479
|
+
' configs_dir="$home/container-configs"',
|
|
2480
|
+
' if [[ -d "$configs_dir" ]]; then',
|
|
2481
|
+
` names=$(cd "$configs_dir" && ls *.yml 2>/dev/null | sed 's/\\.yml$//')`,
|
|
2482
|
+
' COMPREPLY=( $(compgen -W "$names" -- "$cur") )',
|
|
2483
|
+
" fi",
|
|
2484
|
+
" ;;",
|
|
2485
|
+
" completion)",
|
|
2486
|
+
` COMPREPLY=( $(compgen -W "${SHELLS.join(" ")}" -- "$cur") )`,
|
|
2487
|
+
" ;;",
|
|
2488
|
+
" esac",
|
|
2489
|
+
" fi",
|
|
2490
|
+
"}",
|
|
2491
|
+
"complete -F _monoceros monoceros",
|
|
2492
|
+
""
|
|
2493
|
+
].join("\n");
|
|
2494
|
+
}
|
|
2495
|
+
return [
|
|
2496
|
+
"#compdef monoceros",
|
|
2497
|
+
"# zsh completion for monoceros",
|
|
2498
|
+
"# install: drop this file somewhere on your $fpath as `_monoceros`,",
|
|
2499
|
+
"# then start a new shell (or run `compinit`). Example:",
|
|
2500
|
+
'# monoceros completion zsh > "${fpath[1]}/_monoceros"',
|
|
2501
|
+
"",
|
|
2502
|
+
"_monoceros() {",
|
|
2503
|
+
" local -a commands shells",
|
|
2504
|
+
" commands=(",
|
|
2505
|
+
...ALL_COMMANDS.map((c) => ` '${c}'`),
|
|
2506
|
+
" )",
|
|
2507
|
+
` shells=(${SHELLS.map((s) => `'${s}'`).join(" ")})`,
|
|
2508
|
+
"",
|
|
2509
|
+
" if (( CURRENT == 2 )); then",
|
|
2510
|
+
" _describe 'monoceros command' commands",
|
|
2511
|
+
" return",
|
|
2512
|
+
" fi",
|
|
2513
|
+
"",
|
|
2514
|
+
" local cmd=${words[2]}",
|
|
2515
|
+
" if (( CURRENT == 3 )); then",
|
|
2516
|
+
" case $cmd in",
|
|
2517
|
+
` ${containerCommandsRegex})`,
|
|
2518
|
+
' local home="${MONOCEROS_HOME:-$HOME/.monoceros}"',
|
|
2519
|
+
' local configs_dir="$home/container-configs"',
|
|
2520
|
+
" if [[ -d $configs_dir ]]; then",
|
|
2521
|
+
" local -a names",
|
|
2522
|
+
" names=(${configs_dir}/*.yml(N:t:r))",
|
|
2523
|
+
" _describe 'container' names",
|
|
2524
|
+
" fi",
|
|
2525
|
+
" ;;",
|
|
2526
|
+
" completion)",
|
|
2527
|
+
" _describe 'shell' shells",
|
|
2528
|
+
" ;;",
|
|
2529
|
+
" esac",
|
|
2530
|
+
" fi",
|
|
2531
|
+
"}",
|
|
2532
|
+
"",
|
|
2533
|
+
'_monoceros "$@"',
|
|
2534
|
+
""
|
|
2535
|
+
].join("\n");
|
|
2536
|
+
}
|
|
2537
|
+
var completionCommand = defineCommand8({
|
|
2538
|
+
meta: {
|
|
2539
|
+
name: "completion",
|
|
2540
|
+
group: "tooling",
|
|
2541
|
+
description: "Print a shell completion script for bash or zsh to stdout. Pipe the output into a file your shell loads at startup."
|
|
2542
|
+
},
|
|
2543
|
+
args: {
|
|
2544
|
+
shell: {
|
|
2545
|
+
type: "positional",
|
|
2546
|
+
description: "Target shell. One of: 'bash', 'zsh'.",
|
|
2547
|
+
required: true
|
|
2548
|
+
}
|
|
2549
|
+
},
|
|
2550
|
+
run({ args }) {
|
|
2551
|
+
const shell = args.shell;
|
|
2552
|
+
if (shell !== "bash" && shell !== "zsh") {
|
|
2553
|
+
process.stderr.write(
|
|
2554
|
+
`Unknown shell: ${JSON.stringify(shell)}. Supported: ${SHELLS.join(", ")}.
|
|
2555
|
+
`
|
|
2556
|
+
);
|
|
2557
|
+
process.exit(2);
|
|
2558
|
+
}
|
|
2559
|
+
process.stdout.write(renderCompletionScript(shell));
|
|
2560
|
+
}
|
|
2561
|
+
});
|
|
2562
|
+
|
|
2563
|
+
// src/commands/init.ts
|
|
2564
|
+
import { defineCommand as defineCommand9 } from "citty";
|
|
2332
2565
|
import { consola as consola13 } from "consola";
|
|
2333
2566
|
|
|
2334
2567
|
// src/init/index.ts
|
|
@@ -2788,9 +3021,10 @@ async function runInit(opts) {
|
|
|
2788
3021
|
}
|
|
2789
3022
|
|
|
2790
3023
|
// src/commands/init.ts
|
|
2791
|
-
var initCommand =
|
|
3024
|
+
var initCommand = defineCommand9({
|
|
2792
3025
|
meta: {
|
|
2793
3026
|
name: "init",
|
|
3027
|
+
group: "lifecycle",
|
|
2794
3028
|
description: "Create a fresh container-config yml at .local/container-configs/<name>.yml. Without --with, the file is a documented default with every component commented out. With --with=<names>, the named components are composed into an active, immediately-applyable yml. Then run `monoceros apply <name>`."
|
|
2795
3029
|
},
|
|
2796
3030
|
args: {
|
|
@@ -2841,11 +3075,12 @@ function collectWithList(withArg, rawArgs) {
|
|
|
2841
3075
|
}
|
|
2842
3076
|
|
|
2843
3077
|
// src/commands/list-components.ts
|
|
2844
|
-
import { defineCommand as
|
|
3078
|
+
import { defineCommand as defineCommand10 } from "citty";
|
|
2845
3079
|
import { consola as consola14 } from "consola";
|
|
2846
|
-
var listComponentsCommand =
|
|
3080
|
+
var listComponentsCommand = defineCommand10({
|
|
2847
3081
|
meta: {
|
|
2848
3082
|
name: "list-components",
|
|
3083
|
+
group: "discovery",
|
|
2849
3084
|
description: "Print the components catalog used by `monoceros init --with=\u2026`. Each line is `name<TAB>category<TAB>displayName`, grouped by category for readability."
|
|
2850
3085
|
},
|
|
2851
3086
|
args: {},
|
|
@@ -2885,10 +3120,11 @@ var listComponentsCommand = defineCommand9({
|
|
|
2885
3120
|
});
|
|
2886
3121
|
|
|
2887
3122
|
// src/commands/logs.ts
|
|
2888
|
-
import { defineCommand as
|
|
2889
|
-
var logsCommand =
|
|
3123
|
+
import { defineCommand as defineCommand11 } from "citty";
|
|
3124
|
+
var logsCommand = defineCommand11({
|
|
2890
3125
|
meta: {
|
|
2891
3126
|
name: "logs",
|
|
3127
|
+
group: "run",
|
|
2892
3128
|
description: "Tail logs from the compose services of the named dev-container. Pass --no-follow for a one-shot dump."
|
|
2893
3129
|
},
|
|
2894
3130
|
args: {
|
|
@@ -2920,11 +3156,12 @@ var logsCommand = defineCommand10({
|
|
|
2920
3156
|
});
|
|
2921
3157
|
|
|
2922
3158
|
// src/commands/remove-apt-packages.ts
|
|
2923
|
-
import { defineCommand as
|
|
3159
|
+
import { defineCommand as defineCommand12 } from "citty";
|
|
2924
3160
|
import { consola as consola15 } from "consola";
|
|
2925
|
-
var removeAptPackagesCommand =
|
|
3161
|
+
var removeAptPackagesCommand = defineCommand12({
|
|
2926
3162
|
meta: {
|
|
2927
3163
|
name: "remove-apt-packages",
|
|
3164
|
+
group: "edit",
|
|
2928
3165
|
description: "Remove apt packages from the container config. Pass package names after `--` (e.g. `monoceros remove-apt-packages sandbox -- make jq`). Idempotent, prints a diff before writing."
|
|
2929
3166
|
},
|
|
2930
3167
|
args: {
|
|
@@ -2963,11 +3200,12 @@ var removeAptPackagesCommand = defineCommand11({
|
|
|
2963
3200
|
});
|
|
2964
3201
|
|
|
2965
3202
|
// src/commands/remove-feature.ts
|
|
2966
|
-
import { defineCommand as
|
|
3203
|
+
import { defineCommand as defineCommand13 } from "citty";
|
|
2967
3204
|
import { consola as consola16 } from "consola";
|
|
2968
|
-
var removeFeatureCommand =
|
|
3205
|
+
var removeFeatureCommand = defineCommand13({
|
|
2969
3206
|
meta: {
|
|
2970
3207
|
name: "remove-feature",
|
|
3208
|
+
group: "edit",
|
|
2971
3209
|
description: "Remove a devcontainer feature from the container config (by its OCI ref). Idempotent, prints a diff before writing."
|
|
2972
3210
|
},
|
|
2973
3211
|
args: {
|
|
@@ -3004,7 +3242,7 @@ var removeFeatureCommand = defineCommand12({
|
|
|
3004
3242
|
});
|
|
3005
3243
|
|
|
3006
3244
|
// src/commands/remove.ts
|
|
3007
|
-
import { defineCommand as
|
|
3245
|
+
import { defineCommand as defineCommand14 } from "citty";
|
|
3008
3246
|
import { consola as consola18 } from "consola";
|
|
3009
3247
|
import { createInterface } from "readline/promises";
|
|
3010
3248
|
|
|
@@ -3090,9 +3328,10 @@ async function runRemove(opts) {
|
|
|
3090
3328
|
}
|
|
3091
3329
|
|
|
3092
3330
|
// src/commands/remove.ts
|
|
3093
|
-
var removeCommand =
|
|
3331
|
+
var removeCommand = defineCommand14({
|
|
3094
3332
|
meta: {
|
|
3095
3333
|
name: "remove",
|
|
3334
|
+
group: "lifecycle",
|
|
3096
3335
|
description: "Wipe everything belonging to a container: stop and remove the docker objects, back up the container-configs yml + container directory (incl. home/, projects/, data/), then delete them from disk. Shared docker images stay. By default the destructive step is confirmed interactively; pass -y to skip."
|
|
3097
3336
|
},
|
|
3098
3337
|
args: {
|
|
@@ -3150,7 +3389,7 @@ var removeCommand = defineCommand13({
|
|
|
3150
3389
|
});
|
|
3151
3390
|
|
|
3152
3391
|
// src/commands/restore.ts
|
|
3153
|
-
import { defineCommand as
|
|
3392
|
+
import { defineCommand as defineCommand15 } from "citty";
|
|
3154
3393
|
import { consola as consola20 } from "consola";
|
|
3155
3394
|
|
|
3156
3395
|
// src/restore/index.ts
|
|
@@ -3218,9 +3457,10 @@ async function runRestore(opts) {
|
|
|
3218
3457
|
}
|
|
3219
3458
|
|
|
3220
3459
|
// src/commands/restore.ts
|
|
3221
|
-
var restoreCommand =
|
|
3460
|
+
var restoreCommand = defineCommand15({
|
|
3222
3461
|
meta: {
|
|
3223
3462
|
name: "restore",
|
|
3463
|
+
group: "lifecycle",
|
|
3224
3464
|
description: "Restore a container's host-side state from a backup written by `monoceros remove`. Copies the yml and the container directory back into $MONOCEROS_HOME. Refuses to overwrite an existing config or container \u2014 remove the in-place container first if you need to clobber. Run `monoceros apply <name>` afterwards to bring it back up."
|
|
3225
3465
|
},
|
|
3226
3466
|
args: {
|
|
@@ -3241,11 +3481,12 @@ var restoreCommand = defineCommand14({
|
|
|
3241
3481
|
});
|
|
3242
3482
|
|
|
3243
3483
|
// src/commands/remove-from-url.ts
|
|
3244
|
-
import { defineCommand as
|
|
3484
|
+
import { defineCommand as defineCommand16 } from "citty";
|
|
3245
3485
|
import { consola as consola21 } from "consola";
|
|
3246
|
-
var removeFromUrlCommand =
|
|
3486
|
+
var removeFromUrlCommand = defineCommand16({
|
|
3247
3487
|
meta: {
|
|
3248
3488
|
name: "remove-from-url",
|
|
3489
|
+
group: "edit",
|
|
3249
3490
|
description: "Remove a previously-added install URL from the container config. Idempotent, prints a diff before writing. The URL is dropped from post-create.sh on the next `monoceros apply`."
|
|
3250
3491
|
},
|
|
3251
3492
|
args: {
|
|
@@ -3282,11 +3523,12 @@ var removeFromUrlCommand = defineCommand15({
|
|
|
3282
3523
|
});
|
|
3283
3524
|
|
|
3284
3525
|
// src/commands/remove-language.ts
|
|
3285
|
-
import { defineCommand as
|
|
3526
|
+
import { defineCommand as defineCommand17 } from "citty";
|
|
3286
3527
|
import { consola as consola22 } from "consola";
|
|
3287
|
-
var removeLanguageCommand =
|
|
3528
|
+
var removeLanguageCommand = defineCommand17({
|
|
3288
3529
|
meta: {
|
|
3289
3530
|
name: "remove-language",
|
|
3531
|
+
group: "edit",
|
|
3290
3532
|
description: "Remove a language toolchain from the container config. Idempotent, prints a diff before writing."
|
|
3291
3533
|
},
|
|
3292
3534
|
args: {
|
|
@@ -3323,11 +3565,12 @@ var removeLanguageCommand = defineCommand16({
|
|
|
3323
3565
|
});
|
|
3324
3566
|
|
|
3325
3567
|
// src/commands/remove-repo.ts
|
|
3326
|
-
import { defineCommand as
|
|
3568
|
+
import { defineCommand as defineCommand18 } from "citty";
|
|
3327
3569
|
import { consola as consola23 } from "consola";
|
|
3328
|
-
var removeRepoCommand =
|
|
3570
|
+
var removeRepoCommand = defineCommand18({
|
|
3329
3571
|
meta: {
|
|
3330
3572
|
name: "remove-repo",
|
|
3573
|
+
group: "edit",
|
|
3331
3574
|
description: "Remove a repo from the container config (matches by URL or by its projects/<folder> name). Does NOT delete the existing projects/<folder> directory \u2014 local edits are preserved; clean it up manually."
|
|
3332
3575
|
},
|
|
3333
3576
|
args: {
|
|
@@ -3364,11 +3607,12 @@ var removeRepoCommand = defineCommand17({
|
|
|
3364
3607
|
});
|
|
3365
3608
|
|
|
3366
3609
|
// src/commands/remove-service.ts
|
|
3367
|
-
import { defineCommand as
|
|
3610
|
+
import { defineCommand as defineCommand19 } from "citty";
|
|
3368
3611
|
import { consola as consola24 } from "consola";
|
|
3369
|
-
var removeServiceCommand =
|
|
3612
|
+
var removeServiceCommand = defineCommand19({
|
|
3370
3613
|
meta: {
|
|
3371
3614
|
name: "remove-service",
|
|
3615
|
+
group: "edit",
|
|
3372
3616
|
description: "Remove a compose service from the container config. Idempotent, prints a diff before writing. Note: data volumes (e.g. postgres-data) are NOT cleaned up automatically."
|
|
3373
3617
|
},
|
|
3374
3618
|
args: {
|
|
@@ -3405,7 +3649,7 @@ var removeServiceCommand = defineCommand18({
|
|
|
3405
3649
|
});
|
|
3406
3650
|
|
|
3407
3651
|
// src/commands/run.ts
|
|
3408
|
-
import { defineCommand as
|
|
3652
|
+
import { defineCommand as defineCommand20 } from "citty";
|
|
3409
3653
|
import { consola as consola25 } from "consola";
|
|
3410
3654
|
|
|
3411
3655
|
// src/devcontainer/shell.ts
|
|
@@ -3455,9 +3699,10 @@ async function runInContainer(opts) {
|
|
|
3455
3699
|
}
|
|
3456
3700
|
|
|
3457
3701
|
// src/commands/run.ts
|
|
3458
|
-
var runCommand =
|
|
3702
|
+
var runCommand = defineCommand20({
|
|
3459
3703
|
meta: {
|
|
3460
3704
|
name: "run",
|
|
3705
|
+
group: "run",
|
|
3461
3706
|
description: "Run a one-off command inside the named dev-container. Use `--` to separate monoceros flags from the inner command."
|
|
3462
3707
|
},
|
|
3463
3708
|
args: {
|
|
@@ -3489,11 +3734,12 @@ var runCommand = defineCommand19({
|
|
|
3489
3734
|
});
|
|
3490
3735
|
|
|
3491
3736
|
// src/commands/shell.ts
|
|
3492
|
-
import { defineCommand as
|
|
3737
|
+
import { defineCommand as defineCommand21 } from "citty";
|
|
3493
3738
|
import { consola as consola26 } from "consola";
|
|
3494
|
-
var shellCommand =
|
|
3739
|
+
var shellCommand = defineCommand21({
|
|
3495
3740
|
meta: {
|
|
3496
3741
|
name: "shell",
|
|
3742
|
+
group: "run",
|
|
3497
3743
|
description: "Open an interactive bash session inside the named dev-container."
|
|
3498
3744
|
},
|
|
3499
3745
|
args: {
|
|
@@ -3515,10 +3761,11 @@ var shellCommand = defineCommand20({
|
|
|
3515
3761
|
});
|
|
3516
3762
|
|
|
3517
3763
|
// src/commands/start.ts
|
|
3518
|
-
import { defineCommand as
|
|
3519
|
-
var startCommand =
|
|
3764
|
+
import { defineCommand as defineCommand22 } from "citty";
|
|
3765
|
+
var startCommand = defineCommand22({
|
|
3520
3766
|
meta: {
|
|
3521
3767
|
name: "start",
|
|
3768
|
+
group: "run",
|
|
3522
3769
|
description: "Bring the named dev-container up via `devcontainer up` (workspace + runServices, postCreate, features)."
|
|
3523
3770
|
},
|
|
3524
3771
|
args: {
|
|
@@ -3534,10 +3781,11 @@ var startCommand = defineCommand21({
|
|
|
3534
3781
|
});
|
|
3535
3782
|
|
|
3536
3783
|
// src/commands/status.ts
|
|
3537
|
-
import { defineCommand as
|
|
3538
|
-
var statusCommand =
|
|
3784
|
+
import { defineCommand as defineCommand23 } from "citty";
|
|
3785
|
+
var statusCommand = defineCommand23({
|
|
3539
3786
|
meta: {
|
|
3540
3787
|
name: "status",
|
|
3788
|
+
group: "run",
|
|
3541
3789
|
description: "Show whether the compose services for the named dev-container are running."
|
|
3542
3790
|
},
|
|
3543
3791
|
args: {
|
|
@@ -3562,10 +3810,11 @@ var statusCommand = defineCommand22({
|
|
|
3562
3810
|
});
|
|
3563
3811
|
|
|
3564
3812
|
// src/commands/stop.ts
|
|
3565
|
-
import { defineCommand as
|
|
3566
|
-
var stopCommand =
|
|
3813
|
+
import { defineCommand as defineCommand24 } from "citty";
|
|
3814
|
+
var stopCommand = defineCommand24({
|
|
3567
3815
|
meta: {
|
|
3568
3816
|
name: "stop",
|
|
3817
|
+
group: "run",
|
|
3569
3818
|
description: "Stop the compose services for the named dev-container. Volumes are preserved."
|
|
3570
3819
|
},
|
|
3571
3820
|
args: {
|
|
@@ -3590,7 +3839,7 @@ var stopCommand = defineCommand23({
|
|
|
3590
3839
|
});
|
|
3591
3840
|
|
|
3592
3841
|
// src/main.ts
|
|
3593
|
-
var main =
|
|
3842
|
+
var main = defineCommand25({
|
|
3594
3843
|
meta: {
|
|
3595
3844
|
name: "monoceros",
|
|
3596
3845
|
version: CLI_VERSION,
|
|
@@ -3619,7 +3868,8 @@ var main = defineCommand24({
|
|
|
3619
3868
|
"remove-apt-packages": removeAptPackagesCommand,
|
|
3620
3869
|
"remove-feature": removeFeatureCommand,
|
|
3621
3870
|
"remove-from-url": removeFromUrlCommand,
|
|
3622
|
-
"remove-repo": removeRepoCommand
|
|
3871
|
+
"remove-repo": removeRepoCommand,
|
|
3872
|
+
completion: completionCommand
|
|
3623
3873
|
}
|
|
3624
3874
|
});
|
|
3625
3875
|
|