From bb545b8c43b3f67d2dc7005e2202e51f38656f94 Mon Sep 17 00:00:00 2001 From: Gray Gilmore Date: Thu, 2 Apr 2026 15:03:15 -0700 Subject: [PATCH] Add glob pattern support for --environment flag Theme users with many similarly-named environments (e.g. us-production, eu-production, int-production) currently must specify each one individually with -e. This adds glob pattern support so they can use patterns like --environment "*-production" to target multiple environments at once. The implementation expands glob patterns at a single point in base-command's resultWithEnvironment(), before the single/multi environment routing logic. This avoids needing downstream consumers like theme-command to handle expansion themselves. Key design decisions: - Uses minimatch (already a dependency) for pattern matching - Extracts shared TOML parsing into private decodeEnvironments() to avoid duplication between loadEnvironment() and the new getEnvironmentNames() - Expansion happens early so originalResult.flags.environment gets real names, not glob patterns - Deduplicates across multiple patterns via Set - Warns per-pattern when no environments match Closes https://github.com/Shopify/cli/issues/6481 Co-Authored-By: Claude Opus 4.6 --- .changeset/glob-environment-patterns.md | 8 + .../interfaces/theme-check.interface.ts | 2 +- .../interfaces/theme-console.interface.ts | 2 +- .../interfaces/theme-delete.interface.ts | 2 +- .../interfaces/theme-dev.interface.ts | 2 +- .../interfaces/theme-duplicate.interface.ts | 2 +- .../interfaces/theme-info.interface.ts | 2 +- .../interfaces/theme-list.interface.ts | 2 +- .../theme-metafields-pull.interface.ts | 2 +- .../interfaces/theme-open.interface.ts | 2 +- .../interfaces/theme-preview.interface.ts | 2 +- .../interfaces/theme-profile.interface.ts | 2 +- .../interfaces/theme-publish.interface.ts | 2 +- .../interfaces/theme-pull.interface.ts | 2 +- .../interfaces/theme-push.interface.ts | 2 +- .../interfaces/theme-rename.interface.ts | 2 +- .../interfaces/theme-share.interface.ts | 2 +- .../generated/generated_docs_data.json | 64 ++++---- .../src/public/node/base-command.test.ts | 90 ++++++++++- .../cli-kit/src/public/node/base-command.ts | 32 +++- .../src/public/node/environments.test.ts | 149 ++++++++++++++++++ .../cli-kit/src/public/node/environments.ts | 66 +++++++- packages/cli/README.md | 49 +++++- packages/cli/oclif.manifest.json | 34 ++-- packages/theme/src/cli/flags.ts | 6 +- 25 files changed, 445 insertions(+), 85 deletions(-) create mode 100644 .changeset/glob-environment-patterns.md diff --git a/.changeset/glob-environment-patterns.md b/.changeset/glob-environment-patterns.md new file mode 100644 index 00000000000..8ce50778b9a --- /dev/null +++ b/.changeset/glob-environment-patterns.md @@ -0,0 +1,8 @@ +--- +'@shopify/cli-kit': patch +'@shopify/theme': patch +--- + +Add glob pattern support for the `--environment` flag. You can now use patterns +like `--environment "*-production"` to target multiple environments at once. +Wrap glob patterns in quotes to prevent shell expansion. diff --git a/docs-shopify.dev/commands/interfaces/theme-check.interface.ts b/docs-shopify.dev/commands/interfaces/theme-check.interface.ts index 41a0493b342..bb36877134c 100644 --- a/docs-shopify.dev/commands/interfaces/theme-check.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-check.interface.ts @@ -16,7 +16,7 @@ export interface themecheck { '-C, --config '?: string /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-console.interface.ts b/docs-shopify.dev/commands/interfaces/theme-console.interface.ts index f386c58125b..1be53958881 100644 --- a/docs-shopify.dev/commands/interfaces/theme-console.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-console.interface.ts @@ -1,7 +1,7 @@ // This is an autogenerated file. Don't edit this file manually. export interface themeconsole { /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-delete.interface.ts b/docs-shopify.dev/commands/interfaces/theme-delete.interface.ts index 44c4ea59d54..731cdee725d 100644 --- a/docs-shopify.dev/commands/interfaces/theme-delete.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-delete.interface.ts @@ -7,7 +7,7 @@ export interface themedelete { '-d, --development'?: '' /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-dev.interface.ts b/docs-shopify.dev/commands/interfaces/theme-dev.interface.ts index 311f0b9d57f..cd62bc8d556 100644 --- a/docs-shopify.dev/commands/interfaces/theme-dev.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-dev.interface.ts @@ -7,7 +7,7 @@ export interface themedev { '-a, --allow-live'?: '' /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-duplicate.interface.ts b/docs-shopify.dev/commands/interfaces/theme-duplicate.interface.ts index 33190b1d7be..d358a8cb43e 100644 --- a/docs-shopify.dev/commands/interfaces/theme-duplicate.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-duplicate.interface.ts @@ -1,7 +1,7 @@ // This is an autogenerated file. Don't edit this file manually. export interface themeduplicate { /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-info.interface.ts b/docs-shopify.dev/commands/interfaces/theme-info.interface.ts index 7fd304c0ba7..5f02b13110c 100644 --- a/docs-shopify.dev/commands/interfaces/theme-info.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-info.interface.ts @@ -7,7 +7,7 @@ export interface themeinfo { '-d, --development'?: '' /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-list.interface.ts b/docs-shopify.dev/commands/interfaces/theme-list.interface.ts index d2880779a01..aa444f352c4 100644 --- a/docs-shopify.dev/commands/interfaces/theme-list.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-list.interface.ts @@ -1,7 +1,7 @@ // This is an autogenerated file. Don't edit this file manually. export interface themelist { /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-metafields-pull.interface.ts b/docs-shopify.dev/commands/interfaces/theme-metafields-pull.interface.ts index ee0a3e8ae91..4f0d3c5d558 100644 --- a/docs-shopify.dev/commands/interfaces/theme-metafields-pull.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-metafields-pull.interface.ts @@ -1,7 +1,7 @@ // This is an autogenerated file. Don't edit this file manually. export interface thememetafieldspull { /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-open.interface.ts b/docs-shopify.dev/commands/interfaces/theme-open.interface.ts index 6bad3978a76..e799dbb5512 100644 --- a/docs-shopify.dev/commands/interfaces/theme-open.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-open.interface.ts @@ -13,7 +13,7 @@ export interface themeopen { '-E, --editor'?: '' /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-preview.interface.ts b/docs-shopify.dev/commands/interfaces/theme-preview.interface.ts index 5d443d9370e..87ea844e42a 100644 --- a/docs-shopify.dev/commands/interfaces/theme-preview.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-preview.interface.ts @@ -1,7 +1,7 @@ // This is an autogenerated file. Don't edit this file manually. export interface themepreview { /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-profile.interface.ts b/docs-shopify.dev/commands/interfaces/theme-profile.interface.ts index 8eee4acea34..33601fd60d6 100644 --- a/docs-shopify.dev/commands/interfaces/theme-profile.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-profile.interface.ts @@ -1,7 +1,7 @@ // This is an autogenerated file. Don't edit this file manually. export interface themeprofile { /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-publish.interface.ts b/docs-shopify.dev/commands/interfaces/theme-publish.interface.ts index 0d6c12fc0a6..e70ddc3b8ba 100644 --- a/docs-shopify.dev/commands/interfaces/theme-publish.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-publish.interface.ts @@ -1,7 +1,7 @@ // This is an autogenerated file. Don't edit this file manually. export interface themepublish { /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-pull.interface.ts b/docs-shopify.dev/commands/interfaces/theme-pull.interface.ts index de776d5a0b1..ff4ab3b201b 100644 --- a/docs-shopify.dev/commands/interfaces/theme-pull.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-pull.interface.ts @@ -7,7 +7,7 @@ export interface themepull { '-d, --development'?: '' /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-push.interface.ts b/docs-shopify.dev/commands/interfaces/theme-push.interface.ts index e9c22e4f71a..65aca2210e6 100644 --- a/docs-shopify.dev/commands/interfaces/theme-push.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-push.interface.ts @@ -19,7 +19,7 @@ export interface themepush { '-c, --development-context '?: string /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-rename.interface.ts b/docs-shopify.dev/commands/interfaces/theme-rename.interface.ts index e5255d725c3..c0fd98a0ec7 100644 --- a/docs-shopify.dev/commands/interfaces/theme-rename.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-rename.interface.ts @@ -7,7 +7,7 @@ export interface themerename { '-d, --development'?: '' /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/commands/interfaces/theme-share.interface.ts b/docs-shopify.dev/commands/interfaces/theme-share.interface.ts index 5e12cfbe30e..47c92e3118c 100644 --- a/docs-shopify.dev/commands/interfaces/theme-share.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-share.interface.ts @@ -1,7 +1,7 @@ // This is an autogenerated file. Don't edit this file manually. export interface themeshare { /** - * The environment to apply to the current command. + * The environment to apply to the current command. Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards. * @environment SHOPIFY_FLAG_ENVIRONMENT */ '-e, --environment '?: string diff --git a/docs-shopify.dev/generated/generated_docs_data.json b/docs-shopify.dev/generated/generated_docs_data.json index 75162409d11..80496c50a3a 100644 --- a/docs-shopify.dev/generated/generated_docs_data.json +++ b/docs-shopify.dev/generated/generated_docs_data.json @@ -6088,7 +6088,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -6111,7 +6111,7 @@ "environmentValue": "SHOPIFY_FLAG_VERSION" } ], - "value": "export interface themecheck {\n /**\n * Automatically fix offenses\n * @environment SHOPIFY_FLAG_AUTO_CORRECT\n */\n '-a, --auto-correct'?: ''\n\n /**\n * Use the config provided, overriding .theme-check.yml if present\n Supports all theme-check: config values, e.g., theme-check:theme-app-extension,\n theme-check:recommended, theme-check:all\n For backwards compatibility, :theme_app_extension is also supported \n * @environment SHOPIFY_FLAG_CONFIG\n */\n '-C, --config '?: string\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Minimum severity for exit with error code\n * @environment SHOPIFY_FLAG_FAIL_LEVEL\n */\n '--fail-level '?: string\n\n /**\n * Generate a .theme-check.yml file\n * @environment SHOPIFY_FLAG_INIT\n */\n '--init'?: ''\n\n /**\n * List enabled checks\n * @environment SHOPIFY_FLAG_LIST\n */\n '--list'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * The output format to use\n * @environment SHOPIFY_FLAG_OUTPUT\n */\n '-o, --output '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Output active config to STDOUT\n * @environment SHOPIFY_FLAG_PRINT\n */\n '--print'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n\n /**\n * Print Theme Check version\n * @environment SHOPIFY_FLAG_VERSION\n */\n '-v, --version'?: ''\n}" + "value": "export interface themecheck {\n /**\n * Automatically fix offenses\n * @environment SHOPIFY_FLAG_AUTO_CORRECT\n */\n '-a, --auto-correct'?: ''\n\n /**\n * Use the config provided, overriding .theme-check.yml if present\n Supports all theme-check: config values, e.g., theme-check:theme-app-extension,\n theme-check:recommended, theme-check:all\n For backwards compatibility, :theme_app_extension is also supported \n * @environment SHOPIFY_FLAG_CONFIG\n */\n '-C, --config '?: string\n\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Minimum severity for exit with error code\n * @environment SHOPIFY_FLAG_FAIL_LEVEL\n */\n '--fail-level '?: string\n\n /**\n * Generate a .theme-check.yml file\n * @environment SHOPIFY_FLAG_INIT\n */\n '--init'?: ''\n\n /**\n * List enabled checks\n * @environment SHOPIFY_FLAG_LIST\n */\n '--list'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * The output format to use\n * @environment SHOPIFY_FLAG_OUTPUT\n */\n '-o, --output '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Output active config to STDOUT\n * @environment SHOPIFY_FLAG_PRINT\n */\n '--print'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n\n /**\n * Print Theme Check version\n * @environment SHOPIFY_FLAG_VERSION\n */\n '-v, --version'?: ''\n}" } } } @@ -6207,7 +6207,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -6221,7 +6221,7 @@ "environmentValue": "SHOPIFY_FLAG_STORE" } ], - "value": "export interface themeconsole {\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * The password for storefronts with password protection.\n * @environment SHOPIFY_FLAG_STORE_PASSWORD\n */\n '--store-password '?: string\n\n /**\n * The url to be used as context\n * @environment SHOPIFY_FLAG_URL\n */\n '--url '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themeconsole {\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * The password for storefronts with password protection.\n * @environment SHOPIFY_FLAG_STORE_PASSWORD\n */\n '--store-password '?: string\n\n /**\n * The url to be used as context\n * @environment SHOPIFY_FLAG_URL\n */\n '--url '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -6317,7 +6317,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -6349,7 +6349,7 @@ "environmentValue": "SHOPIFY_FLAG_THEME_ID" } ], - "value": "export interface themedelete {\n /**\n * Delete your development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Skip confirmation.\n * @environment SHOPIFY_FLAG_FORCE\n */\n '-f, --force'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Include others development themes in theme list.\n * @environment SHOPIFY_FLAG_SHOW_ALL\n */\n '-a, --show-all'?: ''\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themedelete {\n /**\n * Delete your development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Skip confirmation.\n * @environment SHOPIFY_FLAG_FORCE\n */\n '-f, --force'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Include others development themes in theme list.\n * @environment SHOPIFY_FLAG_SHOW_ALL\n */\n '-a, --show-all'?: ''\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -6517,7 +6517,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -6567,7 +6567,7 @@ "environmentValue": "SHOPIFY_FLAG_IGNORE" } ], - "value": "export interface themedev {\n /**\n * Allow development on a live theme.\n * @environment SHOPIFY_FLAG_ALLOW_LIVE\n */\n '-a, --allow-live'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Controls the visibility of the error overlay when an theme asset upload fails:\n- silent Prevents the error overlay from appearing.\n- default Displays the error overlay.\n \n * @environment SHOPIFY_FLAG_ERROR_OVERLAY\n */\n '--error-overlay '?: string\n\n /**\n * Set which network interface the web server listens on. The default value is 127.0.0.1.\n * @environment SHOPIFY_FLAG_HOST\n */\n '--host '?: string\n\n /**\n * Skip hot reloading any files that match the specified pattern.\n * @environment SHOPIFY_FLAG_IGNORE\n */\n '-x, --ignore '?: string\n\n /**\n * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.\n * @environment SHOPIFY_FLAG_LISTING\n */\n '--listing '?: string\n\n /**\n * The live reload mode switches the server behavior when a file is modified:\n- hot-reload Hot reloads local changes to CSS and sections (default)\n- full-page Always refreshes the entire page\n- off Deactivate live reload\n * @environment SHOPIFY_FLAG_LIVE_RELOAD\n */\n '--live-reload '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Prevents files from being deleted in the remote theme when a file has been deleted locally. This applies to files that are deleted while the command is running, and files that have been deleted locally before the command is run.\n * @environment SHOPIFY_FLAG_NODELETE\n */\n '-n, --nodelete'?: ''\n\n /**\n * The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.\n * @environment SHOPIFY_FLAG_NOTIFY\n */\n '--notify '?: string\n\n /**\n * Hot reload only files that match the specified pattern.\n * @environment SHOPIFY_FLAG_ONLY\n */\n '-o, --only '?: string\n\n /**\n * Automatically launch the theme preview in your default web browser.\n * @environment SHOPIFY_FLAG_OPEN\n */\n '--open'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Local port to serve theme preview from.\n * @environment SHOPIFY_FLAG_PORT\n */\n '--port '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * The password for storefronts with password protection.\n * @environment SHOPIFY_FLAG_STORE_PASSWORD\n */\n '--store-password '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Synchronize Theme Editor updates in the local theme files.\n * @environment SHOPIFY_FLAG_THEME_EDITOR_SYNC\n */\n '--theme-editor-sync'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themedev {\n /**\n * Allow development on a live theme.\n * @environment SHOPIFY_FLAG_ALLOW_LIVE\n */\n '-a, --allow-live'?: ''\n\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Controls the visibility of the error overlay when an theme asset upload fails:\n- silent Prevents the error overlay from appearing.\n- default Displays the error overlay.\n \n * @environment SHOPIFY_FLAG_ERROR_OVERLAY\n */\n '--error-overlay '?: string\n\n /**\n * Set which network interface the web server listens on. The default value is 127.0.0.1.\n * @environment SHOPIFY_FLAG_HOST\n */\n '--host '?: string\n\n /**\n * Skip hot reloading any files that match the specified pattern.\n * @environment SHOPIFY_FLAG_IGNORE\n */\n '-x, --ignore '?: string\n\n /**\n * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.\n * @environment SHOPIFY_FLAG_LISTING\n */\n '--listing '?: string\n\n /**\n * The live reload mode switches the server behavior when a file is modified:\n- hot-reload Hot reloads local changes to CSS and sections (default)\n- full-page Always refreshes the entire page\n- off Deactivate live reload\n * @environment SHOPIFY_FLAG_LIVE_RELOAD\n */\n '--live-reload '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Prevents files from being deleted in the remote theme when a file has been deleted locally. This applies to files that are deleted while the command is running, and files that have been deleted locally before the command is run.\n * @environment SHOPIFY_FLAG_NODELETE\n */\n '-n, --nodelete'?: ''\n\n /**\n * The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.\n * @environment SHOPIFY_FLAG_NOTIFY\n */\n '--notify '?: string\n\n /**\n * Hot reload only files that match the specified pattern.\n * @environment SHOPIFY_FLAG_ONLY\n */\n '-o, --only '?: string\n\n /**\n * Automatically launch the theme preview in your default web browser.\n * @environment SHOPIFY_FLAG_OPEN\n */\n '--open'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Local port to serve theme preview from.\n * @environment SHOPIFY_FLAG_PORT\n */\n '--port '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * The password for storefronts with password protection.\n * @environment SHOPIFY_FLAG_STORE_PASSWORD\n */\n '--store-password '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Synchronize Theme Editor updates in the local theme files.\n * @environment SHOPIFY_FLAG_THEME_EDITOR_SYNC\n */\n '--theme-editor-sync'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -6636,7 +6636,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -6686,7 +6686,7 @@ "environmentValue": "SHOPIFY_FLAG_THEME_ID" } ], - "value": "export interface themeduplicate {\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Force the duplicate operation to run without prompts or confirmations.\n * @environment SHOPIFY_FLAG_FORCE\n */\n '-f, --force'?: ''\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Name of the newly duplicated theme.\n * @environment SHOPIFY_FLAG_NAME\n */\n '-n, --name '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themeduplicate {\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Force the duplicate operation to run without prompts or confirmations.\n * @environment SHOPIFY_FLAG_FORCE\n */\n '-f, --force'?: ''\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Name of the newly duplicated theme.\n * @environment SHOPIFY_FLAG_NAME\n */\n '-n, --name '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -6773,7 +6773,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -6805,7 +6805,7 @@ "environmentValue": "SHOPIFY_FLAG_THEME_ID" } ], - "value": "export interface themeinfo {\n /**\n * Retrieve info from your development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themeinfo {\n /**\n * Retrieve info from your development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -7049,7 +7049,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -7072,7 +7072,7 @@ "environmentValue": "SHOPIFY_FLAG_STORE" } ], - "value": "export interface themelist {\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Only list theme with the given ID.\n * @environment SHOPIFY_FLAG_ID\n */\n '--id '?: string\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Only list themes that contain the given name.\n * @environment SHOPIFY_FLAG_NAME\n */\n '--name '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Only list themes with the given role.\n * @environment SHOPIFY_FLAG_ROLE\n */\n '--role '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themelist {\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Only list theme with the given ID.\n * @environment SHOPIFY_FLAG_ID\n */\n '--id '?: string\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Only list themes that contain the given name.\n * @environment SHOPIFY_FLAG_NAME\n */\n '--name '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Only list themes with the given role.\n * @environment SHOPIFY_FLAG_ROLE\n */\n '--role '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -7150,7 +7150,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -7164,7 +7164,7 @@ "environmentValue": "SHOPIFY_FLAG_STORE" } ], - "value": "export interface thememetafieldspull {\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface thememetafieldspull {\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -7260,7 +7260,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -7292,7 +7292,7 @@ "environmentValue": "SHOPIFY_FLAG_THEME_ID" } ], - "value": "export interface themeopen {\n /**\n * Open your development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * Open the theme editor for the specified theme in the browser.\n * @environment SHOPIFY_FLAG_EDITOR\n */\n '-E, --editor'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Open your live (published) theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themeopen {\n /**\n * Open your development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * Open the theme editor for the specified theme in the browser.\n * @environment SHOPIFY_FLAG_EDITOR\n */\n '-E, --editor'?: ''\n\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Open your live (published) theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -7470,7 +7470,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -7492,7 +7492,7 @@ "environmentValue": "SHOPIFY_FLAG_THEME_ID" } ], - "value": "export interface themepreview {\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Output the preview URL and identifier as JSON.\n * @environment SHOPIFY_FLAG_JSON\n */\n '--json'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Automatically launch the theme preview in your default web browser.\n * @environment SHOPIFY_FLAG_OPEN\n */\n '--open'?: ''\n\n /**\n * Path to a JSON overrides file.\n * @environment SHOPIFY_FLAG_OVERRIDES\n */\n '--overrides ': string\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * An existing preview identifier to update instead of creating a new preview.\n * @environment SHOPIFY_FLAG_PREVIEW_ID\n */\n '--preview-id '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme ': string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themepreview {\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Output the preview URL and identifier as JSON.\n * @environment SHOPIFY_FLAG_JSON\n */\n '--json'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Automatically launch the theme preview in your default web browser.\n * @environment SHOPIFY_FLAG_OPEN\n */\n '--open'?: ''\n\n /**\n * Path to a JSON overrides file.\n * @environment SHOPIFY_FLAG_OVERRIDES\n */\n '--overrides ': string\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * An existing preview identifier to update instead of creating a new preview.\n * @environment SHOPIFY_FLAG_PREVIEW_ID\n */\n '--preview-id '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme ': string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -7588,7 +7588,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -7620,7 +7620,7 @@ "environmentValue": "SHOPIFY_FLAG_THEME_ID" } ], - "value": "export interface themeprofile {\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * The password for storefronts with password protection.\n * @environment SHOPIFY_FLAG_STORE_PASSWORD\n */\n '--store-password '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * The url to be used as context\n * @environment SHOPIFY_FLAG_URL\n */\n '--url '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themeprofile {\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * The password for storefronts with password protection.\n * @environment SHOPIFY_FLAG_STORE_PASSWORD\n */\n '--store-password '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * The url to be used as context\n * @environment SHOPIFY_FLAG_URL\n */\n '--url '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -7698,7 +7698,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -7730,7 +7730,7 @@ "environmentValue": "SHOPIFY_FLAG_THEME_ID" } ], - "value": "export interface themepublish {\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Skip confirmation.\n * @environment SHOPIFY_FLAG_FORCE\n */\n '-f, --force'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themepublish {\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Skip confirmation.\n * @environment SHOPIFY_FLAG_FORCE\n */\n '-f, --force'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -7817,7 +7817,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -7876,7 +7876,7 @@ "environmentValue": "SHOPIFY_FLAG_IGNORE" } ], - "value": "export interface themepull {\n /**\n * Pull theme files from your remote development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Skip downloading the specified files (Multiple flags allowed). Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_IGNORE\n */\n '-x, --ignore '?: string\n\n /**\n * Pull theme files from your remote live theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Prevent deleting local files that don't exist remotely.\n * @environment SHOPIFY_FLAG_NODELETE\n */\n '-n, --nodelete'?: ''\n\n /**\n * Download only the specified files (Multiple flags allowed). Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ONLY\n */\n '-o, --only '?: string\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themepull {\n /**\n * Pull theme files from your remote development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Skip downloading the specified files (Multiple flags allowed). Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_IGNORE\n */\n '-x, --ignore '?: string\n\n /**\n * Pull theme files from your remote live theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Prevent deleting local files that don't exist remotely.\n * @environment SHOPIFY_FLAG_NODELETE\n */\n '-n, --nodelete'?: ''\n\n /**\n * Download only the specified files (Multiple flags allowed). Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ONLY\n */\n '-o, --only '?: string\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -7999,7 +7999,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -8085,7 +8085,7 @@ "environmentValue": "SHOPIFY_FLAG_IGNORE" } ], - "value": "export interface themepush {\n /**\n * Allow push to a live theme.\n * @environment SHOPIFY_FLAG_ALLOW_LIVE\n */\n '-a, --allow-live'?: ''\n\n /**\n * Push theme files from your remote development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * Unique identifier for a development theme context (e.g., PR number, branch name). Reuses an existing development theme with this context name, or creates one if none exists.\n * @environment SHOPIFY_FLAG_DEVELOPMENT_CONTEXT\n */\n '-c, --development-context '?: string\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Skip uploading the specified files (Multiple flags allowed). Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_IGNORE\n */\n '-x, --ignore '?: string\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.\n * @environment SHOPIFY_FLAG_LISTING\n */\n '--listing '?: string\n\n /**\n * Push theme files from your remote live theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Prevent deleting remote files that don't exist locally.\n * @environment SHOPIFY_FLAG_NODELETE\n */\n '-n, --nodelete'?: ''\n\n /**\n * Upload only the specified files (Multiple flags allowed). Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ONLY\n */\n '-o, --only '?: string\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Publish as the live theme after uploading.\n * @environment SHOPIFY_FLAG_PUBLISH\n */\n '-p, --publish'?: ''\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Require theme check to pass without errors before pushing. Warnings are allowed.\n * @environment SHOPIFY_FLAG_STRICT_PUSH\n */\n '--strict'?: ''\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Create a new unpublished theme and push to it.\n * @environment SHOPIFY_FLAG_UNPUBLISHED\n */\n '-u, --unpublished'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themepush {\n /**\n * Allow push to a live theme.\n * @environment SHOPIFY_FLAG_ALLOW_LIVE\n */\n '-a, --allow-live'?: ''\n\n /**\n * Push theme files from your remote development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * Unique identifier for a development theme context (e.g., PR number, branch name). Reuses an existing development theme with this context name, or creates one if none exists.\n * @environment SHOPIFY_FLAG_DEVELOPMENT_CONTEXT\n */\n '-c, --development-context '?: string\n\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Skip uploading the specified files (Multiple flags allowed). Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_IGNORE\n */\n '-x, --ignore '?: string\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.\n * @environment SHOPIFY_FLAG_LISTING\n */\n '--listing '?: string\n\n /**\n * Push theme files from your remote live theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Prevent deleting remote files that don't exist locally.\n * @environment SHOPIFY_FLAG_NODELETE\n */\n '-n, --nodelete'?: ''\n\n /**\n * Upload only the specified files (Multiple flags allowed). Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ONLY\n */\n '-o, --only '?: string\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Publish as the live theme after uploading.\n * @environment SHOPIFY_FLAG_PUBLISH\n */\n '-p, --publish'?: ''\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Require theme check to pass without errors before pushing. Warnings are allowed.\n * @environment SHOPIFY_FLAG_STRICT_PUSH\n */\n '--strict'?: ''\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Create a new unpublished theme and push to it.\n * @environment SHOPIFY_FLAG_UNPUBLISHED\n */\n '-u, --unpublished'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -8172,7 +8172,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -8213,7 +8213,7 @@ "environmentValue": "SHOPIFY_FLAG_THEME_ID" } ], - "value": "export interface themerename {\n /**\n * Rename your development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Rename your remote live theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * The new name for the theme.\n * @environment SHOPIFY_FLAG_NEW_NAME\n */\n '-n, --name '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themerename {\n /**\n * Rename your development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * Rename your remote live theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * The new name for the theme.\n * @environment SHOPIFY_FLAG_NEW_NAME\n */\n '-n, --name '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } @@ -8300,7 +8300,7 @@ "syntaxKind": "PropertySignature", "name": "-e, --environment ", "value": "string", - "description": "The environment to apply to the current command.", + "description": "The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.", "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ENVIRONMENT" }, @@ -8314,7 +8314,7 @@ "environmentValue": "SHOPIFY_FLAG_STORE" } ], - "value": "export interface themeshare {\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.\n * @environment SHOPIFY_FLAG_LISTING\n */\n '--listing '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface themeshare {\n /**\n * The environment to apply to the current command. Supports glob patterns (e.g. \"*-production\"). Patterns that resolve to multiple environments only work on commands that support multiple environments. Wrap the value in double quotes if you're using wildcards.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment '?: string\n\n /**\n * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.\n * @environment SHOPIFY_FLAG_LISTING\n */\n '--listing '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password '?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path '?: string\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store '?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } } } diff --git a/packages/cli-kit/src/public/node/base-command.test.ts b/packages/cli-kit/src/public/node/base-command.test.ts index 30dfe245fed..ee879c6acc2 100644 --- a/packages/cli-kit/src/public/node/base-command.test.ts +++ b/packages/cli-kit/src/public/node/base-command.test.ts @@ -197,18 +197,37 @@ describe('applying environments', async () => { }, ) - runTestInTmpDir('does not apply flags when multiple environments are specified', async (tmpDir: string) => { + runTestInTmpDir('deduplicates identical environments and applies single-env path', async (tmpDir: string) => { // Given const outputMock = mockAndCaptureOutput() outputMock.clear() - // When + // When — duplicate environments are deduplicated to a single entry await MockCommand.run(['--path', tmpDir, '--environment', 'validEnvironment', '--environment', 'validEnvironment']) + // Then — deduplicated to one environment, so single-env path applies flags + expectFlags(tmpDir, 'validEnvironment') + }) + + runTestInTmpDir('does not apply flags when multiple distinct environments are specified', async (tmpDir: string) => { + // Given + const outputMock = mockAndCaptureOutput() + outputMock.clear() + + // When + await MockCommand.run([ + '--path', + tmpDir, + '--environment', + 'validEnvironment', + '--environment', + 'environmentWithPassword', + ]) + // Then expect(testResult).toEqual({ path: resolvePath(tmpDir), - environment: ['validEnvironment', 'validEnvironment'], + environment: ['validEnvironment', 'environmentWithPassword'], someStringWithDefault: 'default stringy', }) expect(outputMock.info()).toEqual('') @@ -339,7 +358,7 @@ describe('applying environments', async () => { // When await MockCommand.run(['--path', tmpDir, '--environment', 'nonexistentEnvironment']) - // Then + // Then — expansion found no match, original flags preserved unchanged expect(testResult).toEqual({ path: resolvePath(tmpDir), environment: ['nonexistentEnvironment'], @@ -493,6 +512,69 @@ describe('applying environments', async () => { `) }) + describe('glob pattern expansion', () => { + runTestInTmpDir('expands a glob pattern matching one environment to single-env path', async (tmpDir: string) => { + // Given + const outputMock = mockAndCaptureOutput() + outputMock.clear() + + // When — "*WithPassword" matches only "environmentWithPassword" + await MockCommand.run(['--path', tmpDir, '--environment', '*WithPassword']) + + // Then — single-env path applies the environment's flags + expectFlags(tmpDir, 'environmentWithPassword') + }) + + runTestInTmpDir( + 'expands a glob pattern matching multiple environments to multi-env passthrough', + async (tmpDir: string) => { + // Given + const outputMock = mockAndCaptureOutput() + outputMock.clear() + + // When — "valid*" matches "validEnvironment" and "validEnvironmentWithIrrelevantFlag" + await MockCommand.run(['--path', tmpDir, '--environment', 'valid*']) + + // Then — multi-env path: flags are not applied, expanded names are passed through + expect(testResult).toEqual({ + path: resolvePath(tmpDir), + environment: ['validEnvironment', 'validEnvironmentWithIrrelevantFlag'], + someStringWithDefault: 'default stringy', + }) + expect(outputMock.info()).toEqual('') + }, + ) + + runTestInTmpDir('returns original result when glob pattern matches nothing', async (tmpDir: string) => { + // Given + const outputMock = mockAndCaptureOutput() + outputMock.clear() + + // When + await MockCommand.run(['--path', tmpDir, '--environment', '*-nonexistent']) + + // Then — no environment applied, original flags preserved unchanged + expect(testResult).toEqual({ + path: resolvePath(tmpDir), + environment: ['*-nonexistent'], + someStringWithDefault: 'default stringy', + }) + expect(outputMock.warn()).toMatch(/No environments matching/) + }) + + runTestInTmpDir('literal names still work unchanged', async (tmpDir: string) => { + // Given + const outputMock = mockAndCaptureOutput() + outputMock.clear() + + // When + await MockCommand.run(['--path', tmpDir, '--environment', 'validEnvironment']) + + // Then + expectFlags(tmpDir, 'validEnvironment') + }) + }) + test('shows a warning about NPM separator when using a flag that matches a NPM config env variable', async () => { // Given const outputMock = mockAndCaptureOutput() diff --git a/packages/cli-kit/src/public/node/base-command.ts b/packages/cli-kit/src/public/node/base-command.ts index e5b5f8398c8..12d0bd8627c 100644 --- a/packages/cli-kit/src/public/node/base-command.ts +++ b/packages/cli-kit/src/public/node/base-command.ts @@ -1,5 +1,5 @@ import {errorHandler, registerCleanBugsnagErrorsFromWithinPlugins} from './error-handler.js' -import {loadEnvironment, environmentFilePath} from './environments.js' +import {loadEnvironment, environmentFilePath, expandEnvironmentPatterns} from './environments.js' import {isDevelopment} from './context/local.js' import {addPublicMetadata} from './metadata.js' import {AbortError} from './error.js' @@ -146,18 +146,33 @@ This flag is required in non-interactive terminal environments, such as a CI env const environmentFileExists = await environmentFilePath(environmentsFileName, {from: flags.path}) // Handle both string and array cases for environment flag - let environments: string[] = [] + let environmentPatterns: string[] = [] if (flags.environment) { - environments = Array.isArray(flags.environment) ? flags.environment : [flags.environment] + environmentPatterns = Array.isArray(flags.environment) ? flags.environment : [flags.environment] } - const environmentSpecified = environments.length > 0 + const environmentSpecified = environmentPatterns.length > 0 // Noop if no environment file exists and none was specified if (!environmentFileExists && !environmentSpecified) return originalResult + // Expand glob patterns (e.g. "*-production") against available environment names. + // Literal names pass through unchanged via minimatch identity matching. + // Only mutate flags.environment when expansion produced results — otherwise + // preserve the original values so loadEnvironment() can surface proper errors. + let environments = environmentPatterns + if (environmentSpecified && environmentFileExists) { + const expandedEnvironments = await expandEnvironmentPatterns(environmentPatterns, environmentsFileName, { + from: flags.path, + }) + if (expandedEnvironments.length === 0) return originalResult + environments = expandedEnvironments + // eslint-disable-next-line require-atomic-updates + flags.environment = environments + } + // Noop if multiple environments were specified (let commands handle this) - if (environmentSpecified && environments.length > 1) return originalResult + if (environments.length > 1) return originalResult const {environment, isDefaultEnvironment} = await this.loadEnvironmentForCommand( flags.path, @@ -182,6 +197,13 @@ This flag is required in non-interactive terminal environments, such as a CI env ...(isDefaultEnvironment ? ['--environment', 'default'] : []), ]) + // When the user specified environment patterns, ensure the flag reflects + // the expanded name rather than the original glob pattern. + if (environmentSpecified) { + const resultFlags = result.flags as EnvironmentFlags + resultFlags.environment = environments + } + // Report successful application of the environment. reportEnvironmentApplication( noDefaultsResult.flags, diff --git a/packages/cli-kit/src/public/node/environments.test.ts b/packages/cli-kit/src/public/node/environments.test.ts index e646a8a80ca..0f89fc73fbb 100644 --- a/packages/cli-kit/src/public/node/environments.test.ts +++ b/packages/cli-kit/src/public/node/environments.test.ts @@ -132,3 +132,152 @@ describe('loading environments', async () => { }) }) }) + +const globFileName = 'shopify.theme.toml' +const globEnvironments = { + 'us-production': {store: 'us.myshopify.com'}, + 'eu-production': {store: 'eu.myshopify.com'}, + 'int-production': {store: 'int.myshopify.com'}, + staging: {store: 'staging.myshopify.com'}, + development: {store: 'dev.myshopify.com'}, +} + +describe('getEnvironmentNames', () => { + test('returns all environment names', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + + const names = await environments.getEnvironmentNames(globFileName, {from: tmpDir}) + + expect(names).toEqual(['us-production', 'eu-production', 'int-production', 'staging', 'development']) + }) + }) + + test('returns empty array when no file exists', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const names = await environments.getEnvironmentNames(globFileName, {from: tmpDir}) + + expect(names).toEqual([]) + }) + }) + + test('returns empty array when no environments section exists', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, '# no content') + + const names = await environments.getEnvironmentNames(globFileName, {from: tmpDir}) + + expect(names).toEqual([]) + }) + }) +}) + +describe('expandEnvironmentPatterns', () => { + test('passes through literal names unchanged', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + + const result = await environments.expandEnvironmentPatterns(['staging'], globFileName, {from: tmpDir}) + + expect(result).toEqual(['staging']) + }) + }) + + test('expands * wildcard to matching environments', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + + const result = await environments.expandEnvironmentPatterns(['*-production'], globFileName, {from: tmpDir}) + + expect(result).toEqual(['us-production', 'eu-production', 'int-production']) + }) + }) + + test('expands ? single-character wildcard', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + + const result = await environments.expandEnvironmentPatterns(['??-production'], globFileName, {from: tmpDir}) + + expect(result).toEqual(['us-production', 'eu-production']) + }) + }) + + test('expands [abc] character class', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + + const result = await environments.expandEnvironmentPatterns(['[ue]*-production'], globFileName, {from: tmpDir}) + + expect(result).toEqual(['us-production', 'eu-production']) + }) + }) + + test('expands {a,b} brace expansion', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + + const result = await environments.expandEnvironmentPatterns(['{us,eu}-production'], globFileName, {from: tmpDir}) + + expect(result).toEqual(['us-production', 'eu-production']) + }) + }) + + test('deduplicates environments matched by multiple patterns', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + + const result = await environments.expandEnvironmentPatterns(['us-*', '*-production'], globFileName, { + from: tmpDir, + }) + + expect(result).toEqual(['us-production', 'eu-production', 'int-production']) + }) + }) + + test('warns when a pattern matches nothing', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + const outputMock = mockAndCaptureOutput() + outputMock.clear() + + const result = await environments.expandEnvironmentPatterns(['*-sandbox'], globFileName, {from: tmpDir}) + + expect(result).toEqual([]) + expect(outputMock.warn()).toMatch(/No environments matching/) + }) + }) + + test('returns matches from valid patterns even when another pattern matches nothing', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const filePath = joinPath(tmpDir, globFileName) + await writeFile(filePath, tomlEncode({environments: globEnvironments})) + const outputMock = mockAndCaptureOutput() + outputMock.clear() + + const result = await environments.expandEnvironmentPatterns(['staging', '*-sandbox'], globFileName, { + from: tmpDir, + }) + + expect(result).toEqual(['staging']) + expect(outputMock.warn()).toMatch(/No environments matching/) + }) + }) + + test('returns empty array when no environments file exists', async () => { + await inTemporaryDirectory(async (tmpDir) => { + const result = await environments.expandEnvironmentPatterns(['*'], globFileName, {from: tmpDir}) + + expect(result).toEqual([]) + }) + }) +}) diff --git a/packages/cli-kit/src/public/node/environments.ts b/packages/cli-kit/src/public/node/environments.ts index 72d1d69be4b..a0b4163510b 100644 --- a/packages/cli-kit/src/public/node/environments.ts +++ b/packages/cli-kit/src/public/node/environments.ts @@ -4,6 +4,7 @@ import {cwd} from './path.js' import * as metadata from './metadata.js' import {renderWarning} from './ui.js' import {JsonMap} from '../../private/common/json.js' +import {minimatch} from 'minimatch' export type Environments = Record @@ -24,15 +25,13 @@ function renderWarningIfNeeded(message: Parameters[0], sil } /** - * Loads environments from a file. - * @param dir - The file path to load environments from. - * @returns The loaded environments. + * Reads and parses the environments section from a TOML file. + * Returns the environments record or undefined if the file or section is missing. */ -export async function loadEnvironment( - environmentName: string, +async function decodeEnvironments( fileName: string, options?: LoadEnvironmentOptions, -): Promise { +): Promise { const filePath = await environmentFilePath(fileName, options) if (!filePath) { renderWarningIfNeeded({body: 'Environment file not found.'}, options?.silent) @@ -50,8 +49,18 @@ export async function loadEnvironment( ) return undefined } - const environment = environments[environmentName] as JsonMap | undefined + return environments as Environments +} +export async function loadEnvironment( + environmentName: string, + fileName: string, + options?: LoadEnvironmentOptions, +): Promise { + const environments = await decodeEnvironments(fileName, options) + if (!environments) return undefined + + const environment = environments[environmentName] as JsonMap | undefined if (!environment) { renderWarningIfNeeded( { @@ -69,6 +78,49 @@ export async function loadEnvironment( return environment } +/** + * Returns all environment names defined in the TOML file. + */ +export async function getEnvironmentNames( + fileName: string, + options?: LoadEnvironmentOptions, +): Promise { + const environments = await decodeEnvironments(fileName, {silent: true, ...options}) + if (!environments) return [] + return Object.keys(environments) +} + +/** + * Expands glob patterns against all available environment names. + * Literal (non-glob) names pass through unchanged via minimatch identity matching. + * Warns for each pattern that matches nothing. + */ +export async function expandEnvironmentPatterns( + patterns: string[], + fileName: string, + options?: LoadEnvironmentOptions, +): Promise { + const allNames = await getEnvironmentNames(fileName, options) + if (allNames.length === 0) return [] + + const matched = new Set() + for (const pattern of patterns) { + const matches = allNames.filter((name) => minimatch(name, pattern)) + if (matches.length === 0) { + renderWarningIfNeeded( + { + body: ['No environments matching', {command: pattern}, 'were found.'], + }, + options?.silent, + ) + } + for (const match of matches) { + matched.add(match) + } + } + return Array.from(matched) +} + export async function environmentFilePath( fileName: string, options?: LoadEnvironmentOptions, diff --git a/packages/cli/README.md b/packages/cli/README.md index ce2d7756c14..02db8ecdd4d 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -2141,6 +2141,9 @@ FLAGS For backwards compatibility, :theme_app_extension is also supported -a, --auto-correct [env: SHOPIFY_FLAG_AUTO_CORRECT] Automatically fix offenses -e, --environment=... [env: SHOPIFY_FLAG_ENVIRONMENT] The environment to apply to the current command. + Supports glob patterns (e.g. "*-production"). Patterns that resolve to multiple + environments only work on commands that support multiple environments. Wrap the value in + double quotes if you're using wildcards. -o, --output=