Open
Conversation
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/private/node/constants.d.ts@@ -8,6 +8,7 @@ export declare const environmentVariables: {
env: string;
firstPartyDev: string;
noAnalytics: string;
+ optOutInstrumentation: string;
appAutomationToken: string;
partnersToken: string;
runAsUser: string;
packages/cli-kit/dist/public/node/context/local.d.ts@@ -53,7 +53,7 @@ export declare function isUnitTest(env?: NodeJS.ProcessEnv): boolean;
* Returns true if reporting analytics is enabled.
*
* @param env - The environment variables from the environment of the current process.
- * @returns True unless SHOPIFY_CLI_NO_ANALYTICS is truthy or debug mode is enabled.
+ * @returns True unless SHOPIFY_CLI_NO_ANALYTICS or OPT_OUT_INSTRUMENTATION is truthy, or debug mode is enabled.
*/
export declare function analyticsDisabled(env?: NodeJS.ProcessEnv): boolean;
/**
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns Shopify CLI’s analytics opt-out behavior with other Shopify tooling by accepting OPT_OUT_INSTRUMENTATION=true as an alias for the existing SHOPIFY_CLI_NO_ANALYTICS=1 opt-out, and updates documentation accordingly.
Changes:
- Add
OPT_OUT_INSTRUMENTATIONtocli-kit’s shared environment-variable constants. - Update
analyticsDisabled()to disable analytics when either opt-out env var is truthy (or when in development). - Update usage-reporting docs (source + generated output) to mention both opt-out options.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/cli-kit/src/public/node/context/local.ts | Extends analytics opt-out detection to include OPT_OUT_INSTRUMENTATION. |
| packages/cli-kit/src/public/node/context/local.test.ts | Adds unit tests covering the new opt-out env var behavior. |
| packages/cli-kit/src/private/node/constants.ts | Adds a shared constant key for OPT_OUT_INSTRUMENTATION. |
| docs-shopify.dev/static/cli.doc.ts | Updates usage-reporting docs to mention both opt-out env vars. |
| docs-shopify.dev/generated/generated_static_pages.json | Updates generated docs content to match the static docs change. |
| .changeset/quiet-otters-wave.md | Adds a patch changeset documenting the new opt-out alias. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
94
to
99
| /** | ||
| * Returns true if reporting analytics is enabled. | ||
| * | ||
| * @param env - The environment variables from the environment of the current process. | ||
| * @returns True unless SHOPIFY_CLI_NO_ANALYTICS is truthy or debug mode is enabled. | ||
| * @returns True unless SHOPIFY_CLI_NO_ANALYTICS or OPT_OUT_INSTRUMENTATION is truthy, or debug mode is enabled. | ||
| */ |
durga256
approved these changes
May 8, 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.

What
Make the CLI treat
OPT_OUT_INSTRUMENTATION=trueas an analytics opt-out, alongside the existingSHOPIFY_CLI_NO_ANALYTICS=1env var.This also updates the usage-reporting docs to mention both opt-out paths.
Why
ai-toolkitand related Shopify agent surfaces already useOPT_OUT_INSTRUMENTATIONas the common telemetry opt-out.When those tools invoke Shopify CLI, the mismatch is awkward: the surrounding tooling can be opted out with one env var, but the CLI still requires a different one. This makes the CLI accept the same opt-out signal as an alias without changing the existing
SHOPIFY_CLI_NO_ANALYTICSbehavior.How
OPT_OUT_INSTRUMENTATIONto the shared environment-variable constants incli-kitanalyticsDisabled()to return true when either opt-out env var is truthy