@gurulu/cli 0.4.7 → 1.0.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 (190) hide show
  1. package/LICENSE +92 -0
  2. package/README.md +35 -106
  3. package/dist/bin.d.ts +3 -0
  4. package/dist/bin.d.ts.map +1 -0
  5. package/dist/bin.js +25751 -0
  6. package/dist/commands/auth.d.ts +23 -20
  7. package/dist/commands/auth.d.ts.map +1 -0
  8. package/dist/commands/doctor.d.ts +20 -6
  9. package/dist/commands/doctor.d.ts.map +1 -0
  10. package/dist/commands/init.d.ts +33 -11
  11. package/dist/commands/init.d.ts.map +1 -0
  12. package/dist/commands/pull.d.ts +13 -0
  13. package/dist/commands/pull.d.ts.map +1 -0
  14. package/dist/commands/push.d.ts +40 -0
  15. package/dist/commands/push.d.ts.map +1 -0
  16. package/dist/commands/validate.d.ts +36 -0
  17. package/dist/commands/validate.d.ts.map +1 -0
  18. package/dist/index.d.ts +4 -1
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +25326 -876
  21. package/dist/lib/api.d.ts +139 -0
  22. package/dist/lib/api.d.ts.map +1 -0
  23. package/dist/lib/codegen.d.ts +4 -0
  24. package/dist/lib/codegen.d.ts.map +1 -0
  25. package/dist/lib/config.d.ts +43 -0
  26. package/dist/lib/config.d.ts.map +1 -0
  27. package/dist/lib/detect.d.ts +27 -0
  28. package/dist/lib/detect.d.ts.map +1 -0
  29. package/dist/lib/detect.js +106 -0
  30. package/dist/lib/exec-install.d.ts +21 -0
  31. package/dist/lib/exec-install.d.ts.map +1 -0
  32. package/dist/lib/install-plan.d.ts +25 -0
  33. package/dist/lib/install-plan.d.ts.map +1 -0
  34. package/dist/lib/install-plan.js +161 -0
  35. package/package.json +51 -20
  36. package/bin/gurulu.js +0 -2
  37. package/dist/api-client.d.ts +0 -33
  38. package/dist/api-client.js +0 -175
  39. package/dist/commands/add-server.d.ts +0 -9
  40. package/dist/commands/add-server.js +0 -162
  41. package/dist/commands/alerts.d.ts +0 -27
  42. package/dist/commands/alerts.js +0 -309
  43. package/dist/commands/api-keys.d.ts +0 -20
  44. package/dist/commands/api-keys.js +0 -130
  45. package/dist/commands/attribution.d.ts +0 -22
  46. package/dist/commands/attribution.js +0 -111
  47. package/dist/commands/audiences.d.ts +0 -23
  48. package/dist/commands/audiences.js +0 -243
  49. package/dist/commands/audit.d.ts +0 -20
  50. package/dist/commands/audit.js +0 -130
  51. package/dist/commands/auth.js +0 -249
  52. package/dist/commands/chat.d.ts +0 -19
  53. package/dist/commands/chat.js +0 -118
  54. package/dist/commands/config.d.ts +0 -10
  55. package/dist/commands/config.js +0 -92
  56. package/dist/commands/consent.d.ts +0 -27
  57. package/dist/commands/consent.js +0 -233
  58. package/dist/commands/conversion-paths.d.ts +0 -19
  59. package/dist/commands/conversion-paths.js +0 -55
  60. package/dist/commands/db.d.ts +0 -25
  61. package/dist/commands/db.js +0 -330
  62. package/dist/commands/destinations.d.ts +0 -20
  63. package/dist/commands/destinations.js +0 -191
  64. package/dist/commands/doctor.js +0 -360
  65. package/dist/commands/errors.d.ts +0 -27
  66. package/dist/commands/errors.js +0 -121
  67. package/dist/commands/events.d.ts +0 -33
  68. package/dist/commands/events.js +0 -371
  69. package/dist/commands/experiments.d.ts +0 -22
  70. package/dist/commands/experiments.js +0 -264
  71. package/dist/commands/funnels.d.ts +0 -17
  72. package/dist/commands/funnels.js +0 -203
  73. package/dist/commands/goals.d.ts +0 -18
  74. package/dist/commands/goals.js +0 -214
  75. package/dist/commands/heatmap.d.ts +0 -27
  76. package/dist/commands/heatmap.js +0 -112
  77. package/dist/commands/identity.d.ts +0 -29
  78. package/dist/commands/identity.js +0 -328
  79. package/dist/commands/init.js +0 -215
  80. package/dist/commands/insights.d.ts +0 -10
  81. package/dist/commands/insights.js +0 -77
  82. package/dist/commands/install.d.ts +0 -259
  83. package/dist/commands/install.js +0 -1590
  84. package/dist/commands/login.d.ts +0 -20
  85. package/dist/commands/login.js +0 -170
  86. package/dist/commands/logout.d.ts +0 -10
  87. package/dist/commands/logout.js +0 -41
  88. package/dist/commands/playground.d.ts +0 -11
  89. package/dist/commands/playground.js +0 -47
  90. package/dist/commands/releases.d.ts +0 -17
  91. package/dist/commands/releases.js +0 -54
  92. package/dist/commands/replay.d.ts +0 -18
  93. package/dist/commands/replay.js +0 -64
  94. package/dist/commands/secrets.d.ts +0 -19
  95. package/dist/commands/secrets.js +0 -145
  96. package/dist/commands/setup.d.ts +0 -21
  97. package/dist/commands/setup.js +0 -67
  98. package/dist/commands/sites.d.ts +0 -18
  99. package/dist/commands/sites.js +0 -139
  100. package/dist/commands/skad.d.ts +0 -18
  101. package/dist/commands/skad.js +0 -53
  102. package/dist/commands/sourcemap.d.ts +0 -33
  103. package/dist/commands/sourcemap.js +0 -204
  104. package/dist/commands/status.d.ts +0 -7
  105. package/dist/commands/status.js +0 -136
  106. package/dist/commands/upgrade.d.ts +0 -21
  107. package/dist/commands/upgrade.js +0 -183
  108. package/dist/commands/warehouse.d.ts +0 -20
  109. package/dist/commands/warehouse.js +0 -65
  110. package/dist/commands/warehouses.d.ts +0 -17
  111. package/dist/commands/warehouses.js +0 -182
  112. package/dist/commands/watch.d.ts +0 -45
  113. package/dist/commands/watch.js +0 -258
  114. package/dist/commands/whoami.d.ts +0 -9
  115. package/dist/commands/whoami.js +0 -50
  116. package/dist/config.d.ts +0 -75
  117. package/dist/config.js +0 -329
  118. package/dist/frameworks/detect.d.ts +0 -8
  119. package/dist/frameworks/detect.js +0 -458
  120. package/dist/install-intent-proposal.d.ts +0 -99
  121. package/dist/install-intent-proposal.js +0 -202
  122. package/dist/utils/api.d.ts +0 -20
  123. package/dist/utils/api.js +0 -47
  124. package/dist/utils/config.d.ts +0 -13
  125. package/dist/utils/config.js +0 -30
  126. package/dist/utils/confirm.d.ts +0 -17
  127. package/dist/utils/confirm.js +0 -40
  128. package/dist/utils/dry-run.d.ts +0 -20
  129. package/dist/utils/dry-run.js +0 -67
  130. package/dist/utils/from-file.d.ts +0 -9
  131. package/dist/utils/from-file.js +0 -72
  132. package/dist/utils/redact.d.ts +0 -14
  133. package/dist/utils/redact.js +0 -48
  134. package/dist/utils/ui.d.ts +0 -14
  135. package/dist/utils/ui.js +0 -59
  136. package/scripts/.gitkeep +0 -0
  137. package/scripts/README-gurulu-agentic-install.md +0 -114
  138. package/scripts/README-gurulu-scan.md +0 -98
  139. package/scripts/audit-cli-scopes.mjs +0 -204
  140. package/scripts/backfill-tenant-id.mjs +0 -172
  141. package/scripts/backfill-tenant-links.ts +0 -252
  142. package/scripts/backup-clickhouse.sh +0 -27
  143. package/scripts/backup-postgres.sh +0 -19
  144. package/scripts/bootstrap-runtime-schema.mjs +0 -87
  145. package/scripts/bootstrap-stripe.mjs +0 -158
  146. package/scripts/gurulu-agentic-install.lib.cjs +0 -762
  147. package/scripts/gurulu-agentic-install.mjs +0 -623
  148. package/scripts/gurulu-scan.lib.cjs +0 -1509
  149. package/scripts/gurulu-scan.mjs +0 -91
  150. package/scripts/gurulu-verify-install.lib.cjs +0 -334
  151. package/scripts/gurulu-verify-install.mjs +0 -59
  152. package/scripts/init-ssl.sh +0 -26
  153. package/scripts/migrate-flow-graph-enums.sh +0 -86
  154. package/scripts/monitor-disk.sh +0 -24
  155. package/scripts/patches/astro.patch.cjs +0 -74
  156. package/scripts/patches/auto-instrument/ast-helper.cjs +0 -480
  157. package/scripts/patches/auto-instrument/astro.cjs +0 -273
  158. package/scripts/patches/auto-instrument/express.cjs +0 -383
  159. package/scripts/patches/auto-instrument/fastify.cjs +0 -262
  160. package/scripts/patches/auto-instrument/hono.cjs +0 -392
  161. package/scripts/patches/auto-instrument/index.cjs +0 -80
  162. package/scripts/patches/auto-instrument/nestjs.cjs +0 -286
  163. package/scripts/patches/auto-instrument/nextjs-app-router.cjs +0 -345
  164. package/scripts/patches/auto-instrument/nextjs-pages.cjs +0 -361
  165. package/scripts/patches/auto-instrument/remix.cjs +0 -168
  166. package/scripts/patches/auto-instrument/sdk-helper-map.cjs +0 -241
  167. package/scripts/patches/auto-instrument/singleton-helper.cjs +0 -193
  168. package/scripts/patches/auto-instrument/sveltekit.cjs +0 -161
  169. package/scripts/patches/auto-instrument/vite-react.cjs +0 -37
  170. package/scripts/patches/auto-instrument/vue.cjs +0 -196
  171. package/scripts/patches/express.patch.cjs +0 -99
  172. package/scripts/patches/fastify.patch.cjs +0 -108
  173. package/scripts/patches/index.cjs +0 -300
  174. package/scripts/patches/nestjs.patch.cjs +0 -112
  175. package/scripts/patches/nextjs-app-router.patch.cjs +0 -97
  176. package/scripts/patches/nextjs-pages.patch.cjs +0 -97
  177. package/scripts/patches/remix.patch.cjs +0 -75
  178. package/scripts/patches/sveltekit.patch.cjs +0 -72
  179. package/scripts/patches/vite-react.patch.cjs +0 -73
  180. package/scripts/patches/vue.patch.cjs +0 -82
  181. package/scripts/renew-ssl.sh +0 -14
  182. package/scripts/resolve-migration.sh +0 -23
  183. package/scripts/seed-cli-dev-keys.mjs +0 -130
  184. package/scripts/seed-test-data.mjs +0 -391
  185. package/scripts/spike-browserless.ts +0 -65
  186. package/scripts/tenant-pivot-consistency-check.mjs +0 -205
  187. package/scripts/tenant-pivot-phase-3-cleanup.lib.cjs +0 -258
  188. package/scripts/tenant-pivot-phase-3-cleanup.mjs +0 -98
  189. package/scripts/test-identity-resolution.ts +0 -804
  190. package/scripts/validate-gurulu-schemas.mjs +0 -79
