@keystrokehq/cli 0.1.139 → 0.1.141

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
@@ -73,24 +73,33 @@ EOF
73
73
 
74
74
  ### `auth`
75
75
 
76
- Authenticate with Keystroke via Better Auth device flow. Config lives in `~/.keystroke`; bearer tokens live in the OS keychain.
76
+ Authenticate with Keystroke via Better Auth device flow. Non-secret config lives in `~/.keystroke`. Session bearer tokens default to the OS keychain:
77
+
78
+ - **macOS** — Apple's `/usr/bin/security` (stable system identity; avoids Node-path Keychain ACL prompts)
79
+ - **Windows / Linux** — `@napi-rs/keyring` (Credential Manager / Secret Service)
77
80
 
78
81
  ```bash
79
82
  keystroke auth login
80
83
  keystroke auth login --web-url http://localhost:3000
81
84
  keystroke auth login --web-url https://keystroke.ai --platform-url https://api.keystroke.ai
85
+ keystroke auth login --credential-storage file
82
86
  keystroke auth status
83
87
  keystroke auth logout
84
88
  ```
85
89
 
86
- | Setting | Default | Purpose |
87
- | ------------- | -------------------------- | ---------------------------------------------------------------- |
88
- | `webUrl` | `https://keystroke.ai` | Web dashboard; device login and session checks |
89
- | `platformUrl` | `https://api.keystroke.ai` | Platform API (direct; used by CLI platform commands) |
90
+ | Setting | Default | Purpose |
91
+ | -------------------- | -------------------------- | ---------------------------------------------------------------- |
92
+ | `webUrl` | `https://keystroke.ai` | Web dashboard; device login and session checks |
93
+ | `platformUrl` | `https://api.keystroke.ai` | Platform API (direct; used by CLI platform commands) |
94
+ | `credentialStorage` | `keychain` | `keychain` (OS secure storage) or `file` (`~/.keystroke/credentials.json`, mode `0600`) |
95
+
96
+ `auth login` persists `webUrl`, `platformUrl`, and `credentialStorage` only after the token is stored successfully. There is **no silent fallback** from keychain to file — if the keychain is unavailable, set `KEYSTROKE_API_KEY` or pass `--credential-storage file` explicitly. File storage is owner-readable on disk (not encrypted); prefer keychain when available.
97
+
98
+ On macOS, tokens previously stored under the Node-bound `keystroke` Keychain service are migrated once into the `keystroke-cli` service used by `/usr/bin/security`.
90
99
 
91
- `auth login` persists both `webUrl` and `platformUrl`. Omit `--web-url` to always reset to production defaults (`https://keystroke.ai` / `https://api.keystroke.ai`), even if a previous login pointed at localhost. Local dev: `--web-url http://localhost:3000` (platform URL resolves to `http://localhost:3002`).
100
+ Omit `--web-url` to always reset to production defaults (`https://keystroke.ai` / `https://api.keystroke.ai`), even if a previous login pointed at localhost. Local dev: `--web-url http://localhost:3000` (platform URL resolves to `http://localhost:3002`).
92
101
 
93
- Existing commands do not require auth yet. Use `resolveCliAuth()` when adding protected commands.
102
+ Use `resolveCliAuth()` when adding protected commands.
94
103
 
95
104
  ### Platform commands
96
105
 
@@ -251,7 +260,7 @@ Custom output directory: `node apps/cli/scripts/pack.mjs /path/to/install`.
251
260
  | [`conf`](https://github.com/sindresorhus/conf) | Persistent non-secret config (profiles, defaults, project prefs). MIT. |
252
261
  | [`@napi-rs/keyring`](https://github.com/Brooooooklyn/keyring-node) | API tokens and other secrets via the OS keychain. MIT. |
253
262
 
254
- `conf` stores `webUrl`, `platformUrl`, and other non-secrets under `~/.keystroke`. `@napi-rs/keyring` stores bearer tokens — macOS Keychain, Windows Credential Manager, or Secret Service on Linux so tokens never sit in a plaintext config file.
263
+ `conf` stores `webUrl`, `platformUrl`, `credentialStorage`, and other non-secrets under `~/.keystroke`. Session tokens default to the OS keychain on macOS via `/usr/bin/security` (service `keystroke-cli`), elsewhere via `@napi-rs/keyring`. Pass `--credential-storage file` to store tokens in `~/.keystroke/credentials.json` (`0600`) instead; the CLI never silently falls back from keychain to file.
255
264
 
256
265
  ## Development
257
266