@kryvenaiofficial/kryven 0.2.2 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kryvenaiofficial/kryven",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Kryven Agent CLI — terminal AI coding assistant powered by the Kryven platform.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "files": [
10
10
  "dist/cli.mjs",
11
+ "scripts/postinstall.cjs",
11
12
  "README.md",
12
13
  "LICENSE"
13
14
  ],
@@ -21,6 +22,7 @@
21
22
  "typecheck": "tsc --noEmit",
22
23
  "smoke:offline": "tsx scripts/smoke-offline.ts",
23
24
  "smoke:online": "tsx scripts/smoke-online.ts",
25
+ "postinstall": "node scripts/postinstall.cjs",
24
26
  "prepublishOnly": "npm run build && npm run smoke:offline"
25
27
  },
26
28
  "dependencies": {
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * Post-install banner for the Kryven CLI.
4
+ *
5
+ * Shown only after a GLOBAL install (`npm install -g @kryvenaiofficial/kryven`)
6
+ * — the case the kryven.cc/agent install command uses. Scoped to global so the
7
+ * banner never spams users who pull the package in as a dependency or in CI.
8
+ *
9
+ * Bulletproof by design: any failure is swallowed and the process still exits 0
10
+ * so a cosmetic banner can never break `npm install`.
11
+ */
12
+ 'use strict';
13
+
14
+ try {
15
+ // npm sets npm_config_global=true for `-g` installs. yarn/pnpm globals also
16
+ // set it. If it's anything else (local dep install, CI), stay silent.
17
+ const isGlobal = String(process.env.npm_config_global || '').toLowerCase() === 'true';
18
+ // Allow forcing the banner for manual testing.
19
+ const forced = process.env.KRYVEN_FORCE_POSTINSTALL === '1';
20
+ if (!isGlobal && !forced) return;
21
+
22
+ // Only colorize when attached to a TTY that isn't explicitly NO_COLOR.
23
+ const useColor = process.stdout.isTTY && !process.env.NO_COLOR;
24
+ const wrap = (code, s) => (useColor ? `\x1b[${code}m${s}\x1b[0m` : s);
25
+ const purple = (s) => wrap('38;5;141', s);
26
+ const bold = (s) => wrap('1', s);
27
+ const dim = (s) => wrap('2', s);
28
+ const green = (s) => wrap('32', s);
29
+
30
+ const out = [
31
+ '',
32
+ ' ' + purple('────────────────────────────────────────────'),
33
+ ' ' + green('✓') + ' ' + bold('Kryven CLI installed.'),
34
+ '',
35
+ ' Run ' + bold(purple('kryven')) + ' in your terminal to enable the CLI.',
36
+ ' ' + purple('────────────────────────────────────────────'),
37
+ '',
38
+ ' ' + bold('kryven') + ' ' + dim('start chatting + coding (3 free prompts)'),
39
+ ' ' + bold('kryven login') + ' ' + dim('save your API key (kry_sk_…)'),
40
+ ' ' + bold('kryven --help') + ' ' + dim('all commands'),
41
+ '',
42
+ ' ' + dim('Docs: https://kryven.cc/docs/cli'),
43
+ '',
44
+ ];
45
+ process.stdout.write(out.join('\n') + '\n');
46
+ } catch {
47
+ /* never fail an install over a banner */
48
+ }