@code-insights/cli 3.2.0 → 3.3.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 (79) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +10 -6
  3. package/dashboard-dist/assets/index-Rr1JlICa.js +552 -0
  4. package/dashboard-dist/favicon.svg +17 -3
  5. package/dashboard-dist/index.html +1 -1
  6. package/dist/commands/config.js +2 -2
  7. package/dist/commands/config.js.map +1 -1
  8. package/dist/commands/dashboard.d.ts.map +1 -1
  9. package/dist/commands/dashboard.js +10 -2
  10. package/dist/commands/dashboard.js.map +1 -1
  11. package/dist/commands/init.d.ts.map +1 -1
  12. package/dist/commands/init.js +5 -2
  13. package/dist/commands/init.js.map +1 -1
  14. package/dist/commands/install-hook.d.ts.map +1 -1
  15. package/dist/commands/install-hook.js +48 -40
  16. package/dist/commands/install-hook.js.map +1 -1
  17. package/dist/commands/open.js +2 -2
  18. package/dist/commands/open.js.map +1 -1
  19. package/dist/commands/reset.d.ts.map +1 -1
  20. package/dist/commands/reset.js +5 -2
  21. package/dist/commands/reset.js.map +1 -1
  22. package/dist/commands/stats/actions/cost.d.ts.map +1 -1
  23. package/dist/commands/stats/actions/cost.js +6 -3
  24. package/dist/commands/stats/actions/cost.js.map +1 -1
  25. package/dist/commands/stats/actions/models.d.ts.map +1 -1
  26. package/dist/commands/stats/actions/models.js +6 -3
  27. package/dist/commands/stats/actions/models.js.map +1 -1
  28. package/dist/commands/stats/actions/overview.d.ts.map +1 -1
  29. package/dist/commands/stats/actions/overview.js +6 -3
  30. package/dist/commands/stats/actions/overview.js.map +1 -1
  31. package/dist/commands/stats/actions/projects.d.ts.map +1 -1
  32. package/dist/commands/stats/actions/projects.js +6 -3
  33. package/dist/commands/stats/actions/projects.js.map +1 -1
  34. package/dist/commands/stats/actions/today.d.ts.map +1 -1
  35. package/dist/commands/stats/actions/today.js +6 -3
  36. package/dist/commands/stats/actions/today.js.map +1 -1
  37. package/dist/commands/status.d.ts.map +1 -1
  38. package/dist/commands/status.js +66 -58
  39. package/dist/commands/status.js.map +1 -1
  40. package/dist/commands/sync.d.ts +1 -0
  41. package/dist/commands/sync.d.ts.map +1 -1
  42. package/dist/commands/sync.js +37 -4
  43. package/dist/commands/sync.js.map +1 -1
  44. package/dist/commands/telemetry.d.ts.map +1 -1
  45. package/dist/commands/telemetry.js +10 -14
  46. package/dist/commands/telemetry.js.map +1 -1
  47. package/dist/utils/banner.d.ts +6 -0
  48. package/dist/utils/banner.d.ts.map +1 -0
  49. package/dist/utils/banner.js +30 -0
  50. package/dist/utils/banner.js.map +1 -0
  51. package/dist/utils/telemetry.d.ts +52 -31
  52. package/dist/utils/telemetry.d.ts.map +1 -1
  53. package/dist/utils/telemetry.js +179 -187
  54. package/dist/utils/telemetry.js.map +1 -1
  55. package/dist/utils/welcome.d.ts.map +1 -1
  56. package/dist/utils/welcome.js +2 -3
  57. package/dist/utils/welcome.js.map +1 -1
  58. package/package.json +3 -2
  59. package/server-dist/index.d.ts.map +1 -1
  60. package/server-dist/index.js +13 -6
  61. package/server-dist/index.js.map +1 -1
  62. package/server-dist/llm/analysis.d.ts +4 -1
  63. package/server-dist/llm/analysis.d.ts.map +1 -1
  64. package/server-dist/llm/analysis.js +23 -8
  65. package/server-dist/llm/analysis.js.map +1 -1
  66. package/server-dist/llm/prompts.d.ts +14 -2
  67. package/server-dist/llm/prompts.d.ts.map +1 -1
  68. package/server-dist/llm/prompts.js +60 -36
  69. package/server-dist/llm/prompts.js.map +1 -1
  70. package/server-dist/routes/analysis.d.ts.map +1 -1
  71. package/server-dist/routes/analysis.js +135 -24
  72. package/server-dist/routes/analysis.js.map +1 -1
  73. package/server-dist/routes/export.js +1 -1
  74. package/server-dist/routes/export.js.map +1 -1
  75. package/server-dist/routes/telemetry.d.ts +4 -0
  76. package/server-dist/routes/telemetry.d.ts.map +1 -0
  77. package/server-dist/routes/telemetry.js +21 -0
  78. package/server-dist/routes/telemetry.js.map +1 -0
  79. package/dashboard-dist/assets/index-DzBnL32c.js +0 -549
package/CHANGELOG.md CHANGED
@@ -2,6 +2,50 @@
2
2
 
3
3
  All notable changes to `@code-insights/cli` will be documented in this file.
4
4
 
5
+ ## [3.3.1] - 2026-03-02
6
+
7
+ ### Added
8
+
9
+ - **Error telemetry with PostHog `captureException`** — All CLI commands (sync, dashboard, init, status, reset, install-hook) and server analysis routes now capture exceptions with classified error types and enriched context via `captureError()`.
10
+ - **Structured parse errors** — Server analysis routes use `ParseResult<T>` type for structured LLM response parsing with error classification (`error_type`, `response_length`).
11
+ - **CLI ASCII art banner** — Branded ASCII banner displayed on `code-insights init` welcome message and `code-insights dashboard` launch.
12
+ - **Logo integration** — Monochrome logo component added to dashboard header and mobile nav. Favicon replaced with branded logo. Logo assets added to READMEs.
13
+ - **CI gate** — GitHub Actions workflow for automated build + test on push/PR to master.
14
+ - **Test coverage expansion** — New tests for `config.ts` utilities and `config.test.ts` server route. Existing `read-write.test.ts` and `prompts.test.ts` tests enhanced.
15
+
16
+ ### Fixed
17
+
18
+ - **Server chunked analysis** — Guard against all chunks failing in chunked analysis path, preventing unhandled errors.
19
+
20
+ ## [3.3.0] - 2026-03-02
21
+
22
+ ### Changed
23
+
24
+ - **Telemetry migrated from Supabase to PostHog** — Replaces the custom Supabase Edge Function with PostHog for product analytics. Provides retention charts, feature funnels, and a real analytics dashboard instead of raw event storage.
25
+ - **Stable machine identity** — Machine IDs no longer rotate monthly, enabling accurate unique user counts and retention analysis. IDs remain anonymous (SHA-256 hash, no PII).
26
+ - **Expanded event schema** — All CLI commands now include `duration_ms` for performance tracking. Sync events include exact session counts and per-provider breakdowns. Analysis events capture LLM provider and model.
27
+ - **Dashboard telemetry** — Page views and load timing tracked via `posthog-js` (client-side). Configured with `autocapture: false`, `persistence: 'memory'`, `ip: false` for privacy.
28
+ - **`trackEvent` signature change** — Now accepts `(event: TelemetryEventName, properties?)` instead of `(command, success, subcommand?)`. Typed event names for autocomplete and typo prevention.
29
+
30
+ ### Added
31
+
32
+ - **`GET /api/telemetry/identity`** — New server endpoint returns shared `distinct_id` for dashboard SPA initialization.
33
+ - **`shutdownTelemetry()`** — Graceful PostHog flush on server shutdown with 3-second timeout guard.
34
+ - **`posthog-node`** dependency in CLI (~20KB, lazy-initialized)
35
+ - **`posthog-js`** dependency in dashboard (~45KB, memory-only persistence)
36
+ - **Analysis failure tracking** — `analysis_run` events now fire on both success and failure for observability.
37
+
38
+ ### Removed
39
+
40
+ - Supabase Edge Function endpoint, HMAC signing key, and `signPayload()`
41
+ - Monthly-rotating machine ID (`getMachineId()` with date salt)
42
+ - `getSessionCountBucket()` — replaced by exact `total_sessions` person property
43
+ - `getDataSource()` — always 'local', provided no value
44
+
45
+ ### Fixed
46
+
47
+ - **`RecurringInsightResult.groups`** — Fixed type error using `.insights` instead of `.groups` for recurring insight count.
48
+
5
49
  ## [3.1.1] - 2026-03-02
6
50
 
7
51
  ### Fixed
package/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # Code Insights CLI
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/melagiri/code-insights/master/docs/assets/logo.svg" width="80" height="80" alt="Code Insights logo" />
3
+ </p>
4
+
5
+ <h1 align="center">Code Insights CLI</h1>
2
6
 
3
7
  Analyze AI coding sessions from the terminal. Parses session history from Claude Code, Cursor, Codex CLI, and Copilot CLI — stores everything in a local SQLite database — and serves a built-in browser dashboard.
4
8
 
@@ -55,12 +59,11 @@ Opens the built-in React dashboard at `http://localhost:7890`. The dashboard pro
55
59
  - **LLM Insights** — AI-generated summaries, decisions, learnings, and techniques
56
60
  - **Settings** — configure your LLM provider for analysis
57
61
 
58
- > **Screenshot:** _Coming soon_
59
-
60
- ### Custom Port
62
+ ### Options
61
63
 
62
64
  ```bash
63
- code-insights dashboard --port 8080
65
+ code-insights dashboard --port 8080 # Custom port
66
+ code-insights dashboard --no-open # Start server without opening browser
64
67
  ```
65
68
 
66
69
  ## CLI Commands
@@ -152,8 +155,9 @@ code-insights stats models
152
155
  # Show sync statistics (sessions, projects, last sync)
153
156
  code-insights status
154
157
 
155
- # Open the local dashboard in your browser (server must already be running)
158
+ # Open the local dashboard in your browser
156
159
  code-insights open
160
+ code-insights open --project # Open filtered to the current project
157
161
 
158
162
  # Delete all local data and reset sync state
159
163
  code-insights reset --confirm