@inference-gateway/cli 0.203.0 → 0.204.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.
Files changed (2) hide show
  1. package/README.md +59 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -485,6 +485,59 @@ infer conversations list # Find the session ID
485
485
  infer export <session-id> # Writes ~/.infer/projects/<slug>/exports/chat_export_<timestamp>.md
486
486
  ```
487
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
+
488
541
  **`infer version`** - Display CLI version information
489
542
 
490
543
  ```bash
@@ -916,12 +969,14 @@ actions.
916
969
 
917
970
  - `/new [title]` - Start a new conversation (optionally titled)
918
971
  - `/clear` - Save the current conversation and start a new one
919
- - `/insights [since]` - Analyze past sessions for repeatable workflows worth a skill and recurring tool failures; saves a report to `~/.infer/insights/`
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.
920
974
  - `/reset [insights|confirm]` - Wipe the local runtime state (conversations, plans, scratch, artifacts, history, backups, exports, logs) of
921
- **every project on this machine** and start a fresh session.
922
- `/reset insights` analyzes the sessions first and previews the wipe.
923
- `/reset confirm` performs it, but only after a preview in the same session - a cold `/reset confirm` previews instead of deleting.
975
+ **every project on this machine**.
976
+ `/reset` previews and deletes nothing, `/reset insights` analyzes the sessions first, `/reset confirm` performs the wipe.
924
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.
925
980
  - `/compact` - Save the conversation and start a new session seeded with a summary
926
981
  - `/conversations` - Open the conversation selection dropdown
927
982
  - `/context` - Show context-window usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inference-gateway/cli",
3
- "version": "0.203.0",
3
+ "version": "0.204.1",
4
4
  "description": "A Git-first CLI coding agent that turns ideas, issues, and tasks into real code changes.",
5
5
  "bin": {
6
6
  "infer": "bin/run.js"