crucix 2.39.1 → 2.39.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/README.md +4 -3
- package/lib/version.mjs +22 -0
- package/package.json +1 -1
- package/scripts/cli.mjs +13 -0
package/README.md
CHANGED
|
@@ -95,15 +95,16 @@ It was built for anyone who wants to understand what's actually happening in the
|
|
|
95
95
|
## Quick Start
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
# From npm (recommended): first run opens the setup wizard
|
|
98
|
+
# From npm (recommended): Node + runtime source, first run opens the setup wizard
|
|
99
99
|
npx crucix
|
|
100
|
-
|
|
101
|
-
# Or install the command
|
|
102
100
|
npm install -g crucix
|
|
101
|
+
crucix --version
|
|
103
102
|
crucix install # ~/.crucix (.env and runs/)
|
|
104
103
|
crucix # dashboard; wizard if no .env yet
|
|
105
104
|
```
|
|
106
105
|
|
|
106
|
+
That is not the standalone exe. `npm run install:local` (from a git checkout) builds `crucix.exe` and copies it to `%USERPROFILE%\.local\bin` / `~/.local/bin`. Check which one PATH hits with `crucix --version`.
|
|
107
|
+
|
|
107
108
|
Settings the wizard and **Settings → News feeds** save go to `%USERPROFILE%\.crucix` on Windows or `~/.crucix` on Linux/macOS. Set `CRUCIX_HOME` to choose another folder, or `CRUCIX_ENV_FILE` to name the `.env` itself.
|
|
108
109
|
|
|
109
110
|
From a git checkout (development):
|
package/lib/version.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
6
|
+
|
|
7
|
+
/** The package.json version, or CRUCIX_VERSION when the SEA binary has no package.json beside it. */
|
|
8
|
+
export function packageVersion() {
|
|
9
|
+
const baked = process.env.CRUCIX_VERSION;
|
|
10
|
+
if (baked) return baked;
|
|
11
|
+
const pkgPath = join(ROOT, 'package.json');
|
|
12
|
+
if (!existsSync(pkgPath)) return '0.0.0';
|
|
13
|
+
try {
|
|
14
|
+
return String(JSON.parse(readFileSync(pkgPath, 'utf8')).version || '0.0.0');
|
|
15
|
+
} catch {
|
|
16
|
+
return '0.0.0';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function versionLine() {
|
|
21
|
+
return `crucix ${packageVersion()}`;
|
|
22
|
+
}
|
package/package.json
CHANGED
package/scripts/cli.mjs
CHANGED
|
@@ -21,6 +21,7 @@ import { runSetupWizard } from '../lib/setup-wizard.mjs';
|
|
|
21
21
|
import { getEnvSearchPaths } from '../apis/utils/env.mjs';
|
|
22
22
|
import { installUserProfile } from '../lib/profile-install.mjs';
|
|
23
23
|
import { resolveRunsDir as resolveUserRunsDir } from '../lib/user-paths.mjs';
|
|
24
|
+
import { packageVersion, versionLine } from '../lib/version.mjs';
|
|
24
25
|
|
|
25
26
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
26
27
|
const ROOT = resolve(__dirname, '..');
|
|
@@ -74,6 +75,7 @@ function parseArgs(argv = process.argv.slice(2)) {
|
|
|
74
75
|
live: false,
|
|
75
76
|
json: false,
|
|
76
77
|
help: false,
|
|
78
|
+
version: false,
|
|
77
79
|
noServer: false,
|
|
78
80
|
sweep: false,
|
|
79
81
|
serve: false,
|
|
@@ -117,6 +119,8 @@ function parseArgs(argv = process.argv.slice(2)) {
|
|
|
117
119
|
const arg = args[i];
|
|
118
120
|
if (arg === '-h' || arg === '--help') {
|
|
119
121
|
opts.help = true;
|
|
122
|
+
} else if (arg === '-v' || arg === '-V' || arg === '--version' || arg === 'version') {
|
|
123
|
+
opts.version = true;
|
|
120
124
|
} else if (arg === 'setup' || arg === 'init' || arg === 'config' || arg === '--setup' || arg === '--config' || arg === 'wizard') {
|
|
121
125
|
opts.setup = true;
|
|
122
126
|
} else if (arg === 'install' || arg === '--install-profile') {
|
|
@@ -296,6 +300,7 @@ ${usage}
|
|
|
296
300
|
|
|
297
301
|
Nyelvválasztás & Beállítás:
|
|
298
302
|
-L, --lang <kód> Kimenet nyelve: en, hu, fr (alapértelmezett: en vagy CRUCIX_LANG)
|
|
303
|
+
-v, -V, --version, version A Crucix verziója (${packageVersion()})
|
|
299
304
|
setup, init, --setup Interaktív beállító varázsló (.env, Telegram, Discord, AI, API kulcsok) (--web / --cli)
|
|
300
305
|
install Felhasználói profil (~/.crucix: .env és runs/) létrehozása, majd a varázsló (--no-setup nélküle)
|
|
301
306
|
|
|
@@ -406,6 +411,7 @@ ${usage}
|
|
|
406
411
|
|
|
407
412
|
Language & Setup:
|
|
408
413
|
-L, --lang <code> Output language: en, hu, fr (default: en or CRUCIX_LANG)
|
|
414
|
+
-v, -V, --version, version Print the Crucix version (${packageVersion()})
|
|
409
415
|
setup, init, --setup Interactive setup wizard (.env, Telegram, Discord, AI, API keys) (--web / --cli)
|
|
410
416
|
install Create the user profile (~/.crucix: .env and runs/), then run the wizard (--no-setup skips it)
|
|
411
417
|
|
|
@@ -1489,6 +1495,11 @@ async function main() {
|
|
|
1489
1495
|
const lang = getCliLanguage(opts);
|
|
1490
1496
|
opts.lang = lang;
|
|
1491
1497
|
|
|
1498
|
+
if (opts.version) {
|
|
1499
|
+
console.log(versionLine());
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1492
1503
|
if (opts.help) {
|
|
1493
1504
|
printHelp(lang);
|
|
1494
1505
|
return;
|
|
@@ -2148,6 +2159,8 @@ export {
|
|
|
2148
2159
|
isExecutable,
|
|
2149
2160
|
getCliCmd,
|
|
2150
2161
|
printHelp,
|
|
2162
|
+
packageVersion,
|
|
2163
|
+
versionLine,
|
|
2151
2164
|
formatAge,
|
|
2152
2165
|
formatNumber,
|
|
2153
2166
|
formatPct,
|