cli icon indicating copy to clipboard operation
cli copied to clipboard

Add basic list commands and prpepare create and delete

Open alfonso-noriega opened this issue 3 months ago β€’ 5 comments

[Feature] Add store list command to display development stores

WHY are these changes introduced?

To provide CLI users with the ability to view their development stores directly from the command line, making it easier to manage and work with their development environments.

WHAT is this pull request doing?

  • Adds a new shopify store list command that displays development stores in the user's organization
  • Implements the service logic to fetch and display stores from the Business Platform API
  • Updates the CLI documentation to include the new command
  • Sets up the necessary file structure for future store management commands

How to test your changes?

Set up:

  • make sure you have the branch in the world prototype checked out locally
  • generate the GraphQL schemas in world: dev dump-graphql
  • in the CLI, get the graphql schemas: SHOPIFY_SERVICE_ENV=local pnpm graphql-codegen:get-graphql-schemas
  • in the CLI, generate types from those schemas: pnpm graphql-codegen
  • just in case, in the CLI, clean the cache: pnpm clean

Test a dev store creation:

  1. Add the shop:create scope in identity (shopify-cli-development)
  2. Run shopify store list from the command line
  3. You should be prompted to select an organization if you have access to multiple
  4. The command should display a table of development stores with their names, domains, and IDs
  5. Verify that the output is correctly formatted and contains the expected information

Other commands:

  • SHOPIFY_CLI_NEVER_USE_PARTNERS_API=1 SHOPIFY_SERVICE_ENV=local pnpm shopify store create
  • SHOPIFY_CLI_NEVER_USE_PARTNERS_API=1 SHOPIFY_SERVICE_ENV=local pnpm shopify store delete

Measuring impact

How do we know this change was effective? Please choose one:

  • [ ] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • [x] Existing analytics will cater for this addition
  • [ ] PR includes analytics changes to measure impact

Checklist

  • [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • [x] I've considered possible documentation changes

alfonso-noriega avatar Sep 17 '25 14:09 alfonso-noriega

This stack of pull requests is managed by Graphite. Learn more about stacking.

alfonso-noriega avatar Sep 17 '25 14:09 alfonso-noriega

Unused dependencies (1)

Filename dependencies
packages/store/package.json @oclif/core

Unused exports (3)

Filename exports
packages/store/src/cli/utilities/app-dev-store-client.ts encodedGidFromOrganizationIdForBP
encodedGidFromShopId
gidFromShopIdForShopify

github-actions[bot] avatar Sep 17 '25 14:09 github-actions[bot]

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
78.1% (-0.52% πŸ”»)
13514/17303
🟑 Branches
72.13% (-0.5% πŸ”»)
6562/9098
🟑 Functions
78.37% (-0.5% πŸ”»)
3510/4479
🟑 Lines
78.45% (-0.51% πŸ”»)
12774/16284
Show new covered files 🐣
St.:grey_question:
File Statements Branches Functions Lines
🟒
... / flow-template.ts
100% 100% 100% 100%
πŸ”΄
... / organizations.ts
0% 100% 100% 0%
πŸ”΄
... / user-info.ts
0% 100% 100% 0%
πŸ”΄
... / create_app_development_store.ts
0% 100% 100% 0%
πŸ”΄
... / fetch_dev_store_by_domain.ts
0% 100% 100% 0%
πŸ”΄
... / list_app_dev_stores.ts
0% 100% 100% 0%
πŸ”΄
... / app-dev-store-client.ts
0% 0% 0% 0%
πŸ”΄
... / create.ts
0% 100% 0% 0%
πŸ”΄
... / list.ts
0% 100% 0% 0%
πŸ”΄
... / create.ts
0% 0% 0% 0%
πŸ”΄
... / list.ts
0% 0% 0% 0%
Show files with reduced coverage πŸ”»
St.:grey_question:
File Statements Branches Functions Lines
🟒
... / app.ts
86.49% (-0.07% πŸ”»)
68.57%
93.44% (-0.11% πŸ”»)
88.2% (-0.07% πŸ”»)
🟒
... / extension-instance.ts
82.68% (-0.38% πŸ”»)
77.6% (-1.14% πŸ”»)
92.73%
82.42% (-0.42% πŸ”»)
🟒
... / write-app-logs.ts
90% (-0.48% πŸ”»)
100% 100%
90% (-0.48% πŸ”»)
πŸ”΄
... / extension.ts
57.38% (-2.97% πŸ”»)
60%
44.44% (-5.56% πŸ”»)
58.33% (-3.07% πŸ”»)
🟒
... / app-event-watcher.ts
97.62% (-0.11% πŸ”»)
91.43% 95.45% 100%
🟒
... / bundle.ts
82.35% (-10.87% πŸ”»)
66.67%
73.33% (-14.9% πŸ”»)
83.67% (-12.62% πŸ”»)
πŸ”΄
... / app-management-client.ts
53.45% (-0.32% πŸ”»)
47.06% (-0.62% πŸ”»)
49.09% (-0.45% πŸ”»)
52.26% (-0.17% πŸ”»)
🟒
... / session.ts
89.6% (-1.51% πŸ”»)
77.53% (-1.47% πŸ”»)
91.67% (-0.64% πŸ”»)
88.98% (-1.57% πŸ”»)
🟒
... / headers.ts
100%
87.5% (-2.5% πŸ”»)
100% 100%
πŸ”΄
... / schema.ts
44.44% (-25.56% πŸ”»)
0% (-50% πŸ”»)
0% (-50% πŸ”»)
50% (-16.67% πŸ”»)
πŸ”΄
... / store.ts
50% (-43.55% πŸ”»)
25% (-68.75% πŸ”»)
100%
50% (-42.59% πŸ”»)
🟒
... / Tasks.tsx
94% (-6% πŸ”»)
93.1% (-6.9% πŸ”»)
88.89% (-11.11% πŸ”»)
93.62% (-6.38% πŸ”»)
🟒
... / environments.ts
100%
91.67% (-8.33% πŸ”»)
100% 100%
🟒
... / session.ts
97.96% (+3.73% πŸ”Ό)
100% (+4.88% πŸ”Ό)
85.71% (-1.79% πŸ”»)
97.96% (+3.73% πŸ”Ό)
πŸ”΄
... / ui.tsx
49.15% (-2.46% πŸ”»)
42.86% (-5.53% πŸ”»)
51.61% (-1.51% πŸ”»)
48.28% (-2.54% πŸ”»)
🟑
... / flags.ts
71.43% (-19.48% πŸ”»)
100%
50% (-25% πŸ”»)
66.67% (-23.33% πŸ”»)
🟒
... / theme-command.ts
85.71% (-0.24% πŸ”»)
68.25% (-1.9% πŸ”»)
83.33%
87.04% (-0.24% πŸ”»)
🟒
... / theme-uploader.ts
93.22% (-0.04% πŸ”»)
79.63% (-0.73% πŸ”»)
92.19%
94.3% (-0.04% πŸ”»)

Test suite run success

3241 tests passing in 1360 suites.

Report generated by πŸ§ͺjest coverage report action from ec611a33494db1462f450293d17c7c61a411694e

github-actions[bot] avatar Sep 19 '25 16:09 github-actions[bot]

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

packages/cli-kit/dist/public/node/api/dev-store.d.ts
import { CacheOptions, GraphQLResponse, UnauthorizedHandler } from './graphql.js';
import { RequestModeInput } from '../http.js';
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
import { Variables } from 'graphql-request';
export declare const devStoresHeaders: (token: string) => {
    [key: string]: string;
};
export interface RequestOptions {
    requestMode: RequestModeInput;
}
/**
 * @param organizationId - The organization ID.
 * @param query - GraphQL query to execute.
 * @param token - Partners token.
 * @param variables - GraphQL variables to pass to the query.
 * @param cacheOptions - Cache options for the request. If not present, the request will not be cached.
 * @param requestOptions - Preferred behaviour for the request.
 * @param unauthorizedHandler - Optional handler for unauthorized requests.
 */
export interface DevStoresRequestOptions<TResult, TVariables extends Variables> {
    query: TypedDocumentNode<TResult, TVariables>;
    shopFqdn: string;
    token: string;
    variables?: TVariables;
    cacheOptions?: CacheOptions;
    requestOptions?: RequestOptions;
    unauthorizedHandler: UnauthorizedHandler;
}
/**
 * Executes an org-scoped GraphQL query against the App Management API. Uses typed documents.
 *
 * @param options - The options for the request.
 * @returns The response of the query of generic type <T>.
 */
export declare function devStoresRequestDoc<TResult, TVariables extends Variables>(options: DevStoresRequestOptions<TResult, TVariables>): Promise<TResult>;
/**
 * Sets the next deprecation date from [GraphQL response extensions](https://www.apollographql.com/docs/resources/graphql-glossary/#extensions)
 * if `response.extensions.deprecations` objects contain a `supportedUntilDate` (ISO 8601-formatted string).
 *
 * @param response - The response of the query.
 */
export declare function handleDeprecations<T>(response: GraphQLResponse<T>): void;

Existing type declarations

packages/cli-kit/dist/public/node/context/fqdn.d.ts
@@ -18,6 +18,12 @@ export declare function adminFqdn(): Promise<string>;
  * @returns Fully-qualified domain of the App Management service we should interact with.
  */
 export declare function appManagementFqdn(): Promise<string>;
+/**
+ * It returns the Dev Store API service we should interact with.
+ *
+ * @returns Fully-qualified domain of the Dev Store service we should interact with.
+ */
+export declare function devStoreFqdn(): Promise<string>;
 /**
  * It returns the App Dev API service we should interact with.
  *

github-actions[bot] avatar Oct 15 '25 11:10 github-actions[bot]

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. β†’ If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

github-actions[bot] avatar Nov 15 '25 03:11 github-actions[bot]