Conversation
There was a problem hiding this comment.
Pull request overview
Adds a first-pass telemetry implementation across CLI commands, including a persistent config and enable/disable toggles.
Changes:
- Introduces a PostHog client plus config helpers (
loadConfig,allowsTelemetry,logEvent) in shared utils. - Adds a
postinstallscript to generate a per-install UUID + default telemetry setting. - Wires
logEvent(...)into multiple command entrypoints and addstelemetry:enable/telemetry:disablecommands.
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils.ts | Adds PostHog client initialization, config loading, and event capture helpers. |
| src/postinstall.ts | Creates a config file under dist/.fa/ during install. |
| src/commands/theme-watch.ts | Emits telemetry event on command start. |
| src/commands/theme-upload.ts | Emits telemetry event on command start. |
| src/commands/theme-download.ts | Emits telemetry event on command start. |
| src/commands/message-upload.ts | Emits telemetry event on command start. |
| src/commands/message-download.ts | Emits telemetry event on command start. |
| src/commands/lambda-update.ts | Emits telemetry event on command start. |
| src/commands/lambda-retrieve.ts | Emits telemetry event on command start. |
| src/commands/lambda-delete.ts | Emits telemetry event on command start. |
| src/commands/import-generate.ts | Emits telemetry event on command start. |
| src/commands/email-watch.ts | Emits telemetry event on command start. |
| src/commands/email-upload.ts | Emits telemetry event on command start. |
| src/commands/email-download.ts | Emits telemetry event on command start. |
| src/commands/email-html-to-text.ts | Emits telemetry event on command start. |
| src/commands/email-duplicate.ts | Emits telemetry event on command start. |
| src/commands/email-create.ts | Emits telemetry event on command start. |
| src/commands/check-common-config.ts | Emits telemetry event on command start. |
| src/commands/kickstart-start.ts | Emits telemetry event on command start. |
| src/commands/kickstart-stop.ts | Emits telemetry event on command start. |
| src/commands/kickstart-kill.ts | Emits telemetry event on command start (+ minor formatting change). |
| src/commands/kickstart-install.ts | Emits telemetry event on command start. |
| src/commands/telemetry-enable.ts | Adds command to enable telemetry in config. |
| src/commands/telemetry-disable.ts | Adds command to disable telemetry in config. |
| src/commands/index.ts | Exports the new telemetry commands. |
| package.json | Adds postinstall script and posthog-node dependency. |
| package-lock.json | Locks new dependency graph for posthog-node. |
| .gitignore | Ignores .fa/ directory. |
Comments suppressed due to low confidence (1)
package.json:57
posthog-node@^5.21.2declares an engine requirement of Node >= 20 (per the lockfile). The README currently says the CLI is tested on Node 19 as well, so this dependency update will make installs/runtime on Node 19 unreliable. Either bump/document the minimum Node version (e.g., add anenginesfield) or use a PostHog client version compatible with the supported Node range.
"posthog-node": "^5.21.2",
"queue": "7.0.0",
"remove-undefined-objects": "3.0.0",
"uuid": "9.0.0",
"yocto-spinner": "^1.1.0"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+13
to
+19
| export const posthogClient = new PostHog( | ||
| 'phc_nB6C2uZX2LA6ce6VAaWZxBYPtq1wYH5x8A3n36DaLzQ', | ||
| { host: 'https://us.i.posthog.com' } | ||
| ) | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
The PostHog API key is hard-coded in the source. Even if it's a “public” project key, committing it makes rotation and environment-specific configuration difficult. Consider reading the key (and host) from an environment variable or config, and only initializing the client when telemetry is actually enabled.
Suggested change
| export const posthogClient = new PostHog( | |
| 'phc_nB6C2uZX2LA6ce6VAaWZxBYPtq1wYH5x8A3n36DaLzQ', | |
| { host: 'https://us.i.posthog.com' } | |
| ) | |
| const posthogEnabled = process.env.POSTHOG_ENABLED === 'true'; | |
| const posthogApiKey = process.env.POSTHOG_API_KEY; | |
| const posthogHost = process.env.POSTHOG_HOST ?? 'https://us.i.posthog.com'; | |
| export const posthogClient = posthogEnabled && posthogApiKey | |
| ? new PostHog(posthogApiKey, { host: posthogHost }) | |
| : null; |
andrewpai
reviewed
Apr 30, 2026
…erly) and adds a default config
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
andrewpai
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds usage data collection to all the commands as a first step toward broader telemetry collection.