nvicode 0.1.6 → 0.1.9

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 CHANGED
@@ -1,4 +1,4 @@
1
- # Navicode - one click Nvidia NIM to Claude code connection
1
+ # NviCode - Introducing one click Nvidia/OpenRouter keys to Claude Code. Free Claude code.
2
2
 
3
3
  Run Claude Code through NVIDIA-hosted models or OpenRouter using a simple CLI wrapper.
4
4
  Use top open-source model APIs on NVIDIA Build for free, with `nvicode` paced to `40 RPM` by default.
@@ -17,15 +17,18 @@ Install the published package:
17
17
  npm install -g nvicode
18
18
  ```
19
19
 
20
- Set up provider, key, and model:
21
-
22
- - NVIDIA: get a free key from [NVIDIA Build API Keys](https://build.nvidia.com/settings/api-keys)
23
- - OpenRouter: use your OpenRouter API key
20
+ On interactive global installs, `nvicode` opens guided setup automatically.
21
+ If you skip it, run:
24
22
 
25
23
  ```sh
26
24
  nvicode select model
27
25
  ```
28
26
 
27
+ The setup flow asks for provider, API key, and model:
28
+
29
+ - NVIDIA: get a free key from [NVIDIA Build API Keys](https://build.nvidia.com/settings/api-keys)
30
+ - OpenRouter: use your OpenRouter API key
31
+
29
32
  Launch Claude Code through your selected provider:
30
33
 
31
34
  ```sh
@@ -0,0 +1,46 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import path from "node:path";
3
+ import process from "node:process";
4
+ import { fileURLToPath } from "node:url";
5
+ import { loadConfig } from "./config.js";
6
+ const isTruthy = (value) => value === "1" || value === "true" || value === "yes";
7
+ const isGlobalInstall = () => process.env.npm_config_global === "true" ||
8
+ process.env.npm_config_location === "global";
9
+ const isInteractive = () => Boolean(process.stdin.isTTY && process.stdout.isTTY);
10
+ const main = async () => {
11
+ if (isTruthy(process.env.NVICODE_SKIP_POSTINSTALL) || isTruthy(process.env.CI)) {
12
+ return;
13
+ }
14
+ if (!isGlobalInstall()) {
15
+ return;
16
+ }
17
+ if (!isInteractive()) {
18
+ console.log("nvicode installed. Run `nvicode select model` to finish setup.");
19
+ return;
20
+ }
21
+ const config = await loadConfig();
22
+ if (config.nvidiaApiKey || config.openrouterApiKey) {
23
+ console.log("nvicode is already configured. Run `nvicode select model` to change provider, key, or model.");
24
+ return;
25
+ }
26
+ console.log("");
27
+ console.log("nvicode installed. Starting guided setup.");
28
+ console.log("If you want to skip now, press Ctrl+C and run `nvicode select model` later.");
29
+ console.log("");
30
+ const cliPath = path.join(path.dirname(fileURLToPath(import.meta.url)), "cli.js");
31
+ const result = spawnSync(process.execPath, [cliPath, "select", "model"], {
32
+ stdio: "inherit",
33
+ env: {
34
+ ...process.env,
35
+ NVICODE_FROM_POSTINSTALL: "1",
36
+ },
37
+ });
38
+ if (result.error || result.status !== 0) {
39
+ console.log("");
40
+ console.log("nvicode setup was skipped or did not complete.");
41
+ console.log("Run `nvicode select model` any time to finish setup.");
42
+ }
43
+ };
44
+ void main().catch(() => {
45
+ console.log("nvicode installed. Run `nvicode select model` to finish setup.");
46
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nvicode",
3
- "version": "0.1.6",
4
- "description": "Run Claude Code through NVIDIA-hosted models or OpenRouter using a simple CLI wrapper.",
3
+ "version": "0.1.9",
4
+ "description": "NviCode - Introducing one click Nvidia/OpenRouter keys to Claude Code. Free Claude code.",
5
5
  "author": "Dinesh Potla",
6
6
  "keywords": [
7
7
  "claude-code",
@@ -19,6 +19,7 @@
19
19
  "scripts": {
20
20
  "build": "tsc -p tsconfig.json",
21
21
  "prepack": "npm run build",
22
+ "postinstall": "node dist/postinstall.js",
22
23
  "typecheck": "tsc --noEmit",
23
24
  "dev": "tsx src/cli.ts"
24
25
  },