From 95e7f8d8fb5e9a9aff554c1dc1ead9bcfc7c9981 Mon Sep 17 00:00:00 2001 From: Ariel Caplan Date: Thu, 3 Sep 2026 22:43:31 +0300 Subject: [PATCH] Allow filtering `store list` by store type Adds `store list --type `, using the public store-type handles the listing already reports in its Type column and JSON output, so the filter and the data share one vocabulary. The filter is applied server-side via BP's `STORE_TYPE` shop filter rather than on the returned rows. That matters for correctness, not just ergonomics: the listing is capped at 250 stores, so filtering afterwards would report "no production stores" for an organization whose matches all sit past the cap. `dev` maps to BP's `development_superset` alias, which covers both `development` (legacy partner dev stores) and `app_development` (what `store create dev` makes), keeping `--type dev` a single query. Co-Authored-By: Claude Opus 5 (1M context) Assisted-By: devx/84554425-7df7-4dd7-8f8e-fa9581e69cdf --- .changeset/store-list-filter-by-store-type.md | 5 ++ .../generated/generated_docs_data_v2.json | 11 ++- packages/cli/README.md | 10 ++- packages/cli/oclif.manifest.json | 15 ++++ .../generated/list_accessible_shops.ts | 35 +++----- .../generated/types.d.ts | 56 +++++++++++++ .../queries/list_accessible_shops.graphql | 8 +- .../store/src/cli/commands/store/list.test.ts | 15 +++- packages/store/src/cli/commands/store/list.ts | 13 ++- .../store/src/cli/services/store/list.test.ts | 41 +++++++++- packages/store/src/cli/services/store/list.ts | 9 ++- .../cli/services/store/list/bp-source.test.ts | 47 +++++++++-- .../src/cli/services/store/list/bp-source.ts | 19 ++++- .../cli/services/store/list/result.test.ts | 80 +++++++++++++++++++ .../src/cli/services/store/list/result.ts | 18 +++-- .../src/cli/services/store/list/types.ts | 4 + .../src/cli/services/store/store-type.test.ts | 45 +++++++++++ .../src/cli/services/store/store-type.ts | 21 +++++ 18 files changed, 397 insertions(+), 55 deletions(-) create mode 100644 .changeset/store-list-filter-by-store-type.md create mode 100644 packages/store/src/cli/services/store/store-type.test.ts diff --git a/.changeset/store-list-filter-by-store-type.md b/.changeset/store-list-filter-by-store-type.md new file mode 100644 index 00000000000..29a90e860f6 --- /dev/null +++ b/.changeset/store-list-filter-by-store-type.md @@ -0,0 +1,5 @@ +--- +'@shopify/store': minor +--- + +Add `store list --type` to list only dev, production, client transfer, or collaborator stores diff --git a/docs-shopify.dev/generated/generated_docs_data_v2.json b/docs-shopify.dev/generated/generated_docs_data_v2.json index a9b8a5ccc48..441003ff768 100644 --- a/docs-shopify.dev/generated/generated_docs_data_v2.json +++ b/docs-shopify.dev/generated/generated_docs_data_v2.json @@ -5356,6 +5356,15 @@ "isOptional": true, "environmentValue": "SHOPIFY_FLAG_ORGANIZATION_ID" }, + { + "filePath": "docs-shopify.dev/commands/interfaces/store-list.interface.ts", + "syntaxKind": "PropertySignature", + "name": "--type ", + "value": "string", + "description": "List only stores of this type.", + "isOptional": true, + "environmentValue": "SHOPIFY_FLAG_STORE_TYPE" + }, { "filePath": "docs-shopify.dev/commands/interfaces/store-list.interface.ts", "syntaxKind": "PropertySignature", @@ -5375,7 +5384,7 @@ "environmentValue": "SHOPIFY_FLAG_JSON" } ], - "value": "export interface storelist {\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 * The numeric organization ID. Auto-selects if you belong to a single organization. Required if non interactive when more than one organization is available.\n * @environment SHOPIFY_FLAG_ORGANIZATION_ID\n */\n '--organization-id '?: string\n\n /**\n * Increase the verbosity of the output. May include sensitive data.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface storelist {\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 * The numeric organization ID. Auto-selects if you belong to a single organization. Required if non interactive when more than one organization is available.\n * @environment SHOPIFY_FLAG_ORGANIZATION_ID\n */\n '--organization-id '?: string\n\n /**\n * List only stores of this type.\n * @environment SHOPIFY_FLAG_STORE_TYPE\n */\n '--type '?: string\n\n /**\n * Increase the verbosity of the output. May include sensitive data.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } }, "storeopen": { diff --git a/packages/cli/README.md b/packages/cli/README.md index 6a71eba3728..df0ec415868 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -3872,7 +3872,8 @@ List stores in a Shopify organization. ``` USAGE - $ shopify store list [-j] [--no-color] [--organization-id ] [--verbose] + $ shopify store list [-j] [--no-color] [--organization-id ] [--type + dev|production|client_transfer|collaborator] [--verbose] FLAGS -j, --json @@ -3888,6 +3889,11 @@ FLAGS more than one organization is available. [env: SHOPIFY_FLAG_ORGANIZATION_ID] + --type=