From 942df86140a29078e93cb46dc939cdc205a23a20 Mon Sep 17 00:00:00 2001 From: Eric Lee Date: Tue, 2 Dec 2025 11:42:10 -0800 Subject: [PATCH] Move command from `shopify app execute` to `shopify app bulk execute` --- .../cli/commands/app/{ => bulk}/execute.ts | 16 +- packages/app/src/cli/index.ts | 4 +- packages/cli/oclif.manifest.json | 270 +++++++++--------- 3 files changed, 145 insertions(+), 145 deletions(-) rename packages/app/src/cli/commands/app/{ => bulk}/execute.ts (70%) diff --git a/packages/app/src/cli/commands/app/execute.ts b/packages/app/src/cli/commands/app/bulk/execute.ts similarity index 70% rename from packages/app/src/cli/commands/app/execute.ts rename to packages/app/src/cli/commands/app/bulk/execute.ts index 64e5cf0f8d..4d5b6fd3a6 100644 --- a/packages/app/src/cli/commands/app/execute.ts +++ b/packages/app/src/cli/commands/app/bulk/execute.ts @@ -1,13 +1,13 @@ -import {appFlags, bulkOperationFlags} from '../../flags.js' -import AppLinkedCommand, {AppLinkedCommandOutput} from '../../utilities/app-linked-command.js' -import {linkedAppContext} from '../../services/app-context.js' -import {storeContext} from '../../services/store-context.js' -import {executeBulkOperation} from '../../services/bulk-operations/execute-bulk-operation.js' +import {appFlags, bulkOperationFlags} from '../../../flags.js' +import AppLinkedCommand, {AppLinkedCommandOutput} from '../../../utilities/app-linked-command.js' +import {linkedAppContext} from '../../../services/app-context.js' +import {storeContext} from '../../../services/store-context.js' +import {executeBulkOperation} from '../../../services/bulk-operations/execute-bulk-operation.js' import {globalFlags} from '@shopify/cli-kit/node/cli' import {readStdinString} from '@shopify/cli-kit/node/system' import {AbortError} from '@shopify/cli-kit/node/error' -export default class Execute extends AppLinkedCommand { +export default class BulkExecute extends AppLinkedCommand { static summary = 'Execute bulk operations.' static description = 'Execute bulk operations against the Shopify Admin API.' @@ -21,13 +21,13 @@ export default class Execute extends AppLinkedCommand { } async run(): Promise { - const {flags} = await this.parse(Execute) + const {flags} = await this.parse(BulkExecute) const query = flags.query ?? (await readStdinString()) if (!query) { throw new AbortError( 'No query provided. Use the --query flag or pipe input via stdin.', - 'Example: echo "query { ... }" | shopify app execute', + 'Example: echo "query { ... }" | shopify app bulk execute', ) } diff --git a/packages/app/src/cli/index.ts b/packages/app/src/cli/index.ts index c979e9f029..a47f6252ef 100644 --- a/packages/app/src/cli/index.ts +++ b/packages/app/src/cli/index.ts @@ -10,7 +10,7 @@ import Logs from './commands/app/logs.js' import Sources from './commands/app/app-logs/sources.js' import EnvPull from './commands/app/env/pull.js' import EnvShow from './commands/app/env/show.js' -import Execute from './commands/app/execute.js' +import Execute from './commands/app/bulk/execute.js' import FunctionBuild from './commands/app/function/build.js' import FunctionReplay from './commands/app/function/replay.js' import FunctionRun from './commands/app/function/run.js' @@ -53,7 +53,7 @@ export const commands: {[key: string]: typeof AppLinkedCommand | typeof AppUnlin 'app:config:pull': ConfigPull, 'app:env:pull': EnvPull, 'app:env:show': EnvShow, - 'app:execute': Execute, + 'app:bulk:execute': Execute, 'app:generate:schema': GenerateSchema, 'app:function:build': FunctionBuild, 'app:function:replay': FunctionReplay, diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index 83fd30e850..8836013893 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -86,6 +86,141 @@ "strict": true, "summary": "Build the app, including extensions." }, + "app:bulk:execute": { + "aliases": [ + ], + "args": { + }, + "customPluginName": "@shopify/app", + "description": "Execute bulk operations against the Shopify Admin API.", + "flags": { + "client-id": { + "description": "The Client ID of your app.", + "env": "SHOPIFY_FLAG_CLIENT_ID", + "exclusive": [ + "config" + ], + "hasDynamicHelp": false, + "hidden": false, + "multiple": false, + "name": "client-id", + "type": "option" + }, + "config": { + "char": "c", + "description": "The name of the app configuration.", + "env": "SHOPIFY_FLAG_APP_CONFIG", + "hasDynamicHelp": false, + "hidden": false, + "multiple": false, + "name": "config", + "type": "option" + }, + "no-color": { + "allowNo": false, + "description": "Disable color output.", + "env": "SHOPIFY_FLAG_NO_COLOR", + "hidden": false, + "name": "no-color", + "type": "boolean" + }, + "output-file": { + "description": "The file path where results should be written. If not specified, results will be written to STDOUT.", + "env": "SHOPIFY_FLAG_OUTPUT_FILE", + "hasDynamicHelp": false, + "multiple": false, + "name": "output-file", + "type": "option" + }, + "path": { + "description": "The path to your app directory.", + "env": "SHOPIFY_FLAG_PATH", + "hasDynamicHelp": false, + "multiple": false, + "name": "path", + "noCacheDefault": true, + "type": "option" + }, + "query": { + "char": "q", + "description": "The GraphQL query or mutation to run as a bulk operation. If omitted, reads from standard input.", + "env": "SHOPIFY_FLAG_QUERY", + "hasDynamicHelp": false, + "multiple": false, + "name": "query", + "required": false, + "type": "option" + }, + "reset": { + "allowNo": false, + "description": "Reset all your settings.", + "env": "SHOPIFY_FLAG_RESET", + "exclusive": [ + "config" + ], + "hidden": false, + "name": "reset", + "type": "boolean" + }, + "store": { + "char": "s", + "description": "The store domain. Must be an existing dev store.", + "env": "SHOPIFY_FLAG_STORE", + "hasDynamicHelp": false, + "multiple": false, + "name": "store", + "type": "option" + }, + "variable-file": { + "description": "Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.", + "env": "SHOPIFY_FLAG_VARIABLE_FILE", + "exclusive": [ + "variables" + ], + "hasDynamicHelp": false, + "multiple": false, + "name": "variable-file", + "type": "option" + }, + "variables": { + "char": "v", + "description": "The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.", + "env": "SHOPIFY_FLAG_VARIABLES", + "exclusive": [ + "variable-file" + ], + "hasDynamicHelp": false, + "multiple": true, + "name": "variables", + "type": "option" + }, + "verbose": { + "allowNo": false, + "description": "Increase the verbosity of the output.", + "env": "SHOPIFY_FLAG_VERBOSE", + "hidden": false, + "name": "verbose", + "type": "boolean" + }, + "watch": { + "allowNo": false, + "description": "Wait for bulk operation results before exiting.", + "env": "SHOPIFY_FLAG_WATCH", + "name": "watch", + "type": "boolean" + } + }, + "hasDynamicHelp": false, + "hidden": true, + "hiddenAliases": [ + ], + "id": "app:bulk:execute", + "pluginAlias": "@shopify/cli", + "pluginName": "@shopify/cli", + "pluginType": "core", + "strict": true, + "summary": "Execute bulk operations." + }, "app:bulk:status": { "aliases": [ ], @@ -981,141 +1116,6 @@ "strict": true, "summary": "Display app and extensions environment variables." }, - "app:execute": { - "aliases": [ - ], - "args": { - }, - "customPluginName": "@shopify/app", - "description": "Execute bulk operations against the Shopify Admin API.", - "flags": { - "client-id": { - "description": "The Client ID of your app.", - "env": "SHOPIFY_FLAG_CLIENT_ID", - "exclusive": [ - "config" - ], - "hasDynamicHelp": false, - "hidden": false, - "multiple": false, - "name": "client-id", - "type": "option" - }, - "config": { - "char": "c", - "description": "The name of the app configuration.", - "env": "SHOPIFY_FLAG_APP_CONFIG", - "hasDynamicHelp": false, - "hidden": false, - "multiple": false, - "name": "config", - "type": "option" - }, - "no-color": { - "allowNo": false, - "description": "Disable color output.", - "env": "SHOPIFY_FLAG_NO_COLOR", - "hidden": false, - "name": "no-color", - "type": "boolean" - }, - "output-file": { - "description": "The file path where results should be written. If not specified, results will be written to STDOUT.", - "env": "SHOPIFY_FLAG_OUTPUT_FILE", - "hasDynamicHelp": false, - "multiple": false, - "name": "output-file", - "type": "option" - }, - "path": { - "description": "The path to your app directory.", - "env": "SHOPIFY_FLAG_PATH", - "hasDynamicHelp": false, - "multiple": false, - "name": "path", - "noCacheDefault": true, - "type": "option" - }, - "query": { - "char": "q", - "description": "The GraphQL query or mutation to run as a bulk operation. If omitted, reads from standard input.", - "env": "SHOPIFY_FLAG_QUERY", - "hasDynamicHelp": false, - "multiple": false, - "name": "query", - "required": false, - "type": "option" - }, - "reset": { - "allowNo": false, - "description": "Reset all your settings.", - "env": "SHOPIFY_FLAG_RESET", - "exclusive": [ - "config" - ], - "hidden": false, - "name": "reset", - "type": "boolean" - }, - "store": { - "char": "s", - "description": "The store domain. Must be an existing dev store.", - "env": "SHOPIFY_FLAG_STORE", - "hasDynamicHelp": false, - "multiple": false, - "name": "store", - "type": "option" - }, - "variable-file": { - "description": "Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.", - "env": "SHOPIFY_FLAG_VARIABLE_FILE", - "exclusive": [ - "variables" - ], - "hasDynamicHelp": false, - "multiple": false, - "name": "variable-file", - "type": "option" - }, - "variables": { - "char": "v", - "description": "The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.", - "env": "SHOPIFY_FLAG_VARIABLES", - "exclusive": [ - "variable-file" - ], - "hasDynamicHelp": false, - "multiple": true, - "name": "variables", - "type": "option" - }, - "verbose": { - "allowNo": false, - "description": "Increase the verbosity of the output.", - "env": "SHOPIFY_FLAG_VERBOSE", - "hidden": false, - "name": "verbose", - "type": "boolean" - }, - "watch": { - "allowNo": false, - "description": "Wait for bulk operation results before exiting.", - "env": "SHOPIFY_FLAG_WATCH", - "name": "watch", - "type": "boolean" - } - }, - "hasDynamicHelp": false, - "hidden": true, - "hiddenAliases": [ - ], - "id": "app:execute", - "pluginAlias": "@shopify/cli", - "pluginName": "@shopify/cli", - "pluginType": "core", - "strict": true, - "summary": "Execute bulk operations." - }, "app:function:build": { "aliases": [ ],