starcite 0.0.3 → 0.0.5

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
@@ -33,32 +33,43 @@ bunx starcite --help
33
33
 
34
34
  ## Requirements
35
35
 
36
- - Your Starcite Cloud instance URL (`https://<your-instance>.starcite.io`)
37
- - Your Starcite API key
36
+ - Your Starcite API base URL (`https://<your-instance>.starcite.io`, or local/development URL)
37
+ - Your Starcite credentials:
38
+ - API key (recommended), or
39
+ - an existing session token for a single session flow
38
40
 
39
41
  For temporary usage, use `npx starcite` or `bunx starcite` instead of installing globally.
40
42
 
43
+ ## Auth and Resolution
44
+
45
+ The CLI resolves auth in this order:
46
+
47
+ 1. `--token`
48
+ 2. `STARCITE_API_KEY`
49
+ 3. `~/.starcite/credentials.json`
50
+ 4. `apiKey` in `~/.starcite/config.json` or `~/.starcite/config.toml`
51
+
52
+ How token handling is selected:
53
+
54
+ - `create` requires a service token with tenant context that can mint a session.
55
+ - `append` and `tail`:
56
+ - If the token is an API key with `auth:issue` scope, the CLI resolves via identity + session creation/binding.
57
+ - Otherwise, the token is treated as a session token and must match the target `sessionId`.
58
+ - If no `--token` is supplied, stored/ambient credentials are resolved from env/config.
59
+
41
60
  ## Quick Start
42
61
 
43
62
  ```bash
44
- starcite init --endpoint https://<your-instance>.starcite.io --api-key <YOUR_API_KEY> --yes
63
+ starcite config set endpoint https://<your-instance>.starcite.io
64
+ starcite config set api-key <YOUR_API_KEY>
45
65
  starcite create --id ses_demo --title "Draft contract"
46
66
  starcite sessions list --limit 5
47
67
  starcite append ses_demo --agent researcher --text "Found 8 relevant cases..."
48
- starcite append ses_demo --agent drafter --text "Drafted section 2 with clause references."
49
68
  starcite tail ses_demo --cursor 0 --limit 1
50
69
  ```
51
70
 
52
71
  ## Cloud Setup
53
72
 
54
- ```bash
55
- starcite init
56
- starcite config set endpoint https://<your-instance>.starcite.io
57
- starcite auth login
58
- ```
59
-
60
- Non-interactive alternative:
61
-
62
73
  ```bash
63
74
  starcite config set endpoint https://<your-instance>.starcite.io
64
75
  starcite config set api-key <YOUR_KEY>
@@ -67,7 +78,7 @@ starcite config set api-key <YOUR_KEY>
67
78
  ## Global Options
68
79
 
69
80
  - `-u, --base-url <url>`: Starcite API base URL (highest precedence)
70
- - `-k, --token <token>`: Starcite API key / service JWT (highest precedence)
81
+ - `-k, --token <key>`: Starcite API key or session token (highest precedence)
71
82
  - `--config-dir <path>`: Starcite CLI config directory (defaults to `~/.starcite`)
72
83
  - `--json`: machine-readable JSON output
73
84
  - `-v, --version`: show CLI version and exit
@@ -99,6 +110,7 @@ starcite version
99
110
  ### `create`
100
111
 
101
112
  Create a session.
113
+ Requires an API key-capable token context (typically with session minting capability).
102
114
 
103
115
  ```bash
104
116
  starcite create --id ses_demo --title "Draft contract" --metadata '{"tenant_id":"acme"}'
@@ -107,6 +119,7 @@ starcite create --id ses_demo --title "Draft contract" --metadata '{"tenant_id":
107
119
  ### `sessions list`
108
120
 
109
121
  List sessions from the API catalog.
122
+ Uses the resolved API credential context.
110
123
 
111
124
  ```bash
112
125
  starcite sessions list
@@ -121,22 +134,6 @@ Useful flags:
121
134
  - `--cursor <cursor>`: pagination cursor from previous result
122
135
  - `--metadata <json>`: flat JSON object of exact-match metadata filters
123
136
 
124
- ### `init`
125
-
126
- Initialize config for remote usage.
127
-
128
- Behavior:
129
-
130
- - writes endpoint to `~/.starcite/config.json`
131
- - optionally stores API key
132
- - supports interactive prompts when flags are omitted
133
-
134
- Useful flags:
135
-
136
- - `--endpoint <url>`: endpoint to store
137
- - `--api-key <key>`: API key to save
138
- - `-y, --yes`: skip prompts and use provided values only
139
-
140
137
  ### `config`
141
138
 
142
139
  Manage local configuration.
@@ -153,18 +150,6 @@ Key aliases accepted by `config set`:
153
150
  - producer id: `producer-id`, `producer_id`
154
151
  - API key: `api-key`, `api_key`
155
152
 
156
- ### `auth`
157
-
158
- Manage API key auth.
159
-
160
- ```bash
161
- starcite auth login
162
- starcite auth status
163
- starcite auth logout
164
- ```
165
-
166
- `auth login` supports `--api-key <key>` for non-interactive flows.
167
-
168
153
  ### `up`
169
154
 
170
155
  Start local Starcite containers through an interactive wizard (Docker required).
@@ -238,6 +223,8 @@ By default the CLI uses `~/.starcite`:
238
223
 
239
224
  Use `--config-dir <path>` to override the directory for testing or isolated runs.
240
225
 
226
+ Note: `credentials.json` contains the saved API key; `config.json`/`config.toml` may contain defaults, and environment/CLI values still take precedence.
227
+
241
228
  ### `tail <sessionId>`
242
229
 
243
230
  Replay and follow events over WebSocket.
@@ -248,3 +235,12 @@ starcite tail ses_demo --agent drafter --limit 5 --json
248
235
  ```
249
236
 
250
237
  Press `Ctrl+C` to stop.
238
+
239
+ Useful flags:
240
+
241
+ - `--cursor <cursor>`: replay cursor (inclusive)
242
+ - `--agent <agent>`: filter to one `agent:<name>`
243
+ - `--limit <count>`: stop after N emitted events
244
+ - `--no-follow`: stop after replay instead of following live events
245
+
246
+ By default, `tail` starts from cursor `0` and requests batched replay frames from the API for faster catch-up.