@darwin.finance/cli 1.1.1 → 1.2.1

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
@@ -11,8 +11,24 @@ Chat apps like Claude or ChatGPT don't use the CLI — they connect to Darwin di
11
11
 
12
12
  ```sh
13
13
  npm i -g @darwin.finance/cli
14
+ darwin setup
14
15
  ```
15
16
 
17
+ `darwin setup` (run once) installs a **verified** copy of the CLI in a private folder
18
+ (`~/.local/share/darwin`, or `%LOCALAPPDATA%\darwin` on Windows) and prints the path to run it by —
19
+ usually `~/.local/share/darwin/bin/darwin`. Use that path from then on:
20
+
21
+ ```sh
22
+ ~/.local/share/darwin/bin/darwin login
23
+ ~/.local/share/darwin/bin/darwin balances
24
+ ```
25
+
26
+ Saved keys are only used through that path. A plain `darwin` is found through `PATH`, which a project
27
+ you are working in can change; the launcher runs the verified copy with an absolute Node and clears
28
+ the environment variables (`NODE_OPTIONS`, `LD_PRELOAD`, …) that would load other code into it.
29
+ To update: `~/.local/share/darwin/bin/darwin setup --latest` — the copy you already trust checks the
30
+ new version before installing it. (`DARWIN_API_KEY` needs no setup: you hand that key to one process.)
31
+
16
32
  ## Install from source (for testing)
17
33
 
18
34
  Requires Node.js 20+ and [Bun](https://bun.sh) to build.
@@ -70,7 +86,8 @@ never sends anything. `darwin cancel <id>` makes sure an order that hasn't start
70
86
 
71
87
  `darwin mcp` runs the same commands as a local MCP server for desktop AI clients (writes go through
72
88
  the same check-then-send; `check_prepared` is the read-only recovery tool, `cancel_prepared` the cancel);
73
- `darwin mcp --print-config claude|cursor|gemini` prints the registration.
89
+ `<launcher> mcp --print-config claude|cursor|gemini` prints the registration (it runs the launcher;
90
+ re-run it after upgrading from 1.1.x, whose registrations pointed at the npm copy).
74
91
 
75
92
  ## Security model
76
93
 
@@ -93,8 +110,21 @@ the same check-then-send; `check_prepared` is the read-only recovery tool, `canc
93
110
  - **Server text is data.** Text a third party can influence (a token's name, a venue's message) is
94
111
  stripped of terminal escapes, control and bidi characters before it reaches a terminal. In JSON
95
112
  output it stays wrapped `{"untrusted": "…"}`, so an AI reading it knows not to act on it.
113
+ - **Only a verified copy holds the key.** `darwin setup` installs a version only after checking its
114
+ npm provenance: a Sigstore signature, logged in the public transparency log, from GitHub Actions
115
+ running `DarwinFinance/darwin-cli`'s `release.yml` at that version's tag, naming the exact sha512 of
116
+ the package — which setup then checks against the download. Its one dependency (the keyring addon)
117
+ is installed from the package's own `npm-shrinkwrap.json`, each download checked against its sha512.
118
+ Everything comes from `registry.npmjs.org` directly; a project's `.npmrc` is never read. A version
119
+ published any other way is refused, so a stolen npm token can't push code into an installed CLI.
120
+ The OS secret store and `--store file` are only used by that copy, started through its launcher.
121
+ - **The boundary.** The first `npm i -g` and `darwin setup` are trusted, as installing any package is:
122
+ if npm itself handed you a substitute, setup can't catch it. After that, a `darwin` or `node` put
123
+ first on `PATH`, `NODE_OPTIONS`, a project's own copy, or an unofficial release no longer reach the key.
124
+ Code that already runs as your user (or can set `LD_PRELOAD` for the programs you start) is beyond
125
+ what any CLI can stop.
96
126
  - What a secret store does *not* do: it can't stop malware running as your own user. On macOS the
97
- keychain item trusts the `node` binary for an npm install.
127
+ keychain item trusts the `node` binary, so other Node programs you run could read it too.
98
128
 
99
129
  ## Exit codes
100
130