diff --git a/.changeset/feedback-command.md b/.changeset/feedback-command.md new file mode 100644 index 00000000000..039dcfdd787 --- /dev/null +++ b/.changeset/feedback-command.md @@ -0,0 +1,6 @@ +--- +'@shopify/cli-kit': minor +'@shopify/cli': minor +--- + +Add `shopify feedback` command for sending feedback about the CLI to Shopify diff --git a/packages/cli-kit/src/public/node/metadata.ts b/packages/cli-kit/src/public/node/metadata.ts index 2530ab6d96b..0079c4e4633 100644 --- a/packages/cli-kit/src/public/node/metadata.ts +++ b/packages/cli-kit/src/public/node/metadata.ts @@ -176,11 +176,12 @@ export function createRuntimeMetadataContainer< } // We want to track anything that ends up getting sent to monorail as `cmd_all_*`, -// `cmd_app_*`, `cmd_theme_*`, `store_*`, and `env_auto_upgrade_*` +// `cmd_app_*`, `cmd_theme_*`, `store_*`, `env_auto_upgrade_*`, and `cmd_feedback_*` type CmdFieldsFromMonorail = PickByPrefix & PickByPrefix & PickByPrefix & PickByPrefix & + PickByPrefix & PickByPrefix & PickByPrefix @@ -195,7 +196,12 @@ const coreData = createRuntimeMetadataContainer< startArgs: string[] requiresSyncAnalytics?: boolean } - } & {environmentFlags: string} & PickByPrefix + } & { + environmentFlags: string + // The `shopify feedback` message is user-authored free text that may contain PII, so it travels + // inside the sensitive `metadata` field of the Monorail event rather than as a public field. + cmd_feedback_message: string + } & PickByPrefix >({cmd_all_timing_network_ms: 0, cmd_all_timing_prompts_ms: 0}) export const {getAllPublicMetadata, getAllSensitiveMetadata, addPublicMetadata, addSensitiveMetadata, runWithTimer} = diff --git a/packages/cli-kit/src/public/node/monorail.ts b/packages/cli-kit/src/public/node/monorail.ts index c797cfe2e88..ebf163a4135 100644 --- a/packages/cli-kit/src/public/node/monorail.ts +++ b/packages/cli-kit/src/public/node/monorail.ts @@ -10,7 +10,7 @@ const url = 'https://monorail-edge.shopifysvc.com/v1/produce' type Optional = T | null // This is the topic name of the main event we log to Monorail, the command tracker -export const MONORAIL_COMMAND_TOPIC = 'app_cli3_command/1.28' +export const MONORAIL_COMMAND_TOPIC = 'app_cli3_command/1.29' export interface Schemas { [MONORAIL_COMMAND_TOPIC]: { @@ -135,6 +135,14 @@ export interface Schemas { // Release related commands cmd_release_confirm_cancelled?: Optional + // Feedback command. The message itself is user-authored free text, so it travels in the + // sensitive `metadata` field rather than as a public field. + cmd_feedback_sentiment?: Optional + cmd_feedback_category?: Optional + cmd_feedback_message_length?: Optional + cmd_feedback_message_truncated?: Optional + cmd_feedback_source?: Optional + // App setup app_extensions_any?: Optional app_extensions_breakdown?: Optional diff --git a/packages/cli/README.md b/packages/cli/README.md index 445154f2fa8..c836545e683 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -42,6 +42,7 @@ * [`shopify config autoupgrade status`](#shopify-config-autoupgrade-status) * [`shopify doc fetch`](#shopify-doc-fetch) * [`shopify doc search`](#shopify-doc-search) +* [`shopify feedback`](#shopify-feedback) * [`shopify help [command] [flags]`](#shopify-help-command-flags) * [`shopify hydrogen build`](#shopify-hydrogen-build) * [`shopify hydrogen check RESOURCE`](#shopify-hydrogen-check-resource) @@ -2212,6 +2213,59 @@ EXAMPLES shopify doc search --query "create a product" --api-name admin --api-version latest ``` +## `shopify feedback` + +Send feedback about Shopify CLI. + +``` +USAGE + $ shopify feedback -m [--category + wrong_guidance|missing_capability|confusing_docs|tool_failure|slow|other] [-j] [--no-color] [--sentiment + frustrated|blocked|confused|praise] [--verbose] + +FLAGS + -j, --json + Output the result as JSON. Automatically disables color output. + [env: SHOPIFY_FLAG_JSON] + + -m, --message= + (required) The feedback message. Pass - to read the message from stdin. Messages longer than 2000 characters are + truncated. + [env: SHOPIFY_FLAG_MESSAGE] + + --category=