@nodetool-ai/cli-local 0.8.14 → 0.8.16
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 +25 -0
- package/dist/.nodetool-build-stamp +1 -1
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @nodetool-ai/cli-local
|
|
2
|
+
|
|
3
|
+
Local single-user database and secret access for commands that run in process
|
|
4
|
+
instead of against a running server. The package root exports nothing. Import
|
|
5
|
+
the modules by subpath.
|
|
6
|
+
|
|
7
|
+
| Module | Export | Behavior |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `local-db` | `LOCAL_USER_ID` | The local user id, `"1"`. |
|
|
10
|
+
| `local-db` | `setupLocalDb()` | Opens the local SQLite database, applies migrations, and tries to unlock the secret store. If the store cannot be unlocked it warns on stderr and still resolves, so commands that need no secret keep working. Idempotent. |
|
|
11
|
+
| `local-secrets` | `resolveLocalSecret(key)` | Looks the key up in the encrypted store for the local user, then in `process.env`. |
|
|
12
|
+
|
|
13
|
+
Use `resolveLocalSecret` rather than a bare `getSecret(key)`. Without a user id,
|
|
14
|
+
`getSecret` reads `process.env` only, so a key saved with `nodetool secrets store`
|
|
15
|
+
is invisible and the provider answers 401.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { setupLocalDb } from "@nodetool-ai/cli-local/local-db";
|
|
19
|
+
import { resolveLocalSecret } from "@nodetool-ai/cli-local/local-secrets";
|
|
20
|
+
|
|
21
|
+
await setupLocalDb();
|
|
22
|
+
const key = await resolveLocalSecret("OPENAI_API_KEY");
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Depends on `@nodetool-ai/cli-common`, `config`, `models` and `security`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
2026-11-
|
|
1
|
+
2026-11-26T14:09:11.667Z
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodetool-ai/cli-local",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.16",
|
|
4
4
|
"description": "Shared NodeTool local host helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"lint": "node ../../scripts/run-tsc.mjs --noEmit"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nodetool-ai/cli-common": "0.8.
|
|
32
|
-
"@nodetool-ai/config": "0.8.
|
|
33
|
-
"@nodetool-ai/models": "0.8.
|
|
34
|
-
"@nodetool-ai/security": "0.8.
|
|
31
|
+
"@nodetool-ai/cli-common": "0.8.16",
|
|
32
|
+
"@nodetool-ai/config": "0.8.16",
|
|
33
|
+
"@nodetool-ai/models": "0.8.16",
|
|
34
|
+
"@nodetool-ai/security": "0.8.16"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^22.0.0",
|