package/LICENSE ADDED
@@ -0,0 +1,92 @@
1
+ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
2
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
3
+
4
+ Parameters
5
+
6
+ Licensor: MONAFY LTD (UK Company No. 17031485)
7
+ Licensed Work: @gurulu/cli (version 0.1.0 and later). The Licensed Work is (c) 2026
8
+ MONAFY LTD.
9
+ Additional Use Grant: You may make production use of the Licensed Work, provided
10
+ Your use does not include offering the Licensed Work to third
11
+ parties on a hosted or embedded basis in order to compete with
12
+ MONAFY LTD's paid version(s) of the Licensed Work. For purposes
13
+ of this license:
14
+
15
+ A "competitive offering" is a Product that is offered to third
16
+ parties on a paid basis, including through paid support
17
+ arrangements, that significantly overlaps with the capabilities
18
+ of MONAFY LTD's paid version(s) of the Licensed Work. If Your
19
+ Product is not a competitive offering when You first make it
20
+ generally available, it will not become a competitive offering
21
+ later due to MONAFY LTD releasing a new version of the Licensed
22
+ Work with additional capabilities. In addition, Products that
23
+ are not provided on a paid basis are not competitive.
24
+
25
+ "Product" means software that is offered to end users to manage
26
+ in their own environments or offered as a service on a hosted
27
+ basis.
28
+
29
+ "Embedded" means including the source code or executable code
30
+ from the Licensed Work in a competitive offering. "Embedded"
31
+ also means packaging the competitive offering in such a way
32
+ that the Licensed Work must be accessed or downloaded for the
33
+ competitive offering to operate.
34
+
35
+ Hosting or using the Licensed Work(s) for internal purposes
36
+ within an organization is not considered a competitive
37
+ offering. MONAFY LTD considers your organization to include all
38
+ of your affiliates under common control.
39
+
40
+ For binding interpretive guidance on using MONAFY LTD products
41
+ under the Business Source License, please visit our FAQ.
42
+ (https://gurulu.io/legal/busl-faq)
43
+ Change Date: 2030-05-21.
44
+ Change License: Apache License, Version 2.0
45
+
46
+ For information about alternative licensing arrangements for the Licensed Work,
47
+ please contact legal@gurulu.io.
48
+
49
+ Notice
50
+
51
+ Business Source License 1.1
52
+
53
+ Terms
54
+
55
+ The Licensor hereby grants you the right to copy, modify, create derivative
56
+ works, redistribute, and make non-production use of the Licensed Work. The
57
+ Licensor may make an Additional Use Grant, above, permitting limited production use.
58
+
59
+ Effective on the Change Date, or the fourth anniversary of the first publicly
60
+ available distribution of a specific version of the Licensed Work under this
61
+ License, whichever comes first, the Licensor hereby grants you rights under
62
+ the terms of the Change License, and the rights granted in the paragraph
63
+ above terminate.
64
+
65
+ If your use of the Licensed Work does not comply with the requirements
66
+ currently in effect as described in this License, you must purchase a
67
+ commercial license from the Licensor, its affiliated entities, or authorized
68
+ resellers, or you must refrain from using the Licensed Work.
69
+
70
+ All copies of the original and modified Licensed Work, and derivative works
71
+ of the Licensed Work, are subject to this License. This License applies
72
+ separately for each version of the Licensed Work and the Change Date may vary
73
+ for each version of the Licensed Work released by Licensor.
74
+
75
+ You must conspicuously display this License on each original or modified copy
76
+ of the Licensed Work. If you receive the Licensed Work in original or
77
+ modified form from a third party, the terms and conditions set forth in this
78
+ License apply to your use of that work.
79
+
80
+ Any use of the Licensed Work in violation of this License will automatically
81
+ terminate your rights under this License for the current and all other
82
+ versions of the Licensed Work.
83
+
84
+ This License does not grant you any right in any trademark or logo of
85
+ Licensor or its affiliates (provided that you may use a trademark or logo of
86
+ Licensor as expressly required by this License).
87
+
88
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
89
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
90
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
91
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
92
+ TITLE.
package/README.md CHANGED
@@ -1,127 +1,56 @@
1
1
  # @gurulu/cli
2
2
 
3
- CLI for Gurulu.io — setup, diagnostics, data exploration, and AI-powered analytics from your terminal.
3
+ CLI for [Gurulu](https://gurulu.io)Truth Layer for product analytics.
4
4
 
5
- ## Quick Start
5
+ Registry-as-code, typed events, schema sync between your codebase and the Gurulu event registry.
6
+
7
+ ## Install
6
8
 
7
9
  ```bash
8
- npx @gurulu/cli init
10
+ npm install -g @gurulu/cli
11
+ # or
12
+ bun add -g @gurulu/cli
9
13
  ```
10
14
 
11
- ## Commands
12
-
13
- ### Authentication
14
-
15
- | Command | Description |
16
- |---------|-------------|
17
- | `gurulu auth` | Authenticate via device-link flow (or `--key` for manual) |
18
- | `gurulu login` | Authenticate with API key |
19
- | `gurulu logout` | Remove a stored profile |
20
- | `gurulu whoami` | Show current authentication state |
21
-
22
- ### Setup & Diagnostics
23
-
24
- | Command | Description |
25
- |---------|-------------|
26
- | `gurulu init` | Set up Gurulu analytics (auto-detects framework) |
27
- | `gurulu install [path]` | Install Gurulu tracker in a repository |
28
- | `gurulu add-server` | Add server-side SDK (@gurulu/node) |
29
- | `gurulu status` | Check SDK health and connection |
30
- | `gurulu doctor` | Diagnose setup issues |
31
- | `gurulu config <action>` | Manage CLI profiles (list, use, show, delete) |
32
-
33
- ### Sites & Keys
34
-
35
- | Command | Description |
36
- |---------|-------------|
37
- | `gurulu sites <action>` | Manage sites (list, create, show, delete, rotate-token) |
38
- | `gurulu api-keys <action>` | Manage API keys (list, create, revoke, rotate) |
39
-
40
- ### Data & Events
41
-
42
- | Command | Description |
43
- |---------|-------------|
44
- | `gurulu events <action>` | View ingested events (list, tail) |
45
- | `gurulu insights <action>` | View daily insights (today, history, weekly) |
46
- | `gurulu chat [question]` | Ask analytics questions in natural language (NL -> SQL) |
47
-
48
- ### Identity & Audiences
49
-
50
- | Command | Description |
51
- |---------|-------------|
52
- | `gurulu identity <action>` | View identity state (decay, transfers, cdc-sources) |
53
- | `gurulu audiences <action>` | View audiences (list, show) |
54
- | `gurulu experiments <action>` | View experiments (list, show, results) |
55
-
56
- ### Integrations & Export
57
-
58
- | Command | Description |
59
- |---------|-------------|
60
- | `gurulu warehouse <action>` | Warehouse exports (BigQuery) |
61
- | `gurulu warehouses <action>` | View warehouse exports (list, runs) |
62
- | `gurulu destinations <action>` | View activation destinations (list, show) |
63
- | `gurulu db <action>` | Connect, list, sync, or remove database sources |
64
-
65
- ### Monitoring & Debugging
66
-
67
- | Command | Description |
68
- |---------|-------------|
69
- | `gurulu alerts <action>` | View anomaly alerts (list, show, channels) |
70
- | `gurulu sourcemap <action>` | Upload source maps for error deobfuscation |
71
- | `gurulu audit <action>` | Stream or export the CLI audit log (tail, export) |
72
- | `gurulu playground <action>` | View playground sessions (list) |
73
-
74
- ## Supported Frameworks
75
-
76
- Next.js (App & Pages Router), React (Vite & CRA), Vue 3, Nuxt 3, Svelte & SvelteKit, Astro, Express, NestJS, Plain HTML.
77
-
78
- ## Authentication
15
+ ## Quick start
79
16
 
80
17
  ```bash
81
- gurulu auth # Device-link flow (recommended)
82
- gurulu login --api-key pak_live_x # Manual API key
18
+ gurulu login # authenticate (OAuth device flow)
19
+ cd my-project
20
+ gurulu init --workspace <workspace-uuid>
21
+ gurulu pull # fetch registry + generate typed events
83
22
  ```
84
23
 
85
- Or set the `GURULU_API_KEY` environment variable.
86
-
87
- ## Non-Interactive Mode
88
-
89
- All commands support `--no-interactive` for CI/CD:
24
+ Then in your code:
90
25
 
91
- ```bash
92
- gurulu init --site-id abc123 --token tok_xxx --no-interactive
26
+ ```ts
27
+ import { track } from '@gurulu/web';
28
+ // IDE autocomplete: event names + property types from your registry
29
+ track('checkout.completed', { order_id: 'o_123', total: 49.99 });
93
30
  ```
94
31
 
95
- ## JSON Output
32
+ ## Commands
96
33
 
97
- Use `--json` flag for machine-readable output:
34
+ | Command | Purpose |
35
+ |---|---|
36
+ | `gurulu init` | Initialize Gurulu workspace in current project |
37
+ | `gurulu login` | Authenticate via OAuth device flow |
38
+ | `gurulu logout` | Remove stored credentials |
39
+ | `gurulu whoami` | Show active workspace + user |
40
+ | `gurulu pull` | Pull registry snapshot + generate typed events |
41
+ | `gurulu push` | Propose new event/property to the registry |
42
+ | `gurulu validate` | Scan codebase for deprecated/unknown event calls |
43
+ | `gurulu doctor` | Run 5-check installation diagnostic |
44
+ | `gurulu mcp start` | Start MCP server for Cursor / Claude Code / Lovable |
98
45
 
99
- ```bash
100
- gurulu events list --json
101
- gurulu status --json
102
- gurulu doctor --json
103
- ```
46
+ ## Documentation
104
47
 
105
- ## Telemetry
48
+ [gurulu.io/docs](https://gurulu.io/docs)
106
49
 
107
- `gurulu install` records anonymous install telemetry — framework, CLI version,
108
- install status, and a SHA-256 hash of the absolute repo path — to help us
109
- improve framework detection and patch reliability. **No source code, file
110
- contents, or environment variables are ever sent.**
50
+ ## License
111
51
 
112
- On the first interactive install you'll be asked to opt in. Your choice is
113
- persisted to `~/.gurulu/config.json` (`telemetry: true|false`) and never
114
- re-asked.
52
+ Business Source License 1.1 see [LICENSE](./LICENSE).
115
53
 
116
- To opt out:
117
-
118
- ```bash
119
- gurulu install --no-telemetry # one-off
120
- export GURULU_TELEMETRY=off # session / shell
121
- export DO_NOT_TRACK=1 # honored across most CLI tools
122
- echo '{"telemetry": false}' > ~/.gurulu/config.json # permanent
123
- ```
54
+ The Licensed Work converts to the Apache License, Version 2.0 on **2030-05-21**.
124
55
 
125
- Any of `GURULU_TELEMETRY=off|0|false|no`, `DO_NOT_TRACK=1`, `--no-telemetry`,
126
- or `telemetry: false` in `~/.gurulu/config.json` disables telemetry — the repo
127
- hash is never computed and no network request is made.
56
+ Copyright © 2026 MONAFY LTD (UK Company No. 17031485).
package/dist/bin.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}