Skip to content

Commit 5cb1b07

Browse files
committed
feat: v0.3.0 — npx opencode-sdlc-wizard init CLI
Closes the install ergonomics gap. v0.2.0 shipped the bundle but the only install paths were git-clone+bash or npm-i+bash — neither reads as "easy as hell." v0.3.0 adds a thin Node wrapper at cli/bin/opencode-sdlc-wizard.js plus a `bin` entry in package.json so the canonical install becomes: npx opencode-sdlc-wizard init The wrapper: - shells out to install.sh for the real run (preserves the bash installer's MATCH/CUSTOMIZED/MISSING semantics, idempotent .wizard-stamp, --force overwrite logic) - implements --dry-run at the wrapper layer so users can preview the bundle without writing - passes --target-dir and --force through to install.sh - --version reads package.json, --help prints usage Tests: 10 new in tests/test-cli.sh covering executable, parse, bin declaration, files[] inclusion, --help/--version/unknown-subcmd, init+target-dir actually installs, --dry-run leaves target untouched, npm pack --dry-run includes the CLI. 113 -> 123 across 5 suites. README updated to lead with npx. CHANGELOG + ROADMAP updated to mark v0.3.0 shipped. Verified npm pack --dry-run includes cli/bin/opencode-sdlc-wizard.js so the published tarball ships the CLI.
1 parent 723c40c commit 5cb1b07

6 files changed

Lines changed: 341 additions & 28 deletions

File tree

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,42 @@
22

33
All notable changes to opencode-sdlc-wizard.
44

5+
## [0.3.0] - 2026-05-04
6+
7+
### Added — `npx opencode-sdlc-wizard init` CLI
8+
9+
Closes the install ergonomics gap. Previously the only paths were
10+
`git clone + bash install.sh` or `npm i + bash node_modules/.../install.sh`;
11+
neither reads as "easy as hell." v0.3.0 ships a `bin` entry plus a thin
12+
Node wrapper at `cli/bin/opencode-sdlc-wizard.js` that shells out to
13+
`install.sh`.
14+
15+
```bash
16+
npx opencode-sdlc-wizard init
17+
npx opencode-sdlc-wizard init --target-dir /path
18+
npx opencode-sdlc-wizard init --dry-run
19+
npx opencode-sdlc-wizard --version
20+
npx opencode-sdlc-wizard --help
21+
```
22+
23+
Wrapper-level `--dry-run` previews the bundle install without touching
24+
the target. All other flags (`--target-dir`, `--force`) pass through to
25+
`install.sh` unchanged.
26+
27+
`package.json` now declares `bin.opencode-sdlc-wizard → cli/bin/opencode-sdlc-wizard.js`
28+
and adds `cli/` to the published `files[]`. Verified via `npm pack
29+
--dry-run` that the CLI ships in the tarball.
30+
31+
### Tests
32+
33+
- `tests/test-cli.sh` — 10 tests: bin executable, CLI parses, package.json
34+
declarations correct, `--help` / `--version` / unknown subcommand,
35+
`init --target-dir` does install, `init --dry-run` leaves target
36+
untouched, `npm pack --dry-run` includes the CLI.
37+
38+
**Total: 123 tests, all green** (68 bundle + 11 plugin + 13 install +
39+
21 picker + 10 CLI).
40+
541
## [0.2.0] - 2026-05-04
642

743
### Fixed — live OpenCode E2E reliability (validation against 1.14.33)

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# OpenCode SDLC Wizard
22

3-
> **Status: v0.2.0 (privacy-first backend picker) — 2026-05-04.** Phase A
4-
> port (hooks, skills, AGENTS.md, install.sh) plus a four-tier backend
5-
> picker that defaults to the strongest data-locality guarantee available.
3+
> **Status: v0.3.0 (npx CLI + privacy-first backend picker) — 2026-05-04.**
4+
> Install with `npx opencode-sdlc-wizard init`. Phase A port (hooks,
5+
> skills, AGENTS.md, install.sh) plus a four-tier backend picker that
6+
> defaults to the strongest data-locality guarantee available.
67
> Phase B (backend matrix proof) and Phase C (hardware scout) deferred to
78
> follow-up releases. See [`HANDOFF.md`](HANDOFF.md) for architecture
89
> decisions, [`PRIVACY.md`](PRIVACY.md) for the tier model, and
@@ -60,13 +61,24 @@ capability result, not a port bug.**
6061

6162
## Install
6263

63-
From a target repo's root:
64+
From a target repo's root, the easiest path:
65+
66+
```bash
67+
npx opencode-sdlc-wizard init
68+
```
69+
70+
That's it. Equivalent to the longer manual form:
6471

6572
```bash
6673
git clone https://github.com/BaseInfinity/opencode-sdlc-wizard /tmp/opencode-sdlc-wizard
6774
bash /tmp/opencode-sdlc-wizard/install.sh
6875
```
6976

77+
Both paths are supported. `npx` is preferred for first-time installs;
78+
`git clone + install.sh` is preferred when you want to inspect the bundle
79+
before merging it. Re-run with `--force` to overwrite customizations,
80+
`--dry-run` to preview without writing.
81+
7082
This non-destructively merges the wizard into your `.opencode/`:
7183

7284
- `.opencode/plugins/sdlc-wizard.js` (the OpenCode plugin shim)
@@ -77,8 +89,8 @@ This non-destructively merges the wizard into your `.opencode/`:
7789

7890
Existing customizations are preserved. Re-run with `--force` to overwrite.
7991

80-
A native `npx opencode-sdlc-wizard init` CLI is on the roadmap; for now
81-
the bash installer is the supported path.
92+
Native `npx opencode-sdlc-wizard init` shipped in v0.3.0. The bash
93+
installer remains the inspection/scripting path.
8294

8395
## Pick a backend (privacy-first)
8496

@@ -113,9 +125,10 @@ bash tests/test-bundle-integrity.sh # bundle correctness
113125
bash tests/test-plugin-shim.sh # plugin ESM + bash hook validity
114126
bash tests/test-install.sh # installer non-destructive behavior
115127
bash tests/test-backend-picker.sh # detect/configure-backend behavior
128+
bash tests/test-cli.sh # npx CLI wrapper
116129
```
117130

118-
Or `npm test` runs all four.
131+
Or `npm test` runs all five.
119132

120133
## Known limitations
121134

ROADMAP.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,14 @@ priority but may shuffle as real-world use surfaces friction.
1515
See [CHANGELOG.md](CHANGELOG.md#020---2026-05-04) for the full release
1616
notes.
1717

18-
## v0.3.0 — `npx opencode-sdlc-wizard init` CLI
19-
20-
Status: planned. Target after v0.2.0 sees real consumer use in OpenCode.
21-
22-
The bash `install.sh` works but the wizard ships without an npx entry
23-
point. Parent `agentic-sdlc-wizard` exposes `npx agentic-sdlc-wizard
24-
init` via a `bin` field in package.json + a small Node CLI in
25-
`cli/bin/`. Mirroring that gives users a one-command install:
26-
27-
```bash
28-
npx opencode-sdlc-wizard init
29-
```
30-
31-
Scope:
32-
- Add `bin` entry to `package.json` mapping to `cli/bin/init.js`
33-
- Tiny Node wrapper that shells out to `install.sh`
34-
- Add `--dry-run` and `--target-dir` flags through to the bash installer
35-
- Update README + `npm pack --dry-run` test to verify CLI ships
18+
## v0.3.0 — `npx opencode-sdlc-wizard init` CLI — shipped 2026-05-04
19+
20+
-`bin` entry in package.json → `cli/bin/opencode-sdlc-wizard.js`
21+
- ✅ Node wrapper that shells out to `install.sh` for the real run
22+
- ✅ Wrapper-level `--dry-run` previews bundle without writing
23+
-`--target-dir` / `--force` pass through to `install.sh`
24+
- ✅ 10 CLI tests in `tests/test-cli.sh` (123/123 total across 5 suites)
25+
- ✅ README updated to lead with `npx opencode-sdlc-wizard init`
3626

3727
## v0.3.0 candidate — `cross-model-review` skill (OSS reviewer)
3828

cli/bin/opencode-sdlc-wizard.js

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
// opencode-sdlc-wizard CLI entry point.
5+
//
6+
// Wraps the bundled `install.sh` so users can install via:
7+
// npx opencode-sdlc-wizard init
8+
// instead of the longer
9+
// git clone https://github.com/BaseInfinity/opencode-sdlc-wizard /tmp/...
10+
// bash /tmp/.../install.sh
11+
//
12+
// Subcommands:
13+
// init [options] Install the wizard into a target directory
14+
//
15+
// Init options pass through to install.sh:
16+
// --target-dir PATH Default: cwd
17+
// --force Overwrite existing customizations (default: keep)
18+
// --dry-run Preview changes without writing
19+
//
20+
// Top-level flags:
21+
// --help, -h Show this help
22+
// --version, -v Show version
23+
24+
const fs = require('node:fs');
25+
const path = require('node:path');
26+
const { spawnSync } = require('node:child_process');
27+
28+
const repoRoot = path.resolve(__dirname, '..', '..');
29+
const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, 'package.json'), 'utf8'));
30+
const installScript = path.join(repoRoot, 'install.sh');
31+
32+
const args = process.argv.slice(2);
33+
34+
function printHelp() {
35+
process.stdout.write(`opencode-sdlc-wizard v${pkg.version}
36+
37+
Usage:
38+
npx opencode-sdlc-wizard init [options] Install wizard into a target directory
39+
npx opencode-sdlc-wizard --help Show this help
40+
npx opencode-sdlc-wizard --version Show version
41+
42+
init options (passed through to install.sh):
43+
--target-dir PATH Directory to install into (default: cwd)
44+
--force Overwrite existing customizations
45+
--dry-run Preview changes; do not write
46+
47+
After install:
48+
- AGENTS.md auto-loads on next OpenCode session
49+
- .opencode/plugins/sdlc-wizard.js subscribes to OpenCode events and
50+
fires the bash hooks at .opencode/hooks/
51+
- Run 'bash .opencode/scripts/detect-backends.sh' to see available
52+
backends, then 'bash .opencode/scripts/configure-backend.sh
53+
--tier <t> --provider <p> --model <m>' to pin one in opencode.json
54+
55+
See https://github.com/BaseInfinity/opencode-sdlc-wizard for full docs.
56+
`);
57+
}
58+
59+
if (args.includes('--help') || args.includes('-h')) {
60+
printHelp();
61+
process.exit(0);
62+
}
63+
64+
if (args.includes('--version') || args.includes('-v')) {
65+
process.stdout.write(pkg.version + '\n');
66+
process.exit(0);
67+
}
68+
69+
const subcommand = args.find((a) => !a.startsWith('-'));
70+
71+
if (!subcommand) {
72+
printHelp();
73+
process.exit(0);
74+
}
75+
76+
if (subcommand !== 'init') {
77+
process.stderr.write(`Unknown subcommand: ${subcommand}\n\n`);
78+
printHelp();
79+
process.exit(2);
80+
}
81+
82+
// Forward everything except the leading 'init' to install.sh. install.sh's own
83+
// flag parser handles --target-dir, --force, --dry-run, --help passthrough.
84+
const installArgs = args.filter((a, i) => !(a === 'init' && args.indexOf('init') === i));
85+
86+
// Dry-run: install.sh has no --dry-run flag itself yet, so we honor it at the
87+
// wrapper layer by previewing what install.sh would do without actually
88+
// running it. We approximate by listing the bundle files (REQUIRED_SOURCES)
89+
// against the target. Full integration with install.sh's own dry-run would
90+
// require teaching install.sh the flag — deferred to the next iteration.
91+
if (installArgs.includes('--dry-run')) {
92+
// Find target dir from --target-dir or default to cwd
93+
let target = process.cwd();
94+
for (let i = 0; i < installArgs.length; i++) {
95+
if (installArgs[i] === '--target-dir' && installArgs[i + 1]) {
96+
target = installArgs[i + 1];
97+
break;
98+
}
99+
if (installArgs[i].startsWith('--target-dir=')) {
100+
target = installArgs[i].slice('--target-dir='.length);
101+
break;
102+
}
103+
}
104+
const required = [
105+
'AGENTS.md',
106+
'PRIVACY.md',
107+
'.opencode/plugins/sdlc-wizard.js',
108+
'.opencode/hooks/_find-sdlc-root.sh',
109+
'.opencode/hooks/sdlc-prompt-check.sh',
110+
'.opencode/hooks/tdd-pretool-check.sh',
111+
'.opencode/hooks/instructions-loaded-check.sh',
112+
'.opencode/hooks/model-effort-check.sh',
113+
'.opencode/hooks/precompact-seam-check.sh',
114+
'.opencode/scripts/detect-backends.sh',
115+
'.opencode/scripts/configure-backend.sh',
116+
'.opencode/skills/sdlc/SKILL.md',
117+
'.opencode/skills/setup-wizard/SKILL.md',
118+
'.opencode/skills/update-wizard/SKILL.md',
119+
'.opencode/skills/feedback/SKILL.md',
120+
];
121+
process.stdout.write(`Dry run — install would create the following in ${target}:\n\n`);
122+
for (const f of required) {
123+
const dest = path.join(target, f);
124+
const status = fs.existsSync(dest) ? 'EXISTS' : 'CREATE';
125+
process.stdout.write(` ${status} ${f}\n`);
126+
}
127+
process.stdout.write('\nNo files written. Re-run without --dry-run to apply.\n');
128+
process.exit(0);
129+
}
130+
131+
// Real run: invoke install.sh
132+
const result = spawnSync('bash', [installScript, ...installArgs], {
133+
stdio: 'inherit',
134+
cwd: process.cwd(),
135+
});
136+
137+
if (result.error) {
138+
process.stderr.write(`Failed to run install.sh: ${result.error.message}\n`);
139+
process.exit(1);
140+
}
141+
142+
process.exit(result.status || 0);

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"name": "opencode-sdlc-wizard",
3-
"version": "0.2.0",
4-
"description": "SDLC enforcement for OpenCode CLI — privacy-first, any-backend portability with a four-tier backend picker (local/enterprise/hosted-OSS/proprietary). Sibling of agentic-sdlc-wizard and codex-sdlc-wizard.",
3+
"version": "0.3.0",
4+
"description": "SDLC enforcement for OpenCode CLI — privacy-first, any-backend portability with a four-tier backend picker (local/enterprise/hosted-OSS/proprietary). Install with `npx opencode-sdlc-wizard init`. Sibling of agentic-sdlc-wizard and codex-sdlc-wizard.",
5+
"bin": {
6+
"opencode-sdlc-wizard": "cli/bin/opencode-sdlc-wizard.js"
7+
},
58
"files": [
69
"AGENTS.md",
710
"HANDOFF.md",
@@ -10,12 +13,13 @@
1013
"LICENSE",
1114
"install.sh",
1215
".opencode/",
16+
"cli/",
1317
"skills/",
1418
"hooks/",
1519
"scripts/"
1620
],
1721
"scripts": {
18-
"test": "bash tests/test-bundle-integrity.sh && bash tests/test-plugin-shim.sh && bash tests/test-install.sh && bash tests/test-backend-picker.sh"
22+
"test": "bash tests/test-bundle-integrity.sh && bash tests/test-plugin-shim.sh && bash tests/test-install.sh && bash tests/test-backend-picker.sh && bash tests/test-cli.sh"
1923
},
2024
"keywords": [
2125
"opencode",

0 commit comments

Comments
 (0)