@pmelab/gtd 6.0.0 → 6.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 +4 -0
- package/dist/gtd.bundle.mjs +10 -6
- package/docs/cli.md +11 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,6 +76,10 @@ Four commands drive it:
|
|
|
76
76
|
`<commitish>..HEAD` (e.g. a colleague's PR branch), reusing the workflow's
|
|
77
77
|
existing review/feedback machinery over that diff.
|
|
78
78
|
|
|
79
|
+
`gtd version` (or `gtd --version`/`-v`) prints the installed version and exits;
|
|
80
|
+
`gtd help` (or `gtd --help`/`-h`) prints the command list. Both short-circuit
|
|
81
|
+
before any repo work, so they run anywhere.
|
|
82
|
+
|
|
79
83
|
The loop is one beat, repeated: run `gtd next --json` and dispatch on `kind` —
|
|
80
84
|
`"message"` means it's a human's move (stop and hand off); `"script"` means the
|
|
81
85
|
driver runs `content` itself, then steps its actor; `"prompt"` means feed
|
package/dist/gtd.bundle.mjs
CHANGED
|
@@ -204198,6 +204198,8 @@ Commands:
|
|
|
204198
204198
|
mermaid Print the active workflow's shape as Mermaid
|
|
204199
204199
|
stateDiagram-v2 source (no mutation)
|
|
204200
204200
|
lsp Start the LSP server for .gtd/ steering files (stdio)
|
|
204201
|
+
version Print version and exit
|
|
204202
|
+
help Print this help and exit
|
|
204201
204203
|
|
|
204202
204204
|
Options:
|
|
204203
204205
|
--json Output structured JSON instead of plain text
|
|
@@ -204664,17 +204666,19 @@ const KNOWN_SUBCOMMANDS = [
|
|
|
204664
204666
|
"mermaid"
|
|
204665
204667
|
];
|
|
204666
204668
|
/**
|
|
204667
|
-
* `--version`/`-v` or `--help`/`-h`: short-circuits before any
|
|
204668
|
-
* work, so it works outside a repo too.
|
|
204669
|
-
*
|
|
204670
|
-
*
|
|
204669
|
+
* `--version`/`-v`/`version` or `--help`/`-h`/`help`: short-circuits before any
|
|
204670
|
+
* git or state work, so it works outside a repo too. The bare `version`/`help`
|
|
204671
|
+
* subcommands are equivalent to their flag forms. Exported so main.ts can run
|
|
204672
|
+
* the same check synchronously BEFORE the Effect runtime builds any layer —
|
|
204673
|
+
* layer construction must never observe a version/help invocation.
|
|
204671
204674
|
*/
|
|
204672
204675
|
const runVersionOrHelp = (argv, write) => {
|
|
204673
|
-
|
|
204676
|
+
const positional = argv.slice(2).find((a) => !a.startsWith("--"));
|
|
204677
|
+
if (argv.includes("--version") || argv.includes("-v") || positional === "version") {
|
|
204674
204678
|
write(GTD_VERSION + "\n");
|
|
204675
204679
|
return true;
|
|
204676
204680
|
}
|
|
204677
|
-
if (argv.includes("--help") || argv.includes("-h")) {
|
|
204681
|
+
if (argv.includes("--help") || argv.includes("-h") || positional === "help") {
|
|
204678
204682
|
write(HELP_TEXT);
|
|
204679
204683
|
return true;
|
|
204680
204684
|
}
|
package/docs/cli.md
CHANGED
|
@@ -29,6 +29,8 @@ Commands:
|
|
|
29
29
|
mermaid Print the active workflow's shape as Mermaid
|
|
30
30
|
stateDiagram-v2 source (no mutation)
|
|
31
31
|
lsp Start the LSP server for .gtd/ steering files (stdio)
|
|
32
|
+
version Print version and exit
|
|
33
|
+
help Print this help and exit
|
|
32
34
|
|
|
33
35
|
Options:
|
|
34
36
|
--json Output structured JSON instead of plain text
|
|
@@ -38,11 +40,12 @@ Options:
|
|
|
38
40
|
--help, -h Print this help and exit
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
`--version` (`-v`) and `--help` (`-h`)
|
|
42
|
-
repository-state work — they run outside a repo
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
`--version` (`-v`) / `gtd version` and `--help` (`-h`) / `gtd help`
|
|
44
|
+
short-circuit before any git or repository-state work — they run outside a repo
|
|
45
|
+
and in any repo state (the bare subcommands are exact equivalents of their flag
|
|
46
|
+
forms). Bare `gtd` (no subcommand) is a usage error: it prints the help text and
|
|
47
|
+
exits 1 without touching the repository. Every other command must be run from
|
|
48
|
+
the **repository root** — gtd derives the workflow, pending changes, and process
|
|
46
49
|
history relative to cwd, so it refuses with a clear error if invoked from a
|
|
47
50
|
subdirectory.
|
|
48
51
|
|
|
@@ -438,5 +441,6 @@ the plain-text one.
|
|
|
438
441
|
- **Repository root invocation.** Every state subcommand (`step`/`review`/
|
|
439
442
|
`next`/`status`/`mermaid`) must run from the git repository root — the
|
|
440
443
|
workflow, pending changes, and process history are resolved against the
|
|
441
|
-
process cwd. `--help`/`--version
|
|
442
|
-
entirely (and any git/`.gtdrc` dependency
|
|
444
|
+
process cwd. `--help`/`--version` (and the `help`/`version` subcommands),
|
|
445
|
+
`format`, and `lsp` skip this guard entirely (and any git/`.gtdrc` dependency
|
|
446
|
+
along with it).
|