@bizone-ai/cli 0.1.2 → 0.1.4
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 +9 -9
- package/package.json +1 -1
- package/src/cli.js +5 -3
package/README.md
CHANGED
|
@@ -14,23 +14,23 @@ Works on **macOS** and **Windows**.
|
|
|
14
14
|
|
|
15
15
|
Requires **Node.js >= 18** and a running **Docker** engine.
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### Run without installing (npx)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Run the latest published version directly — no install step:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
npx @bizone-ai/cli start
|
|
23
|
+
# e.g.
|
|
24
|
+
# npx @bizone-ai/cli <category> <command> [args]
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
###
|
|
27
|
+
### Global install (recommended)
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
Install the published package globally so the `bizone` command is on your PATH:
|
|
29
30
|
|
|
30
31
|
```bash
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
npx @bizone-ai/cli start
|
|
32
|
+
npm install -g @bizone-ai/cli
|
|
33
|
+
bizone --version
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
### From source (local clone)
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Argument parsing and command dispatch.
|
|
2
|
-
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
3
|
import { initColors, color, log } from './colors.js';
|
|
4
4
|
import { configuration } from './commands/configuration.js';
|
|
5
5
|
import { images } from './commands/images.js';
|
|
@@ -9,7 +9,9 @@ import { database } from './commands/database.js';
|
|
|
9
9
|
import { start } from './commands/start.js';
|
|
10
10
|
import { stop } from './commands/stop.js';
|
|
11
11
|
import { CONFIG_PATH } from './config.js';
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
const { version } = require("../package.json"); // JSON.parse(readFileSync(join(__dirname, "package.json")));
|
|
13
15
|
|
|
14
16
|
// category -> { aliases, handler }
|
|
15
17
|
const CATEGORIES = {
|
|
@@ -81,7 +83,7 @@ export async function main(argv) {
|
|
|
81
83
|
return 0;
|
|
82
84
|
}
|
|
83
85
|
if (args[0] === '--version' || args[0] === '-v' || args[0] === 'version') {
|
|
84
|
-
log.plain(version);
|
|
86
|
+
log.plain(version ?? "Failed getting version");
|
|
85
87
|
return 0;
|
|
86
88
|
}
|
|
87
89
|
|