@guiho/runx 0.2.3 → 0.2.5
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/CHANGELOG.md +23 -0
- package/DOCS.md +16 -2
- package/README.md +6 -0
- package/docs/architecture/architecture.xdocs.md +3 -2
- package/docs/architecture/cli-architecture.md +15 -7
- package/docs/decisions/citty-cli-migration.md +139 -0
- package/docs/decisions/decisions.xdocs.md +5 -0
- package/docs/decisions/mirror-automatic-push.md +84 -0
- package/docs/plans/citty-cli-migration.md +169 -0
- package/docs/plans/mirror-automatic-push.md +77 -0
- package/docs/plans/plans.xdocs.md +6 -0
- package/docs/reviews/implementation/citty-cli-migration-review.md +85 -0
- package/docs/reviews/implementation/implementation.xdocs.md +22 -0
- package/docs/reviews/plans/citty-cli-migration-review.md +80 -0
- package/docs/reviews/plans/mirror-automatic-push-review.md +57 -0
- package/docs/reviews/plans/plans.xdocs.md +6 -0
- package/docs/reviews/reviews.xdocs.md +1 -0
- package/docs/validation/citty-cli-migration.md +95 -0
- package/docs/validation/validation.xdocs.md +3 -0
- package/library/cli.d.ts +8 -2
- package/library/cli.d.ts.map +1 -1
- package/library/cli.js +357 -103
- package/library/help.d.ts +0 -1
- package/library/help.d.ts.map +1 -1
- package/library/help.js +0 -4
- package/library/self-management.d.ts +2 -5
- package/library/self-management.d.ts.map +1 -1
- package/library/self-management.js +6 -5
- package/library/types.d.ts +5 -5
- package/library/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/skills/guiho-s-runx/SKILL.md +16 -0
- package/skills/guiho-s-runx/guiho-s-runx.xdocs.md +4 -3
- package/library/flags.d.ts +0 -5
- package/library/flags.d.ts.map +0 -1
- package/library/flags.js +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,29 @@ owner: runx
|
|
|
15
15
|
|
|
16
16
|
# Changelog
|
|
17
17
|
|
|
18
|
+
## 0.2.4 - 2026-07-14
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Added Citty as the runtime CLI builder for typed commands, nested routing,
|
|
23
|
+
aliases, and generated usage.
|
|
24
|
+
- Added end-to-end command-contract coverage for help, version, catalog,
|
|
25
|
+
agents, self-management, selector shorthand, and native/package behavior.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Replaced RunX's handwritten argument parser and top-level router with the
|
|
30
|
+
complete Citty command tree while preserving `runx r` and `runx <selector>`.
|
|
31
|
+
- Updated public documentation, architecture, AGENTS instructions, and the
|
|
32
|
+
bundled RunX skill for the Citty-owned interface.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Fixed `runx -v` and `runx -h` so they work outside configured projects
|
|
37
|
+
without attempting to discover `runx.yaml`.
|
|
38
|
+
- Unknown options and missing required selectors now report relevant command
|
|
39
|
+
usage instead of unrelated manifest errors.
|
|
40
|
+
|
|
18
41
|
## 0.2.2 - 2026-07-14
|
|
19
42
|
|
|
20
43
|
### Changed
|
package/DOCS.md
CHANGED
|
@@ -26,6 +26,8 @@ lists its commands, and runs exactly one selected command.
|
|
|
26
26
|
| Command | Purpose |
|
|
27
27
|
| --- | --- |
|
|
28
28
|
| `runx` | Show the home page and usage without loading a manifest. |
|
|
29
|
+
| `runx -h`, `runx --help` | Show Citty-generated usage without loading a manifest. Append help to a command for command-specific usage. |
|
|
30
|
+
| `runx -v`, `runx --version` | Show the installed version without loading a manifest. |
|
|
29
31
|
| `runx list` | List all manifest commands. Add `--format json` for structured output. |
|
|
30
32
|
| `runx describe <selector>` | Show one command's description and operational metadata. |
|
|
31
33
|
| `runx check` | Validate discovery and the manifest without execution. |
|
|
@@ -34,11 +36,21 @@ lists its commands, and runs exactly one selected command.
|
|
|
34
36
|
| `runx <selector>` | Human shorthand for `runx run <selector>` when no built-in name conflicts. |
|
|
35
37
|
| `runx agents install <local|global>` | Install `guiho-s-runx`; add `--tool agents|claude|all` when needed. |
|
|
36
38
|
| `runx agents instructions` | Add or refresh the managed RunX section in `AGENTS.md`. |
|
|
37
|
-
| `runx upgrade
|
|
39
|
+
| `runx upgrade` | Replace a native installed executable when a newer release is available. |
|
|
40
|
+
| `runx upgrade check` | Check whether a newer release is available. |
|
|
41
|
+
| `runx upgrade list` | List recent release versions. |
|
|
38
42
|
| `runx uninstall [--dry-run]` | Remove a native installed executable. |
|
|
39
43
|
|
|
40
44
|
Global flags: `--cwd <path>`, `--file <path>`, `--format <text|json>`,
|
|
41
|
-
`--verbose`,
|
|
45
|
+
`--verbose`, `-v`/`--version`, `-h`/`--help`, `--help-tree`, and
|
|
46
|
+
`--help-docs`. Applicable command flags include `--dry-run`, `--yes`, and
|
|
47
|
+
`--tool <agents|claude|all>`. Options may appear before or after their command.
|
|
48
|
+
Unknown options and missing required arguments produce command usage instead
|
|
49
|
+
of falling through to manifest discovery.
|
|
50
|
+
|
|
51
|
+
Citty is the CLI parser, command router, alias registry, and ordinary usage
|
|
52
|
+
renderer. RunX keeps its home page, extended command tree, and manifest guide
|
|
53
|
+
as the explicit `runx`, `--help-tree`, and `--help-docs` surfaces.
|
|
42
54
|
|
|
43
55
|
## Manifest
|
|
44
56
|
|
|
@@ -114,6 +126,8 @@ macOS/Linux assets from GitHub Releases into the user's local bin directory.
|
|
|
114
126
|
on Windows replacement is scheduled after RunX exits. `runx uninstall` removes
|
|
115
127
|
the same native executable and supports `--dry-run`.
|
|
116
128
|
|
|
129
|
+
When the latest GitHub Release matches the installed version, `runx upgrade` prints `Already up to date.` and exits successfully without downloading or scheduling executable replacement. JSON output reports `upToDate: true`.
|
|
130
|
+
|
|
117
131
|
CI validates code and compiles the local executable plus the native release
|
|
118
132
|
matrix. Protected `@guiho/runx@*` tags run the `production` publish workflow,
|
|
119
133
|
which uploads twelve native assets to GitHub Releases and publishes the public
|
package/README.md
CHANGED
|
@@ -61,15 +61,21 @@ Then use RunX:
|
|
|
61
61
|
|
|
62
62
|
```text
|
|
63
63
|
runx Show the home page and usage.
|
|
64
|
+
runx -h Show Citty-generated command help.
|
|
65
|
+
runx -v Show the installed version without loading a manifest.
|
|
64
66
|
runx list List commands in the nearest manifest.
|
|
65
67
|
runx describe app-dev Explain one command without execution.
|
|
66
68
|
runx run app-dev --dry-run Inspect the execution plan.
|
|
67
69
|
runx run app-dev Execute the command.
|
|
68
70
|
runx r app-dev Use the short run alias.
|
|
71
|
+
runx app-dev Use the human selector shorthand.
|
|
69
72
|
```
|
|
70
73
|
|
|
71
74
|
Use `confirm: always` for commands that should require an explicit `--yes`.
|
|
72
75
|
Use `runx list --format json` and stable UIDs for agent automation.
|
|
76
|
+
RunX uses Citty for argument parsing, aliases, command routing, and ordinary
|
|
77
|
+
usage text, so conventional `-h`/`--help` and `-v`/`--version` work outside a
|
|
78
|
+
configured project.
|
|
73
79
|
|
|
74
80
|
## Documentation
|
|
75
81
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
subject: runx-architecture
|
|
3
|
-
description: Technical architecture for the RunX manifest,
|
|
3
|
+
description: Technical architecture for the RunX manifest, Citty command tree, agent skill, and native distribution.
|
|
4
4
|
parent: runx-docs
|
|
5
5
|
children: []
|
|
6
6
|
files:
|
|
7
|
-
cli-architecture.md: Documents RunX
|
|
7
|
+
cli-architecture.md: Documents Citty routing, RunX domain boundaries, safety invariants, and native distribution.
|
|
8
8
|
documents:
|
|
9
9
|
cli-architecture.md: Technical architecture for the first RunX CLI release.
|
|
10
10
|
tags:
|
|
@@ -13,6 +13,7 @@ keywords:
|
|
|
13
13
|
- runx
|
|
14
14
|
- bun
|
|
15
15
|
- cli
|
|
16
|
+
- citty
|
|
16
17
|
flags: []
|
|
17
18
|
status: stable
|
|
18
19
|
---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: RunX CLI Architecture
|
|
3
3
|
purpose: Describe the component boundaries and data flow of the RunX alpha CLI.
|
|
4
|
-
description: Explains manifest discovery, TypeBox validation, selector resolution, execution, agent installation, and native distribution.
|
|
4
|
+
description: Explains Citty routing, manifest discovery, TypeBox validation, selector resolution, execution, agent installation, and native distribution.
|
|
5
5
|
created: 2026-07-12
|
|
6
6
|
flags:
|
|
7
7
|
- approved
|
|
@@ -10,6 +10,7 @@ tags:
|
|
|
10
10
|
- cli
|
|
11
11
|
keywords:
|
|
12
12
|
- runx
|
|
13
|
+
- citty
|
|
13
14
|
- typebox
|
|
14
15
|
- bun
|
|
15
16
|
owner: runx-architecture
|
|
@@ -19,14 +20,20 @@ owner: runx-architecture
|
|
|
19
20
|
|
|
20
21
|
## Flow
|
|
21
22
|
|
|
22
|
-
`cli.ts`
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
`cli.ts` defines a Citty command tree. Citty parses options and positionals,
|
|
24
|
+
resolves nested commands and aliases, and renders ordinary usage. A bounded
|
|
25
|
+
command-map adapter preserves the legacy `runx <selector>` shorthand while
|
|
26
|
+
known Citty commands retain precedence. Manifest commands use `manifest.ts` to
|
|
27
|
+
discover the nearest `runx.yaml`, parse YAML, validate a strict TypeBox schema,
|
|
28
|
+
and resolve a selector. `render.ts` presents text or JSON. `executor.ts` spawns
|
|
29
|
+
exactly one configured shell command only for a real run.
|
|
26
30
|
|
|
27
31
|
## Boundaries
|
|
28
32
|
|
|
29
33
|
- Inspection paths never call the executor.
|
|
34
|
+
- Help, version, and CLI usage failures do not discover a manifest.
|
|
35
|
+
- `source/flags.ts` no longer exists; RunX has no second token parser or manual
|
|
36
|
+
execution router behind Citty.
|
|
30
37
|
- `agents.ts` copies the embedded or packaged skill into the requested standard
|
|
31
38
|
or Claude-compatible skill location.
|
|
32
39
|
- `self-management.ts` queries GitHub Releases and only replaces/removes a
|
|
@@ -35,5 +42,6 @@ spawns exactly one configured shell command only for a real run.
|
|
|
35
42
|
|
|
36
43
|
## Distribution
|
|
37
44
|
|
|
38
|
-
Bun compiles standalone binaries
|
|
39
|
-
asset; CI validates source and
|
|
45
|
+
Bun bundles Citty and compiles standalone binaries without a Node.js runtime.
|
|
46
|
+
Direct installers select a GitHub Release asset; CI validates source and the
|
|
47
|
+
native release matrix, while protected tags publish release artifacts.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: RunX Citty CLI Migration
|
|
3
|
+
purpose: Define the accepted replacement of RunX's handwritten argument parser and router with Citty.
|
|
4
|
+
description: Records the full Citty command-tree migration, compatibility requirements, error behavior, validation scope, and patch-release boundary.
|
|
5
|
+
created: 2026-07-14
|
|
6
|
+
flags:
|
|
7
|
+
- accepted
|
|
8
|
+
- implemented
|
|
9
|
+
tags:
|
|
10
|
+
- decisions
|
|
11
|
+
- cli
|
|
12
|
+
- typescript
|
|
13
|
+
keywords:
|
|
14
|
+
- runx
|
|
15
|
+
- citty
|
|
16
|
+
- argument parsing
|
|
17
|
+
- command routing
|
|
18
|
+
- short flags
|
|
19
|
+
owner: runx-decisions
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# RunX Citty CLI Migration
|
|
23
|
+
|
|
24
|
+
## Context
|
|
25
|
+
|
|
26
|
+
RunX currently parses arguments and routes commands with repository-owned loops
|
|
27
|
+
and conditionals. The parser recognizes only long options beginning with `--`,
|
|
28
|
+
so conventional aliases such as `runx -v` and `runx -h` are treated as command
|
|
29
|
+
selectors. That incorrect fallback causes global CLI operations to search for a
|
|
30
|
+
`runx.yaml` manifest.
|
|
31
|
+
|
|
32
|
+
Mirror and XDocs provide useful command semantics and help conventions, but
|
|
33
|
+
both also maintain handwritten parsers. RunX will instead use Citty as the
|
|
34
|
+
single parser, command router, alias registry, and usage generator.
|
|
35
|
+
|
|
36
|
+
## Decision
|
|
37
|
+
|
|
38
|
+
- Add `citty` as a runtime dependency and bundle it into native RunX builds.
|
|
39
|
+
- Replace the handwritten parser in `source/flags.ts` and the manual routing in
|
|
40
|
+
`source/cli.ts` with a complete Citty command tree.
|
|
41
|
+
- Do not introduce Commander, yargs, oclif, Clipanion, or a second parsing
|
|
42
|
+
abstraction around Citty.
|
|
43
|
+
- Keep Bun as the development, test, build, and native-compilation toolchain.
|
|
44
|
+
- Do not add a Node.js runtime dependency or an npm `postinstall` hook.
|
|
45
|
+
- Release the completed migration as the next Mirror-managed patch after all
|
|
46
|
+
validation passes.
|
|
47
|
+
|
|
48
|
+
## Command Tree
|
|
49
|
+
|
|
50
|
+
The Citty tree must preserve the current public commands:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
runx
|
|
54
|
+
|- list
|
|
55
|
+
|- describe <selector>
|
|
56
|
+
|- run <selector>
|
|
57
|
+
|- r <selector>
|
|
58
|
+
|- check
|
|
59
|
+
|- agents
|
|
60
|
+
| |- install <local|global>
|
|
61
|
+
| `- instructions
|
|
62
|
+
|- upgrade
|
|
63
|
+
| |- check
|
|
64
|
+
| `- list
|
|
65
|
+
`- uninstall
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`r` remains an alias of `run`. The human shorthand `runx <selector>` remains
|
|
69
|
+
supported through the root command's positional selector compatibility path.
|
|
70
|
+
Known Citty subcommands always take precedence over selector fallback.
|
|
71
|
+
|
|
72
|
+
## Arguments and Help
|
|
73
|
+
|
|
74
|
+
- Citty owns `-h`/`--help` and `-v`/`--version`.
|
|
75
|
+
- Version and help must return without reading or discovering `runx.yaml`.
|
|
76
|
+
- Preserve `--cwd`, `--file`, `--format`, `--verbose`, `--dry-run`, `--yes`,
|
|
77
|
+
`--help-tree`, and `--help-docs` where they apply.
|
|
78
|
+
- Preserve `--tool agents|claude|all` for agent-skill installation.
|
|
79
|
+
- Preserve JSON output contracts for successful commands and self-management
|
|
80
|
+
results.
|
|
81
|
+
- Use Citty metadata and argument definitions as the source of ordinary command
|
|
82
|
+
usage text. Keep RunX's extended help tree and documentation guidance as
|
|
83
|
+
explicit custom outputs rather than duplicating Citty's ordinary help.
|
|
84
|
+
|
|
85
|
+
## Implementation Boundaries
|
|
86
|
+
|
|
87
|
+
- `source/cli.ts` owns the root Citty command and CLI entry function.
|
|
88
|
+
- Command definitions may be grouped into focused modules for catalog,
|
|
89
|
+
agent, and self-management commands when that keeps `source/cli.ts` small.
|
|
90
|
+
- Existing manifest parsing, selector resolution, execution, agent
|
|
91
|
+
installation, upgrade, and uninstall functions remain the business-logic
|
|
92
|
+
implementations. The migration changes their CLI adapters, not their domain
|
|
93
|
+
behavior.
|
|
94
|
+
- Remove `source/flags.ts` after all consumers migrate to Citty.
|
|
95
|
+
- Keep entrypoints thin: they register embedded native resources when needed
|
|
96
|
+
and invoke the Citty-backed CLI.
|
|
97
|
+
|
|
98
|
+
## Error Behavior
|
|
99
|
+
|
|
100
|
+
- Unknown options fail as CLI usage errors and never trigger manifest discovery.
|
|
101
|
+
- Unknown explicit subcommands show relevant Citty usage.
|
|
102
|
+
- A root positional that is not a known command is treated as the intentional
|
|
103
|
+
selector shorthand and may discover a manifest.
|
|
104
|
+
- Missing command arguments show the specific command's usage.
|
|
105
|
+
- Domain failures continue to use `RunXError` messages and non-zero exit codes.
|
|
106
|
+
- Verbose mode may expose additional diagnostics, but normal errors remain
|
|
107
|
+
concise and actionable.
|
|
108
|
+
|
|
109
|
+
## Testing
|
|
110
|
+
|
|
111
|
+
Automated coverage must include:
|
|
112
|
+
|
|
113
|
+
- `runx -v` and `runx --version` outside a configured project.
|
|
114
|
+
- `runx -h` and `runx --help` outside a configured project.
|
|
115
|
+
- Help and missing-argument behavior for each command group.
|
|
116
|
+
- `runx run <selector>`, `runx r <selector>`, and `runx <selector>` compatibility.
|
|
117
|
+
- Unknown flags and unknown explicit commands.
|
|
118
|
+
- Existing global flags, JSON output, confirmation gates, and dry runs.
|
|
119
|
+
- Agent install/instructions routing.
|
|
120
|
+
- Upgrade check/list/apply and uninstall routing.
|
|
121
|
+
- Typecheck, unit tests, library build, local native build, and the twelve-target
|
|
122
|
+
native binary matrix.
|
|
123
|
+
|
|
124
|
+
## Documentation and Release
|
|
125
|
+
|
|
126
|
+
Update public command documentation, the bundled `guiho-s-runx` skill, source
|
|
127
|
+
descriptors, and release notes to match the Citty command tree. Validate the
|
|
128
|
+
affected XDocs scopes before delivery. Use Mirror to plan and apply the next
|
|
129
|
+
patch; never hand-edit the package version or create the release tag manually.
|
|
130
|
+
|
|
131
|
+
## Acceptance Criteria
|
|
132
|
+
|
|
133
|
+
- No RunX-owned argument-token loop or manual top-level command router remains.
|
|
134
|
+
- `-v`, `--version`, `-h`, and `--help` work without a manifest.
|
|
135
|
+
- Current commands and selector shorthand remain compatible.
|
|
136
|
+
- Invalid CLI input produces usage errors rather than unrelated manifest errors.
|
|
137
|
+
- The npm package and native executables expose the same Citty-backed behavior.
|
|
138
|
+
- The implementation adds no `postinstall` hook and no Node.js runtime
|
|
139
|
+
requirement.
|
|
@@ -5,15 +5,20 @@ parent: runx-docs
|
|
|
5
5
|
children: []
|
|
6
6
|
files:
|
|
7
7
|
alpha-boundaries.md: Captures accepted alpha scope, safety, distribution, and compatibility decisions.
|
|
8
|
+
citty-cli-migration.md: Defines the accepted full migration from handwritten parsing and routing to Citty.
|
|
9
|
+
mirror-automatic-push.md: Defines automatic Mirror release pushes with a synchronized protected-main gate.
|
|
8
10
|
npm-trusted-publishing.md: Defines the accepted npm OIDC publishing workflow and protected-branch patch-release trial.
|
|
9
11
|
documents:
|
|
10
12
|
alpha-boundaries.md: Decision record for RunX alpha boundaries.
|
|
13
|
+
citty-cli-migration.md: Decision record for the complete Citty CLI parser and router migration.
|
|
14
|
+
mirror-automatic-push.md: Accepted release-policy decision for Mirror push=true and protected delivery ordering.
|
|
11
15
|
npm-trusted-publishing.md: Decision record for GitHub Actions npm trusted publishing and the first automated patch release.
|
|
12
16
|
tags:
|
|
13
17
|
- decisions
|
|
14
18
|
keywords:
|
|
15
19
|
- runx
|
|
16
20
|
- decisions
|
|
21
|
+
- mirror push
|
|
17
22
|
flags: []
|
|
18
23
|
status: stable
|
|
19
24
|
---
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: RunX Mirror Automatic Release Push
|
|
3
|
+
purpose: Record the accepted policy that Mirror pushes RunX release commits and tags automatically.
|
|
4
|
+
description: Defines push=true, the synchronized-main precondition, protected GitHub delivery, failure behavior, and rollback boundary.
|
|
5
|
+
created: 2026-07-14
|
|
6
|
+
flags:
|
|
7
|
+
- accepted
|
|
8
|
+
tags:
|
|
9
|
+
- decisions
|
|
10
|
+
- release
|
|
11
|
+
- mirror
|
|
12
|
+
keywords:
|
|
13
|
+
- runx
|
|
14
|
+
- mirror push
|
|
15
|
+
- protected main
|
|
16
|
+
- release tags
|
|
17
|
+
owner: runx-decisions
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# RunX Mirror Automatic Release Push
|
|
21
|
+
|
|
22
|
+
## Status
|
|
23
|
+
|
|
24
|
+
Accepted by the repository owner on 2026-07-14.
|
|
25
|
+
|
|
26
|
+
## Context
|
|
27
|
+
|
|
28
|
+
RunX previously configured Mirror with `push = false`. Each release applied the
|
|
29
|
+
version commit and tag locally, then required separate branch delivery and tag
|
|
30
|
+
push commands. The owner wants RunX to match the automatic Mirror release flow
|
|
31
|
+
used by the related GUIHO repositories.
|
|
32
|
+
|
|
33
|
+
RunX also protects `main` and `@guiho/runx@*` tags. Automatic pushing must not
|
|
34
|
+
allow a release tag to reference a commit that has not reached protected
|
|
35
|
+
`main`.
|
|
36
|
+
|
|
37
|
+
## Decision
|
|
38
|
+
|
|
39
|
+
- Set `[git].push = true` in `mirror.config.toml`.
|
|
40
|
+
- Run future `mirror version apply` operations only from a clean, synchronized
|
|
41
|
+
local `main` whose HEAD equals `origin/main`.
|
|
42
|
+
- Complete implementation changes through protected pull requests before
|
|
43
|
+
applying Mirror.
|
|
44
|
+
- Treat `mirror version apply` as the single release mutation that writes the
|
|
45
|
+
version, commits, tags, and pushes the configured refs.
|
|
46
|
+
- Keep package publication behind the GitHub `production` environment approval
|
|
47
|
+
and npm OIDC trusted publishing.
|
|
48
|
+
|
|
49
|
+
## Alternatives Considered
|
|
50
|
+
|
|
51
|
+
- Keep `push = false`: rejected because it preserves the manual release step the
|
|
52
|
+
owner explicitly asked to remove.
|
|
53
|
+
- Pass `--push` per release: rejected because it makes release behavior depend
|
|
54
|
+
on operator memory instead of repository configuration.
|
|
55
|
+
- Apply Mirror on a release branch and merge later: rejected because the tag
|
|
56
|
+
could publish a commit before that commit is part of protected `main`.
|
|
57
|
+
|
|
58
|
+
## Consequences
|
|
59
|
+
|
|
60
|
+
- Successful Mirror applies will immediately push release refs and can trigger
|
|
61
|
+
the public Publish workflow.
|
|
62
|
+
- Operators must treat `mirror version apply` as an externally visible release,
|
|
63
|
+
not a local preparation step.
|
|
64
|
+
- The synchronized-main gate becomes mandatory; failures stop before apply.
|
|
65
|
+
- Existing GitHub rulesets, environment review, and OIDC remain the enforcement
|
|
66
|
+
layers for branch, tag, and package publication.
|
|
67
|
+
|
|
68
|
+
## Reversal Or Revisit Conditions
|
|
69
|
+
|
|
70
|
+
Return to `push = false` if Mirror cannot push through repository protections
|
|
71
|
+
reliably, if releases need a separate staging phase, or if automatic tag
|
|
72
|
+
publication creates unacceptable operational risk.
|
|
73
|
+
|
|
74
|
+
## Follow-up Work
|
|
75
|
+
|
|
76
|
+
- Update repository instructions and XDocs metadata.
|
|
77
|
+
- Validate resolved Mirror configuration and a read-only patch plan.
|
|
78
|
+
- Deliver the configuration through protected `main` without applying another
|
|
79
|
+
release.
|
|
80
|
+
|
|
81
|
+
## References
|
|
82
|
+
|
|
83
|
+
- [Citty CLI Migration Plan](../plans/citty-cli-migration.md)
|
|
84
|
+
- [npm Trusted Publishing Decision](npm-trusted-publishing.md)
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: RunX Citty CLI Migration Plan
|
|
3
|
+
purpose: Execute the accepted full migration from RunX handwritten argument parsing and routing to Citty.
|
|
4
|
+
description: Sequences dependency verification, command-tree migration, compatibility tests, documentation, protected delivery, and the next Mirror-managed patch release.
|
|
5
|
+
created: 2026-07-14
|
|
6
|
+
flags:
|
|
7
|
+
- approved
|
|
8
|
+
- in-progress
|
|
9
|
+
tags:
|
|
10
|
+
- plans
|
|
11
|
+
- cli
|
|
12
|
+
- citty
|
|
13
|
+
keywords:
|
|
14
|
+
- runx
|
|
15
|
+
- citty
|
|
16
|
+
- argument parsing
|
|
17
|
+
- command routing
|
|
18
|
+
- patch release
|
|
19
|
+
owner: runx-plans
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# RunX Citty CLI Migration Plan
|
|
23
|
+
|
|
24
|
+
## Source Decision
|
|
25
|
+
|
|
26
|
+
- [Full Citty CLI Migration](../decisions/citty-cli-migration.md)
|
|
27
|
+
|
|
28
|
+
## Unit 1: Add and Verify Citty
|
|
29
|
+
|
|
30
|
+
- Goal: Add Citty as the only CLI parser/router dependency and verify its Bun,
|
|
31
|
+
TypeScript, and native-executable interfaces before replacing production
|
|
32
|
+
routing.
|
|
33
|
+
- Dependencies: Accepted Citty migration decision.
|
|
34
|
+
- Files:
|
|
35
|
+
- `package.json`
|
|
36
|
+
- `bun.lock`
|
|
37
|
+
- Data, auth, and cache: No persisted data, authentication, or cache behavior
|
|
38
|
+
changes.
|
|
39
|
+
- Checks:
|
|
40
|
+
- Install `citty` with Bun as a runtime dependency.
|
|
41
|
+
- Inspect its locally installed types for command definitions, aliases,
|
|
42
|
+
positional arguments, raw argument execution, help, and version handling.
|
|
43
|
+
- Run a bounded native compile after integration begins to confirm Citty is
|
|
44
|
+
bundled without a Node.js runtime dependency.
|
|
45
|
+
- Acceptance: Citty is declared once as a production dependency and exposes
|
|
46
|
+
the interfaces needed for a testable RunX command tree.
|
|
47
|
+
- Stop conditions: Stop if Citty requires Node.js at runtime, cannot be bundled
|
|
48
|
+
by Bun, or cannot express the accepted command and alias contract.
|
|
49
|
+
|
|
50
|
+
## Unit 2: Replace Parsing and Routing
|
|
51
|
+
|
|
52
|
+
- Goal: Make Citty own all CLI parsing, help, version handling, subcommands,
|
|
53
|
+
aliases, and dispatch while retaining RunX domain behavior.
|
|
54
|
+
- Dependencies: Unit 1 complete.
|
|
55
|
+
- Files:
|
|
56
|
+
- `source/cli.ts`
|
|
57
|
+
- `source/flags.ts` (remove)
|
|
58
|
+
- supporting source modules only when separation materially improves the
|
|
59
|
+
command definitions
|
|
60
|
+
- Command tree:
|
|
61
|
+
- `runx`
|
|
62
|
+
- `runx list`
|
|
63
|
+
- `runx describe <selector>`
|
|
64
|
+
- `runx run <selector>` and alias `runx r <selector>`
|
|
65
|
+
- `runx check`
|
|
66
|
+
- `runx agents install <local|global>`
|
|
67
|
+
- `runx agents instructions`
|
|
68
|
+
- `runx upgrade`, `runx upgrade check`, and `runx upgrade list`
|
|
69
|
+
- `runx uninstall`
|
|
70
|
+
- Compatibility:
|
|
71
|
+
- Preserve root `runx <selector>` as a compatibility shorthand after known
|
|
72
|
+
Citty subcommands take precedence.
|
|
73
|
+
- Preserve `--cwd`, `--file`, `--format`, `--verbose`, `--dry-run`, `--yes`,
|
|
74
|
+
`--help-tree`, `--help-docs`, and `--tool` on their applicable paths.
|
|
75
|
+
- Citty owns `-h`/`--help` and `-v`/`--version`; neither may discover a
|
|
76
|
+
manifest.
|
|
77
|
+
- Unknown options are usage failures; manifest and execution failures remain
|
|
78
|
+
`RunXError` domain failures.
|
|
79
|
+
- Data, auth, and cache: Manifest parsing, selectors, subprocess behavior,
|
|
80
|
+
installer destinations, upgrade metadata, and output payloads remain
|
|
81
|
+
unchanged.
|
|
82
|
+
- Acceptance: No handwritten token parser or top-level manual command router
|
|
83
|
+
remains, and all accepted command paths dispatch through Citty.
|
|
84
|
+
- Stop conditions: Stop if listing, describing, checking, help, version, or dry
|
|
85
|
+
runs spawn a configured command, or if JSON output contracts drift.
|
|
86
|
+
|
|
87
|
+
## Unit 3: Prove and Document the Public Contract
|
|
88
|
+
|
|
89
|
+
- Goal: Lock the migrated command tree with tests and align every public
|
|
90
|
+
reference with the Citty-owned interface.
|
|
91
|
+
- Dependencies: Unit 2 complete.
|
|
92
|
+
- Files:
|
|
93
|
+
- CLI tests under `source/`
|
|
94
|
+
- `README.md`
|
|
95
|
+
- `DOCS.md`
|
|
96
|
+
- `skills/guiho-s-runx/SKILL.md`
|
|
97
|
+
- affected named `*.xdocs.md` descriptors
|
|
98
|
+
- `AGENTS.md` only if its durable command contract needs correction
|
|
99
|
+
- Tests:
|
|
100
|
+
- Root help, `-h`, `--help`, `-v`, and `--version` outside a RunX project.
|
|
101
|
+
- Every command, nested command, alias, positional selector, applicable flag,
|
|
102
|
+
and root-selector shorthand.
|
|
103
|
+
- Unknown option, missing argument, manifest/domain error, JSON, dry-run, and
|
|
104
|
+
no-spawn safety behavior.
|
|
105
|
+
- Upgrade and agent paths retain their existing business behavior.
|
|
106
|
+
- Documentation: Explain the Citty command tree and generated help without
|
|
107
|
+
exposing an obsolete parser implementation.
|
|
108
|
+
- Acceptance: Tests cover all public paths and aliases; the bundled skill and
|
|
109
|
+
XDocs metadata describe the same contract as the executable.
|
|
110
|
+
- Stop conditions: Stop on contradictory docs, missing command coverage, or a
|
|
111
|
+
safety regression.
|
|
112
|
+
|
|
113
|
+
## Unit 4: Validate and Deliver Through Protected Main
|
|
114
|
+
|
|
115
|
+
- Goal: Demonstrate package and native-executable correctness, then merge the
|
|
116
|
+
implementation without bypassing repository protections.
|
|
117
|
+
- Dependencies: Unit 3 complete.
|
|
118
|
+
- Checks:
|
|
119
|
+
- `bun run typecheck`
|
|
120
|
+
- `bun test`
|
|
121
|
+
- `bun run build`
|
|
122
|
+
- `bun run binary`
|
|
123
|
+
- `bun run binaries`
|
|
124
|
+
- package dry-run and packed-launcher `-v`/help checks outside a manifest
|
|
125
|
+
- native executable `-v`/help checks outside a manifest
|
|
126
|
+
- targeted strict XDocs metadata and doctor checks
|
|
127
|
+
- `git diff --check`
|
|
128
|
+
- Delivery:
|
|
129
|
+
- Commit only understood migration changes on the current `codex/` branch.
|
|
130
|
+
- Push, open a pull request, wait for required CI, and merge through protected
|
|
131
|
+
`main`.
|
|
132
|
+
- Synchronize local `main` after the merge.
|
|
133
|
+
- Acceptance: CI passes and remote `main` contains the complete migration.
|
|
134
|
+
- Stop conditions: Stop on validation failure, unexpected worktree changes,
|
|
135
|
+
unresolved review, or branch-protection failure.
|
|
136
|
+
|
|
137
|
+
## Unit 5: Publish the Next Mirror-Managed Patch
|
|
138
|
+
|
|
139
|
+
- Goal: Release the merged migration as patch `0.2.4` and verify both npm and
|
|
140
|
+
native GitHub distribution.
|
|
141
|
+
- Dependencies: Unit 4 merged; user authorization in this task to complete the
|
|
142
|
+
patch release.
|
|
143
|
+
- Sequence:
|
|
144
|
+
- Load the Mirror workflow and inspect `mirror.config.toml`.
|
|
145
|
+
- Confirm a clean, synchronized base and run the full release validation.
|
|
146
|
+
- Run `mirror version plan patch` and require `0.2.4`.
|
|
147
|
+
- Prepare the allowed changelog/XDocs updates and commit them.
|
|
148
|
+
- Apply the patch with Mirror; do not hand-edit managed versions.
|
|
149
|
+
- Deliver the release commit through protected `main`, then push the protected
|
|
150
|
+
tag only after the tagged commit is in `main` history.
|
|
151
|
+
- Monitor the `production` workflow while the user performs its manual
|
|
152
|
+
environment approval.
|
|
153
|
+
- Verify the GitHub Release assets and npm version/provenance.
|
|
154
|
+
- Acceptance: `package.json`, the Mirror release commit, protected tag,
|
|
155
|
+
successful Publish run, GitHub Release, and npm registry all agree on
|
|
156
|
+
`0.2.4`.
|
|
157
|
+
- Stop conditions: Stop before tagging if Mirror plans another version or
|
|
158
|
+
validation fails. If publication fails after tagging, preserve the tag and
|
|
159
|
+
capture the exact failure before deciding any follow-up release.
|
|
160
|
+
|
|
161
|
+
## TODO Alignment
|
|
162
|
+
|
|
163
|
+
This is a single authorized execution session with a durable decision, plan,
|
|
164
|
+
and review. It does not require a separate long-running TODO entry.
|
|
165
|
+
|
|
166
|
+
## First Executable Unit
|
|
167
|
+
|
|
168
|
+
Unit 1: add Citty with Bun and verify the installed API against the accepted
|
|
169
|
+
RunX command contract.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: RunX Mirror Automatic Push Plan
|
|
3
|
+
purpose: Execute the accepted push=true release policy through protected main without creating another release.
|
|
4
|
+
description: Sequences configuration, safety instructions, XDocs validation, protected delivery, and post-merge verification.
|
|
5
|
+
created: 2026-07-14
|
|
6
|
+
flags:
|
|
7
|
+
- approved
|
|
8
|
+
tags:
|
|
9
|
+
- plans
|
|
10
|
+
- release
|
|
11
|
+
- mirror
|
|
12
|
+
keywords:
|
|
13
|
+
- runx
|
|
14
|
+
- mirror push
|
|
15
|
+
- protected main
|
|
16
|
+
- configuration
|
|
17
|
+
owner: runx-plans
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# RunX Mirror Automatic Push Plan
|
|
21
|
+
|
|
22
|
+
## Source Decision
|
|
23
|
+
|
|
24
|
+
- [RunX Mirror Automatic Release Push](../decisions/mirror-automatic-push.md)
|
|
25
|
+
|
|
26
|
+
## Unit 1: Configure And Document Automatic Push
|
|
27
|
+
|
|
28
|
+
- Goal: Make automatic release pushing a repository-owned Mirror policy.
|
|
29
|
+
- Owner: RunX repository.
|
|
30
|
+
- Dependencies: Accepted automatic-push decision; `0.2.4` already applied and
|
|
31
|
+
pushed, so this change must not apply another version.
|
|
32
|
+
- Files:
|
|
33
|
+
- `mirror.config.toml`
|
|
34
|
+
- `AGENTS.md`
|
|
35
|
+
- `runx.xdocs.md`
|
|
36
|
+
- Data, auth, and cache: No application data, authentication, authorization, or
|
|
37
|
+
cache impact. GitHub credentials and rulesets remain external.
|
|
38
|
+
- Changes:
|
|
39
|
+
- Set `[git].push = true`.
|
|
40
|
+
- Require clean synchronized `main` before `mirror version apply`.
|
|
41
|
+
- Document that apply is an externally visible release mutation.
|
|
42
|
+
- Checks:
|
|
43
|
+
- `mirror config check`
|
|
44
|
+
- `mirror config show`
|
|
45
|
+
- `mirror version plan patch --format json`
|
|
46
|
+
- Verify the plan reports `pushEnabled: true` and next patch `0.2.5` without
|
|
47
|
+
applying it.
|
|
48
|
+
- Strict root XDocs metadata and doctor checks.
|
|
49
|
+
- Acceptance: The resolved config enables push; safety guidance prevents apply
|
|
50
|
+
from a feature branch or stale main; no version, commit, or tag is created by
|
|
51
|
+
validation.
|
|
52
|
+
- Stop conditions: Stop if Mirror cannot load the config, the read-only plan
|
|
53
|
+
mutates state, or the worktree contains unrelated changes.
|
|
54
|
+
|
|
55
|
+
## Unit 2: Deliver Through Protected Main
|
|
56
|
+
|
|
57
|
+
- Goal: Merge the configuration policy without bypassing required CI.
|
|
58
|
+
- Dependencies: Unit 1 complete and committed.
|
|
59
|
+
- Delivery:
|
|
60
|
+
- Push `codex/mirror-auto-push`.
|
|
61
|
+
- Open a ready pull request to `main`.
|
|
62
|
+
- Wait for required CI and merge through the repository ruleset.
|
|
63
|
+
- Synchronize local `main` and confirm `mirror config show` reports
|
|
64
|
+
`push: true`.
|
|
65
|
+
- Acceptance: `origin/main` owns the configuration and instructions; no new
|
|
66
|
+
release tag was created.
|
|
67
|
+
- Stop conditions: Stop on CI failure, unresolved protection failure, or an
|
|
68
|
+
unexpected version/tag mutation.
|
|
69
|
+
|
|
70
|
+
## TODO Alignment
|
|
71
|
+
|
|
72
|
+
This is a bounded owner-approved configuration change completed in one session;
|
|
73
|
+
it does not require a separate TODO entry.
|
|
74
|
+
|
|
75
|
+
## First Executable Unit
|
|
76
|
+
|
|
77
|
+
Unit 1: set and document the resolved Mirror automatic-push policy.
|
|
@@ -5,15 +5,21 @@ parent: runx-docs
|
|
|
5
5
|
children: []
|
|
6
6
|
files:
|
|
7
7
|
alpha-implementation.md: Breaks the accepted alpha into implementation and validation units.
|
|
8
|
+
citty-cli-migration.md: Executes the full Citty command-tree migration, compatibility validation, protected delivery, and patch release.
|
|
9
|
+
mirror-automatic-push.md: Enables automatic Mirror release pushes with a synchronized protected-main safety gate.
|
|
8
10
|
npm-trusted-publishing-release.md: Sequences workflow implementation, protected delivery, Mirror patching, and public trusted-publishing verification.
|
|
9
11
|
documents:
|
|
10
12
|
alpha-implementation.md: Plan used for the initial RunX implementation.
|
|
13
|
+
citty-cli-migration.md: Active plan for replacing handwritten CLI parsing and routing with Citty and delivering its patch release.
|
|
14
|
+
mirror-automatic-push.md: Approved plan for configuring, validating, and merging Mirror push=true without applying another release.
|
|
11
15
|
npm-trusted-publishing-release.md: Approved executable plan for the RunX 0.2.1 trusted-publishing release trial.
|
|
12
16
|
tags:
|
|
13
17
|
- plans
|
|
14
18
|
keywords:
|
|
15
19
|
- runx
|
|
16
20
|
- implementation
|
|
21
|
+
- citty
|
|
22
|
+
- mirror push
|
|
17
23
|
flags: []
|
|
18
24
|
status: stable
|
|
19
25
|
---
|