opensdd 0.1.1 → 0.1.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/opensdd/cli.md +8 -0
- package/package.json +1 -1
- package/src/index.js +9 -3
package/opensdd/cli.md
CHANGED
|
@@ -14,6 +14,14 @@ The CLI is published to npm as `opensdd` and invoked as `opensdd`.
|
|
|
14
14
|
|
|
15
15
|
## Behavioral Contract
|
|
16
16
|
|
|
17
|
+
### `opensdd --version`
|
|
18
|
+
|
|
19
|
+
Prints the current package version from `package.json` and exits. The version MUST be read from the npm package manifest at runtime — it MUST NOT be hardcoded.
|
|
20
|
+
|
|
21
|
+
### `opensdd --help`
|
|
22
|
+
|
|
23
|
+
Prints usage information including the current version, available commands, and options. The version shown MUST be read from `package.json` at runtime.
|
|
24
|
+
|
|
17
25
|
### `opensdd init`
|
|
18
26
|
|
|
19
27
|
Initializes the OpenSDD protocol in the current project.
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
1
2
|
import { initCommand } from './commands/init.js';
|
|
2
3
|
import { listCommand } from './commands/list.js';
|
|
3
4
|
import { installCommand } from './commands/install.js';
|
|
@@ -27,7 +28,9 @@ function parseArgs(argv) {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
function printHelp() {
|
|
30
|
-
|
|
31
|
+
const require = createRequire(import.meta.url);
|
|
32
|
+
const pkg = require('../package.json');
|
|
33
|
+
console.log(`opensdd v${pkg.version} - Open Spec-Driven Development CLI
|
|
31
34
|
|
|
32
35
|
Usage: opensdd <command> [options]
|
|
33
36
|
|
|
@@ -102,9 +105,12 @@ async function main() {
|
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
case '--version':
|
|
105
|
-
case '-v':
|
|
106
|
-
|
|
108
|
+
case '-v': {
|
|
109
|
+
const require = createRequire(import.meta.url);
|
|
110
|
+
const pkg = require('../package.json');
|
|
111
|
+
console.log(pkg.version);
|
|
107
112
|
break;
|
|
113
|
+
}
|
|
108
114
|
|
|
109
115
|
case '--help':
|
|
110
116
|
case '-h':
|