@av-pi-studio/cli 0.0.70 → 0.0.72

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
@@ -21,6 +21,9 @@ npx @av-pi-studio/cli [options] [command] [args]
21
21
  ## Quick start
22
22
 
23
23
  ```bash
24
+ # log in to a model provider (the `pi` provider needs one before it can run a turn)
25
+ pi-studio auth login
26
+
24
27
  # start a local daemon (if one isn't already running) and print a pairing QR code
25
28
  pi-studio daemon start
26
29
 
@@ -42,13 +45,14 @@ Run `pi-studio --help` (or `<command> --help`) for the full command tree.
42
45
 
43
46
  ## Global options
44
47
 
45
- | Flag | Description |
46
- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
47
- | `-H, --host <host>` | Daemon target — bare `host:port`, or a URL with a `ws://`/`wss://` or `http://`/`https://` scheme (e.g. `workstation.local:6767`, `https://box.local:6767`) |
48
- | `--password <password>` | Password for a password-protected daemon |
49
- | `--home <dir>` | Override `$PI_STUDIO_HOME` (used for the client-id store) |
50
- | `--json` | Render command output as JSON instead of a table |
51
- | `-v, --version` | Print the installed CLI version and exit |
48
+ | Flag | Description |
49
+ | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
50
+ | `-H, --host <host>` | Daemon target — bare `host:port`, or a URL with a `ws://`/`wss://` or `http://`/`https://` scheme (e.g. `workstation.local:6767`, `https://box.local:6767`) |
51
+ | `--password <password>` | Password for a password-protected daemon |
52
+ | `--home <dir>` | Override `$PI_STUDIO_HOME` (used for the client-id store) |
53
+ | `--pi-home <dir>` | Override `$PI_STUDIO_PI_HOME` — the bundled Pi CLI's own `.pi` config dir. Selects the `auth.json` the `auth` group reads/writes, and is forwarded to a locally-spawned daemon and to `pi-studio pi`. Must precede the subcommand |
54
+ | `--json` | Render command output as JSON instead of a table |
55
+ | `-v, --version` | Print the installed CLI version and exit |
52
56
 
53
57
  **Connection resolution**: `--host host:port` → `ws://host:port`; a `ws://`/`wss://` URL is used
54
58
  as-is; `http://`/`https://` are accepted for familiarity and mapped to `ws://`/`wss://` (the daemon
@@ -83,6 +87,31 @@ no `--host`, the CLI targets `ws://127.0.0.1:6767`.
83
87
  Provider spec parsing (`--provider`): `pi/claude-3-5-sonnet` → provider `pi`, model
84
88
  `claude-3-5-sonnet`; bare `pi` → provider only; `mock` → the credential-free mock provider.
85
89
 
90
+ ### `auth`
91
+
92
+ | Command | Description |
93
+ | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
94
+ | `auth login [provider] [--type api_key\|oauth] [--api-key <key>]` | Log in to a model provider. With no arguments, pick one interactively; `--api-key` is the headless path |
95
+ | `auth status [--json]` | Show which providers are configured, how (api key / oauth), and from where (stored credential vs. an ambient env var) |
96
+ | `auth logout <provider>` | Remove a stored credential. Idempotent, and tells you when an ambient env var still configures the provider |
97
+
98
+ The `pi` provider needs a model-provider credential before it can run a turn. This is the
99
+ supported way to supply one — no hand-editing Pi's `auth.json`, no hunting for `/login` inside
100
+ `pi-studio pi`'s interactive TUI:
101
+
102
+ ```bash
103
+ pi-studio auth login # interactive: filter the provider list, pick, enter key
104
+ pi-studio auth login openai --api-key sk-... # headless — for scripts, CI, Dockerfiles
105
+ pi-studio auth status
106
+ ```
107
+
108
+ **Local and daemon-free** — unlike every other group here, `auth` never opens a WebSocket. It
109
+ writes Pi's own credential store at `<piHome>/agent/auth.json` (see `--pi-home`), which is the
110
+ exact file the daemon's spawned agents read, so a credential you add here is picked up on the next
111
+ agent spawn with no daemon restart. Interactive prompts need a TTY; use `--api-key` with an
112
+ explicit provider for non-interactive setups. Secrets are never echoed, and the store is written
113
+ `0600`.
114
+
86
115
  ### `daemon`
87
116
 
88
117
  | Command | Description |
@@ -194,5 +223,7 @@ npx vitest run packages/cli
194
223
  ```
195
224
 
196
225
  Tests cover command parsing, provider-spec parsing, stream-event formatting, the daemon-control
197
- state machine, output rendering, and pairing-URL construction — all against an injected
198
- `CliContext` (stub output sink + mock `DaemonRuntime`), never a real spawned daemon.
226
+ state machine, output rendering, pairing-URL construction, and the `auth` group (path resolution,
227
+ prompt/notify rendering, login/status/logout orchestration) — all against an injected `CliContext`
228
+ (stub output sink + mock `DaemonRuntime`, fake `AuthRuntime` and terminal I/O), never a real
229
+ spawned daemon and never a real credential store.