@inference-gateway/cli 0.202.2 → 0.204.0
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 +69 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -297,19 +297,17 @@ DEEPSEEK_API_KEY=your_key_here
|
|
|
297
297
|
```
|
|
298
298
|
|
|
299
299
|
Provider keys resolve in this order, first hit wins: the system environment, the
|
|
300
|
-
project `.env`, then the userspace fallback `~/.infer/auth.
|
|
300
|
+
project `.env`, then the userspace fallback `~/.infer/auth.yaml` - a flat YAML
|
|
301
301
|
map of provider key env vars, so you can keep keys in one place across all
|
|
302
302
|
projects (or run `infer` outside any project):
|
|
303
303
|
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
"OPENAI_API_KEY": "sk-..."
|
|
308
|
-
}
|
|
304
|
+
```yaml
|
|
305
|
+
ANTHROPIC_API_KEY: sk-ant-...
|
|
306
|
+
OPENAI_API_KEY: sk-...
|
|
309
307
|
```
|
|
310
308
|
|
|
311
|
-
A missing `auth.
|
|
312
|
-
logged warning. Keep the file private (`chmod 600 ~/.infer/auth.
|
|
309
|
+
A missing `auth.yaml` changes nothing, and a malformed one is ignored with a
|
|
310
|
+
logged warning. Keep the file private (`chmod 600 ~/.infer/auth.yaml`).
|
|
313
311
|
|
|
314
312
|
3. **Start chatting**:
|
|
315
313
|
|
|
@@ -487,6 +485,59 @@ infer conversations list # Find the session ID
|
|
|
487
485
|
infer export <session-id> # Writes ~/.infer/projects/<slug>/exports/chat_export_<timestamp>.md
|
|
488
486
|
```
|
|
489
487
|
|
|
488
|
+
**`infer insights`** - Analyze past sessions for repeatable workflows and recurring tool failures
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
infer insights # Every saved session
|
|
492
|
+
infer insights 7d # Only the last 7 days (also 24h, 30d)
|
|
493
|
+
infer insights --model <id> # Pick the model; defaults to agent.model
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
Writes a markdown report to `~/.infer/insights/`. Needs conversation storage enabled.
|
|
497
|
+
|
|
498
|
+
Reads the conversation store, the telemetry directory, the log directory and the persistent
|
|
499
|
+
memory index (`MEMORY.md`, capped at `memory.max_chars`). `infer reset insights` runs the
|
|
500
|
+
analysis before the wipe, so the facts survive in the report even though the memory directory
|
|
501
|
+
does not.
|
|
502
|
+
|
|
503
|
+
The logs are the only source that sees a failure which never reached a saved session - a startup
|
|
504
|
+
crash, a gateway that never came up, a background job that died. They are deduplicated before the
|
|
505
|
+
model sees them: records at or above `logging.insights_min_level` (default `warn`) inside the
|
|
506
|
+
window are folded by normalized message, so lines differing only in a path, an id or a number
|
|
507
|
+
become one group with a count, a first/last timestamp and one verbatim sample. The report's
|
|
508
|
+
frontmatter states how many records were read (`log_records`) and how many groups survived
|
|
509
|
+
(`log_groups`). Only the structured `app-*.log` and `daemon-*.log` files and their `.gz` archives
|
|
510
|
+
are read; `gateway-*.log` is raw subprocess output with no level or timestamp to filter on, and
|
|
511
|
+
the gateway's own failures are logged through zap into `app-*.log` anyway.
|
|
512
|
+
|
|
513
|
+
The analysis runs on `agent.max_tokens` (default 8192) rather than a fixed budget — a
|
|
514
|
+
reasoning model spends that budget thinking before it answers, and too small a value fails
|
|
515
|
+
the run outright. The written analysis is capped at 200 lines / 16000 characters, so a
|
|
516
|
+
model that ignores the requested length cannot flood the report.
|
|
517
|
+
|
|
518
|
+
Each report records what it cost to produce in its own frontmatter
|
|
519
|
+
(`analysis_prompt_tokens`, `analysis_completion_tokens`, `analysis_total_tokens`, and
|
|
520
|
+
`analysis_reasoning_tokens` where the provider breaks it out), so the price of a run is
|
|
521
|
+
visible in the artifact rather than guessed at.
|
|
522
|
+
|
|
523
|
+
**`infer reset`** - Wipe all local runtime state and start fresh
|
|
524
|
+
|
|
525
|
+
```bash
|
|
526
|
+
infer reset # Preview every path that would be deleted; deletes nothing
|
|
527
|
+
infer reset confirm # Perform the wipe
|
|
528
|
+
infer reset insights # Analyze past sessions first, then preview (takes --model)
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
Clears the runtime directories of **every project on this machine**, the persistent memory directory
|
|
532
|
+
and the local conversation store. Per-project runtime directories are deleted rather than recreated
|
|
533
|
+
empty, and a project whose working directory no longer exists is removed entirely.
|
|
534
|
+
|
|
535
|
+
Config, custom shortcuts, skills and saved insights are preserved; remote stores (postgres, redis, d1)
|
|
536
|
+
are skipped, and a git-backed memory directory syncs back from its remote on the next run.
|
|
537
|
+
|
|
538
|
+
The `/reset` and `/insights` chat shortcuts are thin YAML wrappers over these commands, written to
|
|
539
|
+
`~/.infer/shortcuts/` by `infer init` - edit them like any other shortcut.
|
|
540
|
+
|
|
490
541
|
**`infer version`** - Display CLI version information
|
|
491
542
|
|
|
492
543
|
```bash
|
|
@@ -918,6 +969,14 @@ actions.
|
|
|
918
969
|
|
|
919
970
|
- `/new [title]` - Start a new conversation (optionally titled)
|
|
920
971
|
- `/clear` - Save the current conversation and start a new one
|
|
972
|
+
- `/insights [24h|7d|30d]` - Analyze past sessions for repeatable workflows worth a skill and recurring tool failures; saves a report to `~/.infer/insights/`.
|
|
973
|
+
Vendored as `~/.infer/shortcuts/insights.yaml`, wrapping `infer insights` - edit it to pin a model or change the windows.
|
|
974
|
+
- `/reset [insights|confirm]` - Wipe the local runtime state (conversations, plans, scratch, artifacts, history, backups, exports, logs) of
|
|
975
|
+
**every project on this machine**.
|
|
976
|
+
`/reset` previews and deletes nothing, `/reset insights` analyzes the sessions first, `/reset confirm` performs the wipe.
|
|
977
|
+
Config and saved insights are preserved, remote stores are skipped.
|
|
978
|
+
Vendored as `~/.infer/shortcuts/reset.yaml`, wrapping `infer reset` - edit or delete it like any other shortcut.
|
|
979
|
+
A chat session running during the wipe keeps the conversation it already has in memory; run `/new` or restart to be fully fresh.
|
|
921
980
|
- `/compact` - Save the conversation and start a new session seeded with a summary
|
|
922
981
|
- `/conversations` - Open the conversation selection dropdown
|
|
923
982
|
- `/context` - Show context-window usage
|
|
@@ -956,7 +1015,6 @@ actions.
|
|
|
956
1015
|
|
|
957
1016
|
- `/scm issues` - List GitHub issues
|
|
958
1017
|
- `/scm issue <number>` - Show issue details
|
|
959
|
-
- `/scm pr-create [context]` - Generate AI-powered PR plan
|
|
960
1018
|
|
|
961
1019
|
**Other Shortcuts** (created by `infer init`):
|
|
962
1020
|
|
|
@@ -1409,8 +1467,8 @@ infer chat
|
|
|
1409
1467
|
# - Make changes
|
|
1410
1468
|
# - Run tests
|
|
1411
1469
|
|
|
1412
|
-
#
|
|
1413
|
-
|
|
1470
|
+
# Ask the agent to open the PR when ready
|
|
1471
|
+
> Create a pull request for these changes - it fixes the authentication timeout issue
|
|
1414
1472
|
```
|
|
1415
1473
|
|
|
1416
1474
|
### Configuration Example
|