@treeseed/cli 0.1.1 → 0.4.2
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 +27 -26
- package/dist/cli/handlers/auth-login.d.ts +2 -0
- package/dist/cli/handlers/auth-login.js +67 -0
- package/dist/cli/handlers/auth-logout.d.ts +2 -0
- package/dist/cli/handlers/auth-logout.js +20 -0
- package/dist/cli/handlers/auth-whoami.d.ts +2 -0
- package/dist/cli/handlers/auth-whoami.js +24 -0
- package/dist/cli/handlers/close.js +19 -53
- package/dist/cli/handlers/config.js +33 -53
- package/dist/cli/handlers/destroy.js +34 -79
- package/dist/{src/cli/handlers/ship.d.ts → cli/handlers/dev.d.ts} +1 -1
- package/dist/cli/handlers/dev.js +19 -0
- package/dist/cli/handlers/doctor.js +13 -6
- package/dist/cli/handlers/init.js +32 -8
- package/dist/cli/handlers/release.js +21 -53
- package/dist/cli/handlers/rollback.js +8 -8
- package/dist/cli/handlers/save.js +21 -79
- package/dist/cli/handlers/stage.d.ts +2 -0
- package/dist/cli/handlers/stage.js +28 -0
- package/dist/cli/handlers/status.js +35 -26
- package/dist/{src/cli/handlers/deploy.d.ts → cli/handlers/switch.d.ts} +1 -1
- package/dist/cli/handlers/switch.js +29 -0
- package/dist/{src/cli/handlers/next.d.ts → cli/handlers/sync.d.ts} +1 -1
- package/dist/cli/handlers/sync.js +26 -0
- package/dist/cli/handlers/tasks.d.ts +2 -0
- package/dist/cli/handlers/tasks.js +31 -0
- package/dist/cli/handlers/template.d.ts +2 -0
- package/dist/cli/handlers/template.js +27 -0
- package/dist/cli/handlers/workflow.d.ts +6 -0
- package/dist/cli/handlers/workflow.js +71 -0
- package/dist/{src/cli → cli}/help.d.ts +2 -2
- package/dist/cli/help.js +36 -24
- package/dist/cli/main.d.ts +6 -0
- package/dist/cli/main.js +14 -19
- package/dist/cli/operations-help.d.ts +1 -0
- package/dist/cli/operations-help.js +1 -0
- package/dist/cli/operations-parser.d.ts +1 -0
- package/dist/cli/operations-parser.js +1 -0
- package/dist/cli/operations-registry.d.ts +5 -0
- package/dist/cli/operations-registry.js +260 -0
- package/dist/cli/operations-types.d.ts +72 -0
- package/dist/cli/parser.d.ts +3 -0
- package/dist/cli/parser.js +1 -6
- package/dist/cli/registry.d.ts +25 -0
- package/dist/cli/registry.js +28 -416
- package/dist/cli/repair.js +6 -4
- package/dist/cli/runtime.d.ts +31 -0
- package/dist/cli/runtime.js +240 -111
- package/dist/cli/types.d.ts +1 -0
- package/dist/{src/cli → cli}/workflow-state.d.ts +9 -0
- package/dist/cli/workflow-state.js +45 -21
- package/package.json +13 -13
- package/dist/cli/handlers/continue.js +0 -23
- package/dist/cli/handlers/deploy.js +0 -139
- package/dist/cli/handlers/next.js +0 -27
- package/dist/cli/handlers/prepare.js +0 -8
- package/dist/cli/handlers/promote.js +0 -8
- package/dist/cli/handlers/publish.js +0 -8
- package/dist/cli/handlers/setup.js +0 -48
- package/dist/cli/handlers/ship.js +0 -49
- package/dist/cli/handlers/start.js +0 -97
- package/dist/cli/handlers/teardown.js +0 -50
- package/dist/cli/handlers/work.js +0 -85
- package/dist/scripts/aggregate-book.d.ts +0 -1
- package/dist/scripts/aggregate-book.js +0 -121
- package/dist/scripts/assert-release-tag-version.d.ts +0 -1
- package/dist/scripts/assert-release-tag-version.js +0 -21
- package/dist/scripts/build-dist.d.ts +0 -1
- package/dist/scripts/build-dist.js +0 -108
- package/dist/scripts/build-tenant-worker.d.ts +0 -1
- package/dist/scripts/build-tenant-worker.js +0 -36
- package/dist/scripts/cleanup-markdown.d.ts +0 -2
- package/dist/scripts/cleanup-markdown.js +0 -373
- package/dist/scripts/config-runtime-lib.d.ts +0 -122
- package/dist/scripts/config-runtime-lib.js +0 -505
- package/dist/scripts/config-treeseed.d.ts +0 -2
- package/dist/scripts/config-treeseed.js +0 -81
- package/dist/scripts/d1-migration-lib.d.ts +0 -6
- package/dist/scripts/d1-migration-lib.js +0 -90
- package/dist/scripts/deploy-lib.d.ts +0 -127
- package/dist/scripts/deploy-lib.js +0 -841
- package/dist/scripts/ensure-mailpit.d.ts +0 -1
- package/dist/scripts/ensure-mailpit.js +0 -29
- package/dist/scripts/git-workflow-lib.d.ts +0 -25
- package/dist/scripts/git-workflow-lib.js +0 -136
- package/dist/scripts/github-automation-lib.d.ts +0 -156
- package/dist/scripts/github-automation-lib.js +0 -242
- package/dist/scripts/local-dev-lib.d.ts +0 -9
- package/dist/scripts/local-dev-lib.js +0 -84
- package/dist/scripts/local-dev.d.ts +0 -1
- package/dist/scripts/local-dev.js +0 -129
- package/dist/scripts/logs-mailpit.d.ts +0 -1
- package/dist/scripts/logs-mailpit.js +0 -2
- package/dist/scripts/mailpit-runtime.d.ts +0 -4
- package/dist/scripts/mailpit-runtime.js +0 -57
- package/dist/scripts/package-tools.d.ts +0 -22
- package/dist/scripts/package-tools.js +0 -255
- package/dist/scripts/patch-starlight-content-path.d.ts +0 -1
- package/dist/scripts/patch-starlight-content-path.js +0 -172
- package/dist/scripts/paths.d.ts +0 -17
- package/dist/scripts/paths.js +0 -26
- package/dist/scripts/publish-package.d.ts +0 -1
- package/dist/scripts/publish-package.js +0 -19
- package/dist/scripts/release-verify.d.ts +0 -1
- package/dist/scripts/release-verify.js +0 -136
- package/dist/scripts/run-fixture-astro-command.d.ts +0 -1
- package/dist/scripts/run-fixture-astro-command.js +0 -18
- package/dist/scripts/save-deploy-preflight-lib.d.ts +0 -34
- package/dist/scripts/save-deploy-preflight-lib.js +0 -69
- package/dist/scripts/scaffold-site.d.ts +0 -2
- package/dist/scripts/scaffold-site.js +0 -92
- package/dist/scripts/stop-mailpit.d.ts +0 -1
- package/dist/scripts/stop-mailpit.js +0 -5
- package/dist/scripts/sync-dev-vars.d.ts +0 -1
- package/dist/scripts/sync-dev-vars.js +0 -6
- package/dist/scripts/template-registry-lib.d.ts +0 -47
- package/dist/scripts/template-registry-lib.js +0 -137
- package/dist/scripts/tenant-astro-command.d.ts +0 -1
- package/dist/scripts/tenant-astro-command.js +0 -3
- package/dist/scripts/tenant-build.d.ts +0 -1
- package/dist/scripts/tenant-build.js +0 -16
- package/dist/scripts/tenant-check.d.ts +0 -1
- package/dist/scripts/tenant-check.js +0 -7
- package/dist/scripts/tenant-d1-migrate-local.d.ts +0 -1
- package/dist/scripts/tenant-d1-migrate-local.js +0 -11
- package/dist/scripts/tenant-deploy.d.ts +0 -2
- package/dist/scripts/tenant-deploy.js +0 -180
- package/dist/scripts/tenant-destroy.d.ts +0 -2
- package/dist/scripts/tenant-destroy.js +0 -104
- package/dist/scripts/tenant-dev.d.ts +0 -1
- package/dist/scripts/tenant-dev.js +0 -171
- package/dist/scripts/tenant-lint.d.ts +0 -1
- package/dist/scripts/tenant-lint.js +0 -4
- package/dist/scripts/tenant-test.d.ts +0 -1
- package/dist/scripts/tenant-test.js +0 -4
- package/dist/scripts/test-cloudflare-local.d.ts +0 -1
- package/dist/scripts/test-cloudflare-local.js +0 -212
- package/dist/scripts/test-scaffold.d.ts +0 -2
- package/dist/scripts/test-scaffold.js +0 -297
- package/dist/scripts/treeseed.d.ts +0 -2
- package/dist/scripts/treeseed.js +0 -4
- package/dist/scripts/validate-templates.d.ts +0 -2
- package/dist/scripts/validate-templates.js +0 -4
- package/dist/scripts/watch-dev-lib.d.ts +0 -21
- package/dist/scripts/watch-dev-lib.js +0 -277
- package/dist/scripts/workspace-close.d.ts +0 -2
- package/dist/scripts/workspace-close.js +0 -24
- package/dist/scripts/workspace-command-e2e.d.ts +0 -2
- package/dist/scripts/workspace-command-e2e.js +0 -718
- package/dist/scripts/workspace-lint.d.ts +0 -1
- package/dist/scripts/workspace-lint.js +0 -9
- package/dist/scripts/workspace-preflight-lib.d.ts +0 -36
- package/dist/scripts/workspace-preflight-lib.js +0 -179
- package/dist/scripts/workspace-preflight.d.ts +0 -2
- package/dist/scripts/workspace-preflight.js +0 -22
- package/dist/scripts/workspace-publish-changed-packages.d.ts +0 -1
- package/dist/scripts/workspace-publish-changed-packages.js +0 -16
- package/dist/scripts/workspace-release-verify.d.ts +0 -1
- package/dist/scripts/workspace-release-verify.js +0 -81
- package/dist/scripts/workspace-release.d.ts +0 -2
- package/dist/scripts/workspace-release.js +0 -42
- package/dist/scripts/workspace-save-lib.d.ts +0 -42
- package/dist/scripts/workspace-save-lib.js +0 -220
- package/dist/scripts/workspace-save.d.ts +0 -2
- package/dist/scripts/workspace-save.js +0 -124
- package/dist/scripts/workspace-start-warning.js +0 -3
- package/dist/scripts/workspace-start.d.ts +0 -2
- package/dist/scripts/workspace-start.js +0 -71
- package/dist/scripts/workspace-test-unit.d.ts +0 -1
- package/dist/scripts/workspace-test-unit.js +0 -4
- package/dist/scripts/workspace-test.d.ts +0 -1
- package/dist/scripts/workspace-test.js +0 -11
- package/dist/scripts/workspace-tools.d.ts +0 -13
- package/dist/scripts/workspace-tools.js +0 -226
- package/dist/src/cli/handlers/continue.d.ts +0 -2
- package/dist/src/cli/handlers/prepare.d.ts +0 -2
- package/dist/src/cli/handlers/promote.d.ts +0 -2
- package/dist/src/cli/handlers/publish.d.ts +0 -2
- package/dist/src/cli/handlers/setup.d.ts +0 -2
- package/dist/src/cli/handlers/start.d.ts +0 -3
- package/dist/src/cli/handlers/teardown.d.ts +0 -2
- package/dist/src/cli/handlers/work.d.ts +0 -2
- package/dist/src/cli/main.d.ts +0 -6
- package/dist/src/cli/parser.d.ts +0 -3
- package/dist/src/cli/registry.d.ts +0 -27
- package/dist/src/cli/runtime.d.ts +0 -4
- package/dist/src/cli/types.d.ts +0 -71
- /package/dist/{src/cli → cli}/handlers/close.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/config.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/destroy.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/doctor.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/init.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/release.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/rollback.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/save.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/status.d.ts +0 -0
- /package/dist/{src/cli → cli}/handlers/utils.d.ts +0 -0
- /package/dist/{scripts/workspace-start-warning.d.ts → cli/operations-types.js} +0 -0
- /package/dist/{src/cli → cli}/repair.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
package/dist/cli/help.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { findTreeseedOperation, listTreeseedOperationNames, TRESEED_OPERATION_SPECS } from "./operations-registry.js";
|
|
2
2
|
const GROUP_ORDER = [
|
|
3
3
|
"Workflow",
|
|
4
4
|
"Local Development",
|
|
@@ -14,11 +14,7 @@ function levenshtein(left, right) {
|
|
|
14
14
|
for (let i = 1; i <= left.length; i += 1) {
|
|
15
15
|
for (let j = 1; j <= right.length; j += 1) {
|
|
16
16
|
const cost = left[i - 1] === right[j - 1] ? 0 : 1;
|
|
17
|
-
rows[i][j] = Math.min(
|
|
18
|
-
rows[i - 1][j] + 1,
|
|
19
|
-
rows[i][j - 1] + 1,
|
|
20
|
-
rows[i - 1][j - 1] + cost
|
|
21
|
-
);
|
|
17
|
+
rows[i][j] = Math.min(rows[i - 1][j] + 1, rows[i][j - 1] + 1, rows[i - 1][j - 1] + cost);
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
return rows[left.length][right.length];
|
|
@@ -31,7 +27,7 @@ ${lines.join("\n")}`;
|
|
|
31
27
|
function groupedCommands() {
|
|
32
28
|
const groups = /* @__PURE__ */ new Map();
|
|
33
29
|
for (const group of GROUP_ORDER) groups.set(group, []);
|
|
34
|
-
for (const spec of
|
|
30
|
+
for (const spec of TRESEED_OPERATION_SPECS) {
|
|
35
31
|
const entries = groups.get(spec.group) ?? [];
|
|
36
32
|
entries.push(spec);
|
|
37
33
|
groups.set(spec.group, entries);
|
|
@@ -47,16 +43,16 @@ function renderUsage(spec) {
|
|
|
47
43
|
function suggestTreeseedCommands(input) {
|
|
48
44
|
const normalized = input.trim().toLowerCase();
|
|
49
45
|
if (!normalized) return [];
|
|
50
|
-
return
|
|
46
|
+
return listTreeseedOperationNames().map((name) => ({ name, score: levenshtein(normalized, name) })).sort((left, right) => left.score - right.score || left.name.localeCompare(right.name)).slice(0, 3).map((entry) => entry.name);
|
|
51
47
|
}
|
|
52
48
|
function renderTreeseedHelp(commandName) {
|
|
53
49
|
if (!commandName) {
|
|
54
50
|
const groups = groupedCommands();
|
|
55
|
-
const primaryWorkflow = ["
|
|
56
|
-
const workflowGuidance = ["
|
|
51
|
+
const primaryWorkflow = ["init", "status", "config", "tasks", "switch", "dev", "save", "close", "stage", "release", "destroy"].map((name) => findTreeseedOperation(name)).filter((spec2) => Boolean(spec2));
|
|
52
|
+
const workflowGuidance = ["doctor", "rollback"].map((name) => findTreeseedOperation(name)).filter((spec2) => Boolean(spec2));
|
|
57
53
|
const sections2 = [
|
|
58
54
|
"Treeseed CLI",
|
|
59
|
-
"
|
|
55
|
+
"Thin command wrapper over the Treeseed SDK workflow/operations surface plus the agent runtime namespace.",
|
|
60
56
|
"",
|
|
61
57
|
"Usage",
|
|
62
58
|
" treeseed <command> [args...]",
|
|
@@ -67,7 +63,7 @@ function renderTreeseedHelp(commandName) {
|
|
|
67
63
|
return ` ${command.name}${spacer}${command.summary}`;
|
|
68
64
|
})),
|
|
69
65
|
"",
|
|
70
|
-
formatSection("Workflow
|
|
66
|
+
formatSection("Workflow Support", workflowGuidance.map((command) => {
|
|
71
67
|
const spacer = command.name.length < 18 ? " ".repeat(18 - command.name.length) : " ";
|
|
72
68
|
return ` ${command.name}${spacer}${command.summary}`;
|
|
73
69
|
})),
|
|
@@ -78,29 +74,45 @@ function renderTreeseedHelp(commandName) {
|
|
|
78
74
|
}))).filter(Boolean),
|
|
79
75
|
"",
|
|
80
76
|
formatSection("Common Flows", [
|
|
81
|
-
" treeseed
|
|
82
|
-
" treeseed
|
|
83
|
-
|
|
84
|
-
" treeseed
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
" treeseed status",
|
|
78
|
+
" treeseed config",
|
|
79
|
+
" treeseed switch feature/my-change --preview",
|
|
80
|
+
" treeseed dev",
|
|
81
|
+
' treeseed save "feat: describe your change"',
|
|
82
|
+
' treeseed stage "feat: describe the resolution"',
|
|
83
|
+
" treeseed release --patch"
|
|
87
84
|
]),
|
|
88
85
|
"",
|
|
89
86
|
formatSection("Help", [
|
|
90
87
|
" treeseed --help",
|
|
91
|
-
" treeseed help
|
|
92
|
-
" treeseed
|
|
88
|
+
" treeseed help stage",
|
|
89
|
+
" treeseed stage --help",
|
|
90
|
+
" treeseed agents --help"
|
|
93
91
|
]),
|
|
94
92
|
"",
|
|
95
93
|
"Notes",
|
|
96
|
-
" - Workspace-only commands must be run
|
|
97
|
-
" - Use `treeseed
|
|
98
|
-
|
|
94
|
+
" - Workspace-only commands must be run inside a Treeseed workspace; the CLI will resolve the project root from ancestor directories when possible.",
|
|
95
|
+
" - Use `treeseed status`, `treeseed config`, `treeseed switch`, `treeseed save`, `treeseed stage`, and `treeseed release` for development and release work.",
|
|
96
|
+
' - Use `treeseed close "reason"` to archive a task without merging; it creates a deprecated resurrection tag before deleting the branch.',
|
|
97
|
+
" - Use `treeseed agents <command>` for agent runtime inspection and execution.",
|
|
99
98
|
" - Use `--json` on guidance and main workflow commands when an AI agent or script needs machine-readable output."
|
|
100
99
|
];
|
|
101
100
|
return sections2.filter(Boolean).join("\n");
|
|
102
101
|
}
|
|
103
|
-
|
|
102
|
+
if (commandName === "agents") {
|
|
103
|
+
return [
|
|
104
|
+
"agents Run the Treeseed agent runtime namespace.",
|
|
105
|
+
"",
|
|
106
|
+
"Usage",
|
|
107
|
+
" treeseed agents <command>",
|
|
108
|
+
" treeseed agents --help",
|
|
109
|
+
"",
|
|
110
|
+
"Notes",
|
|
111
|
+
" - Delegates to the `@treeseed/agent` CLI contract.",
|
|
112
|
+
" - Use `treeseed agents --help` to list supported agent subcommands."
|
|
113
|
+
].join("\n");
|
|
114
|
+
}
|
|
115
|
+
const spec = findTreeseedOperation(commandName);
|
|
104
116
|
if (!spec) {
|
|
105
117
|
const suggestions = suggestTreeseedCommands(commandName);
|
|
106
118
|
const lines = [`Unknown treeseed command: ${commandName}`];
|
package/dist/cli/main.js
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
2
3
|
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
5
|
import { runTreeseedCli } from "./runtime.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export * from "./runtime.js";
|
|
7
|
+
export * from "./help.js";
|
|
8
|
+
export * from "./parser.js";
|
|
9
|
+
export * from "./registry.js";
|
|
10
|
+
function resolveExecutablePath(path) {
|
|
11
|
+
try {
|
|
12
|
+
return realpathSync(path);
|
|
13
|
+
} catch {
|
|
14
|
+
return resolve(path);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const currentFile = resolveExecutablePath(fileURLToPath(import.meta.url));
|
|
18
|
+
const entryFile = resolveExecutablePath(process.argv[1] ?? "");
|
|
11
19
|
if (entryFile === currentFile) {
|
|
12
20
|
const exitCode = await runTreeseedCli(process.argv.slice(2));
|
|
13
21
|
process.exit(exitCode);
|
|
14
22
|
}
|
|
15
|
-
export {
|
|
16
|
-
TRESEED_COMMAND_SPECS,
|
|
17
|
-
createTreeseedCommandContext,
|
|
18
|
-
executeTreeseedCommand,
|
|
19
|
-
findCommandSpec,
|
|
20
|
-
listCommandNames,
|
|
21
|
-
parseTreeseedInvocation,
|
|
22
|
-
renderTreeseedHelp,
|
|
23
|
-
renderUsage,
|
|
24
|
-
runTreeseedCli2 as runTreeseedCli,
|
|
25
|
-
suggestTreeseedCommands,
|
|
26
|
-
validateTreeseedInvocation
|
|
27
|
-
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './help.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./help.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './parser.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./parser.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TreeseedOperationSpec } from './operations-types.ts';
|
|
2
|
+
export declare const TRESEED_OPERATION_SPECS: TreeseedOperationSpec[];
|
|
3
|
+
export declare const TRESEED_OPERATION_INDEX: Map<string, TreeseedOperationSpec>;
|
|
4
|
+
export declare function findTreeseedOperation(name: string | null | undefined): TreeseedOperationSpec | null;
|
|
5
|
+
export declare function listTreeseedOperationNames(): string[];
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findTreeseedOperation as findSdkOperation,
|
|
3
|
+
listTreeseedOperationNames as listSdkOperationNames,
|
|
4
|
+
TRESEED_OPERATION_SPECS as SDK_OPERATION_SPECS
|
|
5
|
+
} from "@treeseed/sdk/operations";
|
|
6
|
+
function command(overlay) {
|
|
7
|
+
return overlay;
|
|
8
|
+
}
|
|
9
|
+
const PASS_THROUGH_ARGS = (invocation) => ({ args: invocation.rawArgs });
|
|
10
|
+
const CLI_COMMAND_OVERLAYS = /* @__PURE__ */ new Map([
|
|
11
|
+
["status", command({
|
|
12
|
+
usage: "treeseed status [--json]",
|
|
13
|
+
options: [{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }],
|
|
14
|
+
examples: ["treeseed status", "treeseed status --json"],
|
|
15
|
+
executionMode: "handler",
|
|
16
|
+
handlerName: "status"
|
|
17
|
+
})],
|
|
18
|
+
["tasks", command({
|
|
19
|
+
usage: "treeseed tasks [--json]",
|
|
20
|
+
options: [{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }],
|
|
21
|
+
examples: ["treeseed tasks", "treeseed tasks --json"],
|
|
22
|
+
executionMode: "handler",
|
|
23
|
+
handlerName: "tasks"
|
|
24
|
+
})],
|
|
25
|
+
["switch", command({
|
|
26
|
+
usage: "treeseed switch <branch-name> [--preview] [--json]",
|
|
27
|
+
arguments: [{ name: "branch-name", description: "Task branch to create or resume.", required: true }],
|
|
28
|
+
options: [
|
|
29
|
+
{ name: "preview", flags: "--preview", description: "Provision or refresh a branch-scoped Cloudflare preview environment.", kind: "boolean" },
|
|
30
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
31
|
+
],
|
|
32
|
+
examples: ["treeseed switch feature/search-improvements", "treeseed switch feature/search-improvements --preview"],
|
|
33
|
+
executionMode: "handler",
|
|
34
|
+
handlerName: "switch"
|
|
35
|
+
})],
|
|
36
|
+
["save", command({
|
|
37
|
+
usage: "treeseed save [--hotfix] <message> [--json]",
|
|
38
|
+
arguments: [{ name: "message", description: "Git commit message for the save operation.", required: true, kind: "message_tail" }],
|
|
39
|
+
options: [
|
|
40
|
+
{ name: "hotfix", flags: "--hotfix", description: "Allow save on main for an explicit hotfix.", kind: "boolean" },
|
|
41
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
42
|
+
],
|
|
43
|
+
examples: ['treeseed save "feat: add search filters"', 'treeseed save --hotfix "fix: unblock production form submit"'],
|
|
44
|
+
executionMode: "handler",
|
|
45
|
+
handlerName: "save"
|
|
46
|
+
})],
|
|
47
|
+
["close", command({
|
|
48
|
+
usage: "treeseed close <message> [--json]",
|
|
49
|
+
arguments: [{ name: "message", description: "Reason for closing the task without staging it.", required: true, kind: "message_tail" }],
|
|
50
|
+
options: [{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }],
|
|
51
|
+
examples: ['treeseed close "superseded by feature/search-v2"'],
|
|
52
|
+
executionMode: "handler",
|
|
53
|
+
handlerName: "close"
|
|
54
|
+
})],
|
|
55
|
+
["stage", command({
|
|
56
|
+
usage: "treeseed stage <message> [--json]",
|
|
57
|
+
arguments: [{ name: "message", description: "Resolution message for the staged task.", required: true, kind: "message_tail" }],
|
|
58
|
+
options: [{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }],
|
|
59
|
+
examples: ['treeseed stage "feat: add search filters"'],
|
|
60
|
+
executionMode: "handler",
|
|
61
|
+
handlerName: "stage"
|
|
62
|
+
})],
|
|
63
|
+
["rollback", command({
|
|
64
|
+
usage: "treeseed rollback <staging|prod> [--to <deploy-id|commit>] [--json]",
|
|
65
|
+
arguments: [{ name: "environment", description: "The persistent environment to roll back.", required: true }],
|
|
66
|
+
options: [
|
|
67
|
+
{ name: "to", flags: "--to <deploy-id|commit>", description: "Explicit commit to roll back to. Defaults to the previous recorded deployment when omitted.", kind: "string" },
|
|
68
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
69
|
+
],
|
|
70
|
+
examples: ["treeseed rollback staging", "treeseed rollback prod --to abc1234"],
|
|
71
|
+
executionMode: "handler",
|
|
72
|
+
handlerName: "rollback"
|
|
73
|
+
})],
|
|
74
|
+
["doctor", command({
|
|
75
|
+
usage: "treeseed doctor [--fix] [--json]",
|
|
76
|
+
options: [
|
|
77
|
+
{ name: "fix", flags: "--fix", description: "Apply safe local repairs before rerunning diagnostics.", kind: "boolean" },
|
|
78
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
79
|
+
],
|
|
80
|
+
examples: ["treeseed doctor", "treeseed doctor --fix --json"],
|
|
81
|
+
executionMode: "handler",
|
|
82
|
+
handlerName: "doctor"
|
|
83
|
+
})],
|
|
84
|
+
["auth:login", command({
|
|
85
|
+
usage: "treeseed auth:login [--host <id>] [--json]",
|
|
86
|
+
options: [
|
|
87
|
+
{ name: "host", flags: "--host <id>", description: "Override the configured remote host id for this login.", kind: "string" },
|
|
88
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
89
|
+
],
|
|
90
|
+
examples: ["treeseed auth:login"],
|
|
91
|
+
executionMode: "handler",
|
|
92
|
+
handlerName: "auth:login"
|
|
93
|
+
})],
|
|
94
|
+
["auth:logout", command({
|
|
95
|
+
usage: "treeseed auth:logout [--host <id>] [--json]",
|
|
96
|
+
options: [
|
|
97
|
+
{ name: "host", flags: "--host <id>", description: "Override the configured remote host id to clear.", kind: "string" },
|
|
98
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
99
|
+
],
|
|
100
|
+
examples: ["treeseed auth:logout"],
|
|
101
|
+
executionMode: "handler",
|
|
102
|
+
handlerName: "auth:logout"
|
|
103
|
+
})],
|
|
104
|
+
["auth:whoami", command({
|
|
105
|
+
usage: "treeseed auth:whoami [--json]",
|
|
106
|
+
options: [{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }],
|
|
107
|
+
examples: ["treeseed auth:whoami"],
|
|
108
|
+
executionMode: "handler",
|
|
109
|
+
handlerName: "auth:whoami"
|
|
110
|
+
})],
|
|
111
|
+
["template", command({
|
|
112
|
+
usage: "treeseed template [list|show|validate] [id]",
|
|
113
|
+
arguments: [
|
|
114
|
+
{ name: "action", description: "Template action: list, show, or validate.", required: false },
|
|
115
|
+
{ name: "id", description: "Template id for show or validate.", required: false }
|
|
116
|
+
],
|
|
117
|
+
examples: ["treeseed template", "treeseed template list", "treeseed template show starter-basic", "treeseed template validate"],
|
|
118
|
+
executionMode: "handler",
|
|
119
|
+
handlerName: "template"
|
|
120
|
+
})],
|
|
121
|
+
["sync", command({
|
|
122
|
+
usage: "treeseed sync [--check]",
|
|
123
|
+
options: [{ name: "check", flags: "--check", description: "Report managed-surface drift without changing files.", kind: "boolean" }],
|
|
124
|
+
examples: ["treeseed sync --check", "treeseed sync"],
|
|
125
|
+
executionMode: "handler",
|
|
126
|
+
handlerName: "sync"
|
|
127
|
+
})],
|
|
128
|
+
["init", command({
|
|
129
|
+
usage: "treeseed init <directory> [--template <starter-id>] [--name <site-name>] [--slug <slug>] [--site-url <url>] [--contact-email <email>] [--repo <url>] [--discord <url>]",
|
|
130
|
+
arguments: [{ name: "directory", description: "Target directory for the new tenant.", required: true }],
|
|
131
|
+
options: [
|
|
132
|
+
{ name: "template", flags: "--template <starter-id>", description: "Select the starter template id to generate. Defaults to starter-basic.", kind: "string" },
|
|
133
|
+
{ name: "name", flags: "--name <site-name>", description: "Override the generated site name.", kind: "string" },
|
|
134
|
+
{ name: "slug", flags: "--slug <slug>", description: "Override the generated package and tenant slug.", kind: "string" },
|
|
135
|
+
{ name: "siteUrl", flags: "--site-url <url>", description: "Set the initial public site URL.", kind: "string" },
|
|
136
|
+
{ name: "contactEmail", flags: "--contact-email <email>", description: "Set the site contact address.", kind: "string" },
|
|
137
|
+
{ name: "repo", flags: "--repo <url>", description: "Set the repository URL.", kind: "string" },
|
|
138
|
+
{ name: "discord", flags: "--discord <url>", description: "Set the Discord/community URL.", kind: "string" }
|
|
139
|
+
],
|
|
140
|
+
examples: ['treeseed init docs-site --template starter-basic --name "Docs Site" --site-url https://docs.example.com'],
|
|
141
|
+
notes: ["Runs outside an existing repo or from any branch."],
|
|
142
|
+
executionMode: "handler",
|
|
143
|
+
handlerName: "init"
|
|
144
|
+
})],
|
|
145
|
+
["config", command({
|
|
146
|
+
usage: "treeseed config [--environment <all|local|staging|prod>]... [--sync <none|github|cloudflare|railway|all>] [--print-env] [--print-env-only] [--show-secrets] [--rotate-machine-key]",
|
|
147
|
+
options: [
|
|
148
|
+
{ name: "environment", flags: "--environment <scope>", description: "Select all environments or limit configuration to local, staging, or prod. Defaults to all.", kind: "enum", repeatable: true, values: ["all", "local", "staging", "prod"] },
|
|
149
|
+
{ name: "sync", flags: "--sync <mode>", description: "Sync hosted secrets/variables to GitHub, Cloudflare, Railway, or all providers. Defaults to all.", kind: "enum", values: ["none", "github", "cloudflare", "railway", "all"] },
|
|
150
|
+
{ name: "printEnv", flags: "--print-env", description: "Print resolved environment values before remote initialization.", kind: "boolean" },
|
|
151
|
+
{ name: "printEnvOnly", flags: "--print-env-only", description: "Print resolved environment values, check provider connections, and exit without prompting or initializing remote resources.", kind: "boolean" },
|
|
152
|
+
{ name: "showSecrets", flags: "--show-secrets", description: "Print full secret values in environment reports instead of masking them.", kind: "boolean" },
|
|
153
|
+
{ name: "rotateMachineKey", flags: "--rotate-machine-key", description: "Regenerate the local home machine key and re-encrypt stored Treeseed secrets and remote auth sessions.", kind: "boolean" },
|
|
154
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
155
|
+
],
|
|
156
|
+
examples: ["treeseed config", "treeseed config --environment all", "treeseed config --environment local --sync none", "treeseed config --environment staging --print-env-only --show-secrets", "treeseed config --rotate-machine-key"],
|
|
157
|
+
notes: ["Does not create branch preview deployments. Use `treeseed switch <branch> --preview` for that."],
|
|
158
|
+
executionMode: "handler",
|
|
159
|
+
handlerName: "config"
|
|
160
|
+
})],
|
|
161
|
+
["release", command({
|
|
162
|
+
usage: "treeseed release --major|--minor|--patch",
|
|
163
|
+
options: [
|
|
164
|
+
{ name: "major", flags: "--major", description: "Bump to the next major version.", kind: "boolean" },
|
|
165
|
+
{ name: "minor", flags: "--minor", description: "Bump to the next minor version.", kind: "boolean" },
|
|
166
|
+
{ name: "patch", flags: "--patch", description: "Bump to the next patch version.", kind: "boolean" },
|
|
167
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
168
|
+
],
|
|
169
|
+
examples: ["treeseed release --patch", "treeseed release --minor"],
|
|
170
|
+
notes: ["Requires exactly one bump flag."],
|
|
171
|
+
executionMode: "handler",
|
|
172
|
+
handlerName: "release"
|
|
173
|
+
})],
|
|
174
|
+
["destroy", command({
|
|
175
|
+
usage: "treeseed destroy --environment <local|staging|prod> [--dry-run] [--force] [--skip-confirmation] [--confirm <slug>] [--remove-build-artifacts]",
|
|
176
|
+
options: [
|
|
177
|
+
{ name: "environment", flags: "--environment <scope>", description: "Select the persistent environment to destroy.", kind: "enum", values: ["local", "staging", "prod"] },
|
|
178
|
+
{ name: "dryRun", flags: "--dry-run", description: "Preview the destroy operation.", kind: "boolean" },
|
|
179
|
+
{ name: "force", flags: "--force", description: "Force worker deletion when supported.", kind: "boolean" },
|
|
180
|
+
{ name: "skipConfirmation", flags: "--skip-confirmation", description: "Skip the interactive confirmation prompt.", kind: "boolean" },
|
|
181
|
+
{ name: "confirm", flags: "--confirm <slug>", description: "Provide the expected slug confirmation non-interactively.", kind: "string" },
|
|
182
|
+
{ name: "removeBuildArtifacts", flags: "--remove-build-artifacts", description: "Also remove local build artifacts after destroy.", kind: "boolean" },
|
|
183
|
+
{ name: "json", flags: "--json", description: "Emit machine-readable JSON instead of human-readable text.", kind: "boolean" }
|
|
184
|
+
],
|
|
185
|
+
examples: ["treeseed destroy --environment staging --dry-run", "treeseed destroy --environment prod --confirm example --skip-confirmation"],
|
|
186
|
+
notes: ["Only for persistent environments. Task cleanup belongs to treeseed close.", "This command is destructive and requires explicit confirmation."],
|
|
187
|
+
executionMode: "handler",
|
|
188
|
+
handlerName: "destroy"
|
|
189
|
+
})],
|
|
190
|
+
["dev", command({ examples: ["treeseed dev"], executionMode: "handler", handlerName: "dev" })],
|
|
191
|
+
["dev:watch", command({ examples: ["treeseed dev:watch"], executionMode: "handler", handlerName: "dev" })],
|
|
192
|
+
["build", command({ examples: ["treeseed build"], executionMode: "adapter" })],
|
|
193
|
+
["check", command({ examples: ["treeseed check"], executionMode: "adapter" })],
|
|
194
|
+
["preview", command({ examples: ["treeseed preview"], executionMode: "adapter", buildAdapterInput: PASS_THROUGH_ARGS })],
|
|
195
|
+
["lint", command({ examples: ["treeseed lint"], executionMode: "adapter" })],
|
|
196
|
+
["test", command({ examples: ["treeseed test"], executionMode: "adapter" })],
|
|
197
|
+
["test:unit", command({ examples: ["treeseed test:unit"], executionMode: "adapter" })],
|
|
198
|
+
["preflight", command({ examples: ["treeseed preflight"], executionMode: "adapter" })],
|
|
199
|
+
["auth:check", command({ examples: ["treeseed auth:check"], executionMode: "adapter", buildAdapterInput: () => ({ requireAuth: true }) })],
|
|
200
|
+
["test:e2e", command({ examples: ["treeseed test:e2e"], executionMode: "adapter" })],
|
|
201
|
+
["test:e2e:local", command({ examples: ["treeseed test:e2e:local"], executionMode: "adapter" })],
|
|
202
|
+
["test:e2e:staging", command({ examples: ["treeseed test:e2e:staging"], executionMode: "adapter" })],
|
|
203
|
+
["test:e2e:full", command({ examples: ["treeseed test:e2e:full"], executionMode: "adapter" })],
|
|
204
|
+
["test:release", command({ examples: ["treeseed test:release"], executionMode: "adapter" })],
|
|
205
|
+
["test:release:full", command({ examples: ["treeseed test:release:full", "treeseed release:verify"], executionMode: "adapter" })],
|
|
206
|
+
["release:publish:changed", command({ examples: ["treeseed release:publish:changed"], executionMode: "adapter" })],
|
|
207
|
+
["astro", command({ examples: ["treeseed astro -- --help"], executionMode: "adapter", buildAdapterInput: PASS_THROUGH_ARGS })],
|
|
208
|
+
["sync:devvars", command({ examples: ["treeseed sync:devvars"], executionMode: "adapter" })],
|
|
209
|
+
["mailpit:up", command({ examples: ["treeseed mailpit:up"], executionMode: "adapter" })],
|
|
210
|
+
["mailpit:down", command({ examples: ["treeseed mailpit:down"], executionMode: "adapter" })],
|
|
211
|
+
["mailpit:logs", command({ examples: ["treeseed mailpit:logs"], executionMode: "adapter" })],
|
|
212
|
+
["d1:migrate:local", command({ examples: ["treeseed d1:migrate:local"], executionMode: "adapter" })],
|
|
213
|
+
["cleanup:markdown", command({
|
|
214
|
+
examples: ["treeseed cleanup:markdown docs/README.md"],
|
|
215
|
+
executionMode: "adapter",
|
|
216
|
+
buildAdapterInput: (invocation) => ({ targets: invocation.positionals, check: false })
|
|
217
|
+
})],
|
|
218
|
+
["cleanup:markdown:check", command({
|
|
219
|
+
examples: ["treeseed cleanup:markdown:check docs/README.md"],
|
|
220
|
+
executionMode: "adapter",
|
|
221
|
+
buildAdapterInput: (invocation) => ({ targets: invocation.positionals, check: true })
|
|
222
|
+
})],
|
|
223
|
+
["starlight:patch", command({ examples: ["treeseed starlight:patch"], executionMode: "adapter" })]
|
|
224
|
+
]);
|
|
225
|
+
function mergeOperationSpec(metadata) {
|
|
226
|
+
const overlay = CLI_COMMAND_OVERLAYS.get(metadata.name) ?? {};
|
|
227
|
+
return {
|
|
228
|
+
...metadata,
|
|
229
|
+
usage: overlay.usage,
|
|
230
|
+
arguments: overlay.arguments,
|
|
231
|
+
options: overlay.options,
|
|
232
|
+
examples: overlay.examples,
|
|
233
|
+
notes: overlay.notes,
|
|
234
|
+
executionMode: overlay.executionMode ?? "adapter",
|
|
235
|
+
handlerName: overlay.handlerName,
|
|
236
|
+
buildAdapterInput: overlay.buildAdapterInput
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
const TRESEED_OPERATION_SPECS = SDK_OPERATION_SPECS.map(mergeOperationSpec);
|
|
240
|
+
const TRESEED_OPERATION_INDEX = /* @__PURE__ */ new Map();
|
|
241
|
+
for (const spec of TRESEED_OPERATION_SPECS) {
|
|
242
|
+
TRESEED_OPERATION_INDEX.set(spec.name, spec);
|
|
243
|
+
for (const alias of spec.aliases) {
|
|
244
|
+
TRESEED_OPERATION_INDEX.set(alias, spec);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function findTreeseedOperation(name) {
|
|
248
|
+
if (!name) return null;
|
|
249
|
+
const metadata = findSdkOperation(name);
|
|
250
|
+
return metadata ? TRESEED_OPERATION_INDEX.get(metadata.name) ?? mergeOperationSpec(metadata) : null;
|
|
251
|
+
}
|
|
252
|
+
function listTreeseedOperationNames() {
|
|
253
|
+
return listSdkOperationNames();
|
|
254
|
+
}
|
|
255
|
+
export {
|
|
256
|
+
TRESEED_OPERATION_INDEX,
|
|
257
|
+
TRESEED_OPERATION_SPECS,
|
|
258
|
+
findTreeseedOperation,
|
|
259
|
+
listTreeseedOperationNames
|
|
260
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { TreeseedOperationContext as SdkOperationContext, TreeseedOperationGroup, TreeseedOperationId, TreeseedOperationMetadata, TreeseedOperationResult as SdkOperationResult } from '@treeseed/sdk/operations';
|
|
2
|
+
export type TreeseedCommandGroup = TreeseedOperationGroup;
|
|
3
|
+
export type TreeseedExecutionMode = 'handler' | 'adapter';
|
|
4
|
+
export type TreeseedArgumentKind = 'positional' | 'message_tail';
|
|
5
|
+
export type TreeseedOptionKind = 'boolean' | 'string' | 'enum';
|
|
6
|
+
export type TreeseedCommandArgumentSpec = {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
kind?: TreeseedArgumentKind;
|
|
11
|
+
};
|
|
12
|
+
export type TreeseedCommandOptionSpec = {
|
|
13
|
+
name: string;
|
|
14
|
+
flags: string;
|
|
15
|
+
description: string;
|
|
16
|
+
kind: TreeseedOptionKind;
|
|
17
|
+
repeatable?: boolean;
|
|
18
|
+
values?: string[];
|
|
19
|
+
};
|
|
20
|
+
export type TreeseedCommandExample = string;
|
|
21
|
+
export type TreeseedParsedInvocation = {
|
|
22
|
+
commandName: string;
|
|
23
|
+
args: Record<string, string | string[] | boolean | undefined>;
|
|
24
|
+
positionals: string[];
|
|
25
|
+
rawArgs: string[];
|
|
26
|
+
};
|
|
27
|
+
export type TreeseedCommandResult = {
|
|
28
|
+
exitCode?: number;
|
|
29
|
+
stdout?: string[];
|
|
30
|
+
stderr?: string[];
|
|
31
|
+
report?: Record<string, unknown> | null;
|
|
32
|
+
};
|
|
33
|
+
export type TreeseedWriter = NonNullable<SdkOperationContext['write']>;
|
|
34
|
+
export type TreeseedSpawner = NonNullable<SdkOperationContext['spawn']>;
|
|
35
|
+
export type TreeseedPromptHandler = NonNullable<SdkOperationContext['prompt']>;
|
|
36
|
+
export type TreeseedConfirmHandler = NonNullable<SdkOperationContext['confirm']>;
|
|
37
|
+
export type TreeseedCommandContext = {
|
|
38
|
+
cwd: string;
|
|
39
|
+
env: NodeJS.ProcessEnv;
|
|
40
|
+
write: TreeseedWriter;
|
|
41
|
+
spawn: TreeseedSpawner;
|
|
42
|
+
outputFormat?: 'human' | 'json';
|
|
43
|
+
prompt?: TreeseedPromptHandler;
|
|
44
|
+
confirm?: TreeseedConfirmHandler;
|
|
45
|
+
};
|
|
46
|
+
export type TreeseedCommandHandler = (invocation: TreeseedParsedInvocation, context: TreeseedCommandContext) => Promise<TreeseedCommandResult> | TreeseedCommandResult;
|
|
47
|
+
export type TreeseedAdapterInputBuilder = (invocation: TreeseedParsedInvocation, context: TreeseedCommandContext) => Record<string, unknown>;
|
|
48
|
+
export type TreeseedOperationSpec = TreeseedOperationMetadata & {
|
|
49
|
+
usage?: string;
|
|
50
|
+
arguments?: TreeseedCommandArgumentSpec[];
|
|
51
|
+
options?: TreeseedCommandOptionSpec[];
|
|
52
|
+
examples?: TreeseedCommandExample[];
|
|
53
|
+
notes?: string[];
|
|
54
|
+
executionMode: TreeseedExecutionMode;
|
|
55
|
+
handlerName?: string;
|
|
56
|
+
buildAdapterInput?: TreeseedAdapterInputBuilder;
|
|
57
|
+
};
|
|
58
|
+
export type TreeseedCommandSpec = TreeseedOperationSpec;
|
|
59
|
+
export type TreeseedOperationRequest = {
|
|
60
|
+
commandName: string;
|
|
61
|
+
argv?: string[];
|
|
62
|
+
};
|
|
63
|
+
export type TreeseedOperationResult = TreeseedCommandResult & {
|
|
64
|
+
operation?: TreeseedOperationId;
|
|
65
|
+
ok?: boolean;
|
|
66
|
+
payload?: Record<string, unknown> | null;
|
|
67
|
+
meta?: Record<string, unknown>;
|
|
68
|
+
nextSteps?: string[];
|
|
69
|
+
};
|
|
70
|
+
export type TreeseedOperationExecutor = (spec: TreeseedOperationSpec, argv: string[], context: TreeseedCommandContext) => Promise<number> | number;
|
|
71
|
+
export type TreeseedHandlerResolver = (handlerName: string) => TreeseedCommandHandler | null;
|
|
72
|
+
export type TreeseedSdkOperationResult = SdkOperationResult;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TreeseedOperationSpec, TreeseedParsedInvocation } from './operations-types.ts';
|
|
2
|
+
export declare function parseTreeseedInvocation(command: TreeseedOperationSpec, argv: string[]): TreeseedParsedInvocation;
|
|
3
|
+
export declare function validateTreeseedInvocation(command: TreeseedOperationSpec, invocation: TreeseedParsedInvocation): string[];
|
package/dist/cli/parser.js
CHANGED
|
@@ -77,17 +77,12 @@ function validateTreeseedInvocation(command, invocation) {
|
|
|
77
77
|
errors.push(`Missing required argument: ${arg.name}`);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
if (command.name === "release"
|
|
80
|
+
if (command.name === "release") {
|
|
81
81
|
const selected = ["major", "minor", "patch"].filter((name) => invocation.args[name] === true);
|
|
82
82
|
if (selected.length !== 1) {
|
|
83
83
|
errors.push(`Treeseed ${command.name} requires exactly one version bump flag: --major, --minor, or --patch.`);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
if (command.name === "deploy" || command.name === "publish") {
|
|
87
|
-
if (!invocation.args.environment && !invocation.args.targetBranch && !process.env.CI) {
|
|
88
|
-
errors.push(`Treeseed ${command.name} requires \`--environment local|staging|prod\` or \`--target-branch <branch>\` outside CI.`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
86
|
return errors;
|
|
92
87
|
}
|
|
93
88
|
export {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TreeseedCommandSpec } from './operations-types.js';
|
|
2
|
+
export declare const COMMAND_HANDLERS: {
|
|
3
|
+
readonly init: import("./operations-types.js").TreeseedCommandHandler;
|
|
4
|
+
readonly config: import("./operations-types.js").TreeseedCommandHandler;
|
|
5
|
+
readonly close: import("./operations-types.js").TreeseedCommandHandler;
|
|
6
|
+
readonly save: import("./operations-types.js").TreeseedCommandHandler;
|
|
7
|
+
readonly release: import("./operations-types.js").TreeseedCommandHandler;
|
|
8
|
+
readonly destroy: import("./operations-types.js").TreeseedCommandHandler;
|
|
9
|
+
readonly status: import("./operations-types.js").TreeseedCommandHandler;
|
|
10
|
+
readonly dev: import("./operations-types.js").TreeseedCommandHandler;
|
|
11
|
+
readonly 'dev:watch': import("./operations-types.js").TreeseedCommandHandler;
|
|
12
|
+
readonly doctor: import("./operations-types.js").TreeseedCommandHandler;
|
|
13
|
+
readonly rollback: import("./operations-types.js").TreeseedCommandHandler;
|
|
14
|
+
readonly template: import("./operations-types.js").TreeseedCommandHandler;
|
|
15
|
+
readonly sync: import("./operations-types.js").TreeseedCommandHandler;
|
|
16
|
+
readonly tasks: import("./operations-types.js").TreeseedCommandHandler;
|
|
17
|
+
readonly switch: import("./operations-types.js").TreeseedCommandHandler;
|
|
18
|
+
readonly stage: import("./operations-types.js").TreeseedCommandHandler;
|
|
19
|
+
readonly 'auth:login': import("./operations-types.js").TreeseedCommandHandler;
|
|
20
|
+
readonly 'auth:logout': import("./operations-types.js").TreeseedCommandHandler;
|
|
21
|
+
readonly 'auth:whoami': import("./operations-types.js").TreeseedCommandHandler;
|
|
22
|
+
};
|
|
23
|
+
export declare const TRESEED_COMMAND_SPECS: TreeseedCommandSpec[];
|
|
24
|
+
export declare function findCommandSpec(name: string | null | undefined): import("./operations-types.js").TreeseedOperationSpec | null;
|
|
25
|
+
export declare function listCommandNames(): string[];
|