From 7291fe78ae151010f4bde1c16acc072a81c5b9ba Mon Sep 17 00:00:00 2001 From: Richard Powell Date: Tue, 14 Apr 2026 15:44:28 -0400 Subject: [PATCH] Lazy command loading: plugin wrapper architecture (Option C) Extract app, theme, and hydrogen command re-exports from packages/cli into dedicated wrapper plugin packages (plugin-app, plugin-theme, plugin-hydrogen). Key changes: - Create packages/plugin-app/ with 34 command re-exports + app hooks - Create packages/plugin-theme/ with 20 command re-exports - Create packages/plugin-hydrogen/ with 26 command re-exports + init hook - Register all plugins in packages/cli oclif.plugins config - Move plugins to dependencies (required by oclif plugin loader) - Move init/metadata hooks from CLI to wrapper plugins - Remove app/theme/hydrogen/plugin commands from packages/cli/src/commands/ - Configure knip for new wrapper packages - Generate oclif manifests for all wrapper packages Performance: 3.765s mean (vs 1.778s main = +111.8% SLOWER) The plugin resolution overhead (loading 6 plugins, resolving packages, reading manifests) adds ~2s to startup. This approach provides the cleanest architecture but is the slowest option due to oclif's per-plugin loading cost. Co-Authored-By: Claude Opus 4.6 (1M context) --- package.json | 34 +- packages/cli/README.md | 2988 +----- packages/cli/oclif.manifest.json | 8821 +---------------- packages/cli/package.json | 32 +- packages/cli/project.json | 2 +- packages/cli/src/commands/commands.ts | 3 - .../src/commands/config/autocorrect/off.ts | 3 - .../cli/src/commands/config/autocorrect/on.ts | 3 - .../src/commands/config/autocorrect/status.ts | 3 - packages/cli/src/commands/plugins/index.ts | 5 - packages/cli/src/commands/plugins/inspect.ts | 3 - packages/cli/src/commands/plugins/install.ts | 5 - packages/cli/src/commands/plugins/link.ts | 3 - packages/cli/src/commands/plugins/reset.ts | 3 - .../cli/src/commands/plugins/uninstall.ts | 3 - packages/cli/src/commands/plugins/update.ts | 3 - packages/cli/src/hooks/app-init.ts | 9 - packages/cli/src/hooks/app-public-metadata.ts | 7 - .../cli/src/hooks/app-sensitive-metadata.ts | 7 - packages/cli/src/hooks/hydrogen-init.ts | 8 - packages/cli/src/hooks/prerun.ts | 32 +- packages/cli/src/index.ts | 5 +- packages/plugin-app/oclif.manifest.json | 3550 +++++++ packages/plugin-app/package.json | 27 + packages/plugin-app/project.json | 46 + .../src/commands/app/build.ts | 0 .../src/commands/app/bulk/cancel.ts | 0 .../src/commands/app/bulk/execute.ts | 0 .../src/commands/app/bulk/status.ts | 0 .../src/commands/app/config/link.ts | 0 .../src/commands/app/config/pull.ts | 0 .../src/commands/app/config/use.ts | 0 .../src/commands/app/config/validate.ts | 0 .../src/commands/app/deploy.ts | 0 .../src/commands/app/dev.ts | 0 .../src/commands/app/dev/clean.ts | 0 .../src/commands/app/env/pull.ts | 0 .../src/commands/app/env/show.ts | 0 .../src/commands/app/execute.ts | 0 .../src/commands/app/function/build.ts | 0 .../src/commands/app/function/info.ts | 0 .../src/commands/app/function/replay.ts | 0 .../src/commands/app/function/run.ts | 0 .../src/commands/app/function/schema.ts | 0 .../src/commands/app/function/typegen.ts | 0 .../src/commands/app/generate/extension.ts | 0 .../src/commands/app/generate/schema.ts | 0 .../app/import-custom-data-definitions.ts | 0 .../src/commands/app/import-extensions.ts | 0 .../src/commands/app/info.ts | 0 .../src/commands/app/init.ts | 0 .../src/commands/app/logs.ts | 0 .../src/commands/app/release.ts | 0 .../src/commands/app/versions/list.ts | 0 .../src/commands/app/webhook/trigger.ts | 0 .../src/commands/demo/watcher.ts | 0 .../src/commands/organization/list.ts | 0 .../src/commands/webhook/trigger.ts | 0 packages/plugin-app/src/hooks/init.ts | 1 + .../plugin-app/src/hooks/public-metadata.ts | 1 + .../src/hooks/sensitive-metadata.ts | 1 + packages/plugin-app/src/index.ts | 1 + packages/plugin-app/tsconfig.build.json | 7 + packages/plugin-app/tsconfig.json | 13 + packages/plugin-hydrogen/oclif.manifest.json | 1679 ++++ packages/plugin-hydrogen/package.json | 25 + packages/plugin-hydrogen/project.json | 46 + .../src/commands/hydrogen/build.ts | 0 .../src/commands/hydrogen/check.ts | 0 .../src/commands/hydrogen/codegen.ts | 0 .../hydrogen/customer-account-push.ts | 0 .../src/commands/hydrogen/debug/cpu.ts | 0 .../src/commands/hydrogen/deploy.ts | 0 .../src/commands/hydrogen/dev.ts | 0 .../src/commands/hydrogen/env/list.ts | 0 .../src/commands/hydrogen/env/pull.ts | 0 .../src/commands/hydrogen/env/push.ts | 0 .../src/commands/hydrogen/g.ts | 0 .../src/commands/hydrogen/generate/route.ts | 0 .../src/commands/hydrogen/generate/routes.ts | 0 .../src/commands/hydrogen/init.ts | 0 .../src/commands/hydrogen/link.ts | 0 .../src/commands/hydrogen/list.ts | 0 .../src/commands/hydrogen/login.ts | 0 .../src/commands/hydrogen/logout.ts | 0 .../src/commands/hydrogen/preview.ts | 0 .../src/commands/hydrogen/setup.ts | 0 .../src/commands/hydrogen/setup/css.ts | 0 .../src/commands/hydrogen/setup/markets.ts | 0 .../src/commands/hydrogen/setup/vite.ts | 0 .../src/commands/hydrogen/shortcut.ts | 0 .../src/commands/hydrogen/unlink.ts | 0 .../src/commands/hydrogen/upgrade.ts | 0 packages/plugin-hydrogen/src/hooks/init.ts | 4 + packages/plugin-hydrogen/src/index.ts | 1 + packages/plugin-hydrogen/tsconfig.build.json | 5 + packages/plugin-hydrogen/tsconfig.json | 11 + packages/plugin-theme/oclif.manifest.json | 2358 +++++ packages/plugin-theme/package.json | 22 + packages/plugin-theme/project.json | 46 + .../src/commands/theme/check.ts | 0 .../src/commands/theme/console.ts | 0 .../src/commands/theme/delete.ts | 0 .../src/commands/theme/dev.ts | 0 .../src/commands/theme/duplicate.ts | 0 .../src/commands/theme/info.ts | 0 .../src/commands/theme/init.ts | 0 .../src/commands/theme/language-server.ts | 0 .../src/commands/theme/list.ts | 0 .../src/commands/theme/metafields/pull.ts | 0 .../src/commands/theme/open.ts | 0 .../src/commands/theme/package.ts | 0 .../src/commands/theme/preview.ts | 0 .../src/commands/theme/profile.ts | 0 .../src/commands/theme/publish.ts | 0 .../src/commands/theme/pull.ts | 0 .../src/commands/theme/push.ts | 0 .../src/commands/theme/rename.ts | 0 .../src/commands/theme/serve.ts | 0 .../src/commands/theme/share.ts | 0 packages/plugin-theme/src/index.ts | 1 + packages/plugin-theme/tsconfig.build.json | 7 + packages/plugin-theme/tsconfig.json | 13 + pnpm-lock.yaml | 126 +- 124 files changed, 8248 insertions(+), 11725 deletions(-) delete mode 100644 packages/cli/src/commands/commands.ts delete mode 100644 packages/cli/src/commands/config/autocorrect/off.ts delete mode 100644 packages/cli/src/commands/config/autocorrect/on.ts delete mode 100644 packages/cli/src/commands/config/autocorrect/status.ts delete mode 100644 packages/cli/src/commands/plugins/index.ts delete mode 100644 packages/cli/src/commands/plugins/inspect.ts delete mode 100644 packages/cli/src/commands/plugins/install.ts delete mode 100644 packages/cli/src/commands/plugins/link.ts delete mode 100644 packages/cli/src/commands/plugins/reset.ts delete mode 100644 packages/cli/src/commands/plugins/uninstall.ts delete mode 100644 packages/cli/src/commands/plugins/update.ts delete mode 100644 packages/cli/src/hooks/app-init.ts delete mode 100644 packages/cli/src/hooks/app-public-metadata.ts delete mode 100644 packages/cli/src/hooks/app-sensitive-metadata.ts delete mode 100644 packages/cli/src/hooks/hydrogen-init.ts create mode 100644 packages/plugin-app/oclif.manifest.json create mode 100644 packages/plugin-app/package.json create mode 100644 packages/plugin-app/project.json rename packages/{cli => plugin-app}/src/commands/app/build.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/bulk/cancel.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/bulk/execute.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/bulk/status.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/config/link.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/config/pull.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/config/use.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/config/validate.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/deploy.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/dev.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/dev/clean.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/env/pull.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/env/show.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/execute.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/function/build.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/function/info.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/function/replay.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/function/run.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/function/schema.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/function/typegen.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/generate/extension.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/generate/schema.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/import-custom-data-definitions.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/import-extensions.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/info.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/init.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/logs.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/release.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/versions/list.ts (100%) rename packages/{cli => plugin-app}/src/commands/app/webhook/trigger.ts (100%) rename packages/{cli => plugin-app}/src/commands/demo/watcher.ts (100%) rename packages/{cli => plugin-app}/src/commands/organization/list.ts (100%) rename packages/{cli => plugin-app}/src/commands/webhook/trigger.ts (100%) create mode 100644 packages/plugin-app/src/hooks/init.ts create mode 100644 packages/plugin-app/src/hooks/public-metadata.ts create mode 100644 packages/plugin-app/src/hooks/sensitive-metadata.ts create mode 100644 packages/plugin-app/src/index.ts create mode 100644 packages/plugin-app/tsconfig.build.json create mode 100644 packages/plugin-app/tsconfig.json create mode 100644 packages/plugin-hydrogen/oclif.manifest.json create mode 100644 packages/plugin-hydrogen/package.json create mode 100644 packages/plugin-hydrogen/project.json rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/build.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/check.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/codegen.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/customer-account-push.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/debug/cpu.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/deploy.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/dev.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/env/list.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/env/pull.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/env/push.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/g.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/generate/route.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/generate/routes.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/init.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/link.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/list.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/login.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/logout.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/preview.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/setup.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/setup/css.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/setup/markets.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/setup/vite.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/shortcut.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/unlink.ts (100%) rename packages/{cli => plugin-hydrogen}/src/commands/hydrogen/upgrade.ts (100%) create mode 100644 packages/plugin-hydrogen/src/hooks/init.ts create mode 100644 packages/plugin-hydrogen/src/index.ts create mode 100644 packages/plugin-hydrogen/tsconfig.build.json create mode 100644 packages/plugin-hydrogen/tsconfig.json create mode 100644 packages/plugin-theme/oclif.manifest.json create mode 100644 packages/plugin-theme/package.json create mode 100644 packages/plugin-theme/project.json rename packages/{cli => plugin-theme}/src/commands/theme/check.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/console.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/delete.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/dev.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/duplicate.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/info.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/init.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/language-server.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/list.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/metafields/pull.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/open.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/package.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/preview.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/profile.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/publish.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/pull.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/push.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/rename.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/serve.ts (100%) rename packages/{cli => plugin-theme}/src/commands/theme/share.ts (100%) create mode 100644 packages/plugin-theme/src/index.ts create mode 100644 packages/plugin-theme/tsconfig.build.json create mode 100644 packages/plugin-theme/tsconfig.json diff --git a/package.json b/package.json index cd81b6826d4..abe274d84b5 100644 --- a/package.json +++ b/package.json @@ -209,11 +209,13 @@ "entry": [ "**/{commands,hooks}/**/*.ts!", "**/bin/*.js!", - "**/index.ts!" + "**/index.ts!", + "**/bootstrap.ts!" ], "project": "**/*.ts!", "ignoreDependencies": [ "@ast-grep/napi", + "@shopify/cli-hydrogen", "@shopify/theme-check-docs-updater", "@shopify/theme-check-node" ], @@ -297,6 +299,36 @@ ] } }, + "packages/plugin-app": { + "entry": [ + "**/{commands,hooks}/**/*.ts!", + "**/src/*.ts!" + ], + "project": "**/*.ts!", + "ignoreDependencies": [ + "@oclif/core" + ] + }, + "packages/plugin-theme": { + "entry": [ + "**/{commands,hooks}/**/*.ts!", + "**/src/*.ts!" + ], + "project": "**/*.ts!", + "ignoreDependencies": [ + "@oclif/core" + ] + }, + "packages/plugin-hydrogen": { + "entry": [ + "**/{commands,hooks}/**/*.ts!", + "**/src/*.ts!" + ], + "project": "**/*.ts!", + "ignoreDependencies": [ + "@oclif/core" + ] + }, "packages/ui-extensions-dev-console": { "entry": [ "**/src/main.tsx!" diff --git a/packages/cli/README.md b/packages/cli/README.md index 551fa5e4712..32d29d38d30 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -1,3012 +1,84 @@ # Commands -* [`shopify app build`](#shopify-app-build) -* [`shopify app bulk cancel`](#shopify-app-bulk-cancel) -* [`shopify app bulk execute`](#shopify-app-bulk-execute) -* [`shopify app bulk status`](#shopify-app-bulk-status) -* [`shopify app config link`](#shopify-app-config-link) -* [`shopify app config pull`](#shopify-app-config-pull) -* [`shopify app config use [config] [flags]`](#shopify-app-config-use-config-flags) -* [`shopify app config validate`](#shopify-app-config-validate) -* [`shopify app deploy`](#shopify-app-deploy) -* [`shopify app dev`](#shopify-app-dev) -* [`shopify app dev clean`](#shopify-app-dev-clean) -* [`shopify app env pull`](#shopify-app-env-pull) -* [`shopify app env show`](#shopify-app-env-show) -* [`shopify app execute`](#shopify-app-execute) -* [`shopify app function build`](#shopify-app-function-build) -* [`shopify app function info`](#shopify-app-function-info) -* [`shopify app function replay`](#shopify-app-function-replay) -* [`shopify app function run`](#shopify-app-function-run) -* [`shopify app function schema`](#shopify-app-function-schema) -* [`shopify app function typegen`](#shopify-app-function-typegen) -* [`shopify app generate extension`](#shopify-app-generate-extension) -* [`shopify app import-custom-data-definitions`](#shopify-app-import-custom-data-definitions) -* [`shopify app import-extensions`](#shopify-app-import-extensions) -* [`shopify app info`](#shopify-app-info) -* [`shopify app init`](#shopify-app-init) -* [`shopify app logs`](#shopify-app-logs) -* [`shopify app logs sources`](#shopify-app-logs-sources) -* [`shopify app release --version `](#shopify-app-release---version-version) -* [`shopify app versions list`](#shopify-app-versions-list) -* [`shopify app webhook trigger`](#shopify-app-webhook-trigger) * [`shopify auth login`](#shopify-auth-login) * [`shopify auth logout`](#shopify-auth-logout) -* [`shopify commands`](#shopify-commands) -* [`shopify config autocorrect off`](#shopify-config-autocorrect-off) -* [`shopify config autocorrect on`](#shopify-config-autocorrect-on) -* [`shopify config autocorrect status`](#shopify-config-autocorrect-status) * [`shopify help [command] [flags]`](#shopify-help-command-flags) -* [`shopify hydrogen build`](#shopify-hydrogen-build) -* [`shopify hydrogen check RESOURCE`](#shopify-hydrogen-check-resource) -* [`shopify hydrogen codegen`](#shopify-hydrogen-codegen) -* [`shopify hydrogen customer-account-push`](#shopify-hydrogen-customer-account-push) -* [`shopify hydrogen debug cpu`](#shopify-hydrogen-debug-cpu) -* [`shopify hydrogen deploy`](#shopify-hydrogen-deploy) -* [`shopify hydrogen dev`](#shopify-hydrogen-dev) -* [`shopify hydrogen env list`](#shopify-hydrogen-env-list) -* [`shopify hydrogen env pull`](#shopify-hydrogen-env-pull) -* [`shopify hydrogen env push`](#shopify-hydrogen-env-push) -* [`shopify hydrogen generate route ROUTENAME`](#shopify-hydrogen-generate-route-routename) -* [`shopify hydrogen generate routes`](#shopify-hydrogen-generate-routes) -* [`shopify hydrogen init`](#shopify-hydrogen-init) -* [`shopify hydrogen link`](#shopify-hydrogen-link) -* [`shopify hydrogen list`](#shopify-hydrogen-list) -* [`shopify hydrogen login`](#shopify-hydrogen-login) -* [`shopify hydrogen logout`](#shopify-hydrogen-logout) -* [`shopify hydrogen preview`](#shopify-hydrogen-preview) -* [`shopify hydrogen setup`](#shopify-hydrogen-setup) -* [`shopify hydrogen setup css [STRATEGY]`](#shopify-hydrogen-setup-css-strategy) -* [`shopify hydrogen setup markets [STRATEGY]`](#shopify-hydrogen-setup-markets-strategy) -* [`shopify hydrogen setup vite`](#shopify-hydrogen-setup-vite) -* [`shopify hydrogen shortcut`](#shopify-hydrogen-shortcut) -* [`shopify hydrogen unlink`](#shopify-hydrogen-unlink) -* [`shopify hydrogen upgrade`](#shopify-hydrogen-upgrade) -* [`shopify organization list`](#shopify-organization-list) -* [`shopify plugins add PLUGIN`](#shopify-plugins-add-plugin) -* [`shopify plugins:inspect PLUGIN...`](#shopify-pluginsinspect-plugin) -* [`shopify plugins install PLUGIN`](#shopify-plugins-install-plugin) -* [`shopify plugins link PATH`](#shopify-plugins-link-path) -* [`shopify plugins remove [PLUGIN]`](#shopify-plugins-remove-plugin) -* [`shopify plugins reset`](#shopify-plugins-reset) -* [`shopify plugins uninstall [PLUGIN]`](#shopify-plugins-uninstall-plugin) -* [`shopify plugins unlink [PLUGIN]`](#shopify-plugins-unlink-plugin) -* [`shopify plugins update`](#shopify-plugins-update) * [`shopify search [query]`](#shopify-search-query) -* [`shopify theme check`](#shopify-theme-check) -* [`shopify theme console`](#shopify-theme-console) -* [`shopify theme delete`](#shopify-theme-delete) -* [`shopify theme dev`](#shopify-theme-dev) -* [`shopify theme duplicate`](#shopify-theme-duplicate) -* [`shopify theme info`](#shopify-theme-info) -* [`shopify theme init [name] [flags]`](#shopify-theme-init-name-flags) -* [`shopify theme language-server`](#shopify-theme-language-server) -* [`shopify theme list`](#shopify-theme-list) -* [`shopify theme metafields pull`](#shopify-theme-metafields-pull) -* [`shopify theme open`](#shopify-theme-open) -* [`shopify theme package`](#shopify-theme-package) -* [`shopify theme preview`](#shopify-theme-preview) -* [`shopify theme profile`](#shopify-theme-profile) -* [`shopify theme publish`](#shopify-theme-publish) -* [`shopify theme pull`](#shopify-theme-pull) -* [`shopify theme push`](#shopify-theme-push) -* [`shopify theme rename`](#shopify-theme-rename) -* [`shopify theme share`](#shopify-theme-share) * [`shopify upgrade`](#shopify-upgrade) * [`shopify version`](#shopify-version) -## `shopify app build` - -Build the app, including extensions. - -``` -USAGE - $ shopify app build [--client-id | -c ] [--no-color] [--path ] [--reset | ] - [--skip-dependencies-installation] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --skip-dependencies-installation [env: SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION] Skips the installation of - dependencies. Deprecated, use workspaces instead. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Build the app, including extensions. - - This command executes the build script specified in the element's TOML file. You can specify a custom script in the - file. To learn about configuration files in Shopify apps, refer to "App configuration" - (https://shopify.dev/docs/apps/tools/cli/configuration). - - If you're building a "theme app extension" (https://shopify.dev/docs/apps/online-store/theme-app-extensions), then - running the `build` command runs "Theme Check" (https://shopify.dev/docs/themes/tools/theme-check) against your - extension to ensure that it's valid. -``` - -_See code: [dist/commands/app/build.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/build.js)_ - -## `shopify app bulk cancel` - -Cancel a bulk operation. - -``` -USAGE - $ shopify app bulk cancel --id [--client-id | -c ] [--no-color] [--path ] [--reset | - ] [-s ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -s, --store= [env: SHOPIFY_FLAG_STORE] The store domain. Must be an existing dev store. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --id= (required) [env: SHOPIFY_FLAG_ID] The bulk operation ID to cancel (numeric ID or full GID). - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Cancel a bulk operation. - - Cancels a running bulk operation by ID. -``` - -_See code: [dist/commands/app/bulk/cancel.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/bulk/cancel.js)_ - -## `shopify app bulk execute` - -Execute bulk operations. - -``` -USAGE - $ shopify app bulk execute [--client-id | -c ] [--no-color] [--output-file --watch] [--path - ] [-q ] [--query-file ] [--reset | ] [-s ] [--variable-file | -v ...] - [--verbose] [--version ] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -q, --query= [env: SHOPIFY_FLAG_QUERY] The GraphQL query or mutation to run as a bulk operation. - -s, --store= [env: SHOPIFY_FLAG_STORE] The store domain. Must be an existing dev store. - -v, --variables=... [env: SHOPIFY_FLAG_VARIABLES] The values for any GraphQL variables in your mutation, in - JSON format. Can be specified multiple times. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --output-file= [env: SHOPIFY_FLAG_OUTPUT_FILE] The file path where results should be written if --watch - is specified. If not specified, results will be written to STDOUT. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --query-file= [env: SHOPIFY_FLAG_QUERY_FILE] Path to a file containing the GraphQL query or mutation. - Can't be used with --query. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --variable-file= [env: SHOPIFY_FLAG_VARIABLE_FILE] Path to a file containing GraphQL variables in JSONL - format (one JSON object per line). Can't be used with --variables. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - --version= [env: SHOPIFY_FLAG_VERSION] The API version to use for the bulk operation. If not - specified, uses the latest stable version. - --watch [env: SHOPIFY_FLAG_WATCH] Wait for bulk operation results before exiting. Defaults to - false. - -DESCRIPTION - Execute bulk operations. - - Executes an Admin API GraphQL query or mutation on the specified store, as a bulk operation. Mutations are only - allowed on dev stores. - - Bulk operations allow you to process large amounts of data asynchronously. Learn more about "bulk query operations" - (https://shopify.dev/docs/api/usage/bulk-operations/queries) and "bulk mutation operations" - (https://shopify.dev/docs/api/usage/bulk-operations/imports). - - Use "`bulk status`" (https://shopify.dev/docs/api/shopify-cli/app/app-bulk-status) to check the status of your bulk - operations. -``` - -_See code: [dist/commands/app/bulk/execute.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/bulk/execute.js)_ - -## `shopify app bulk status` - -Check the status of bulk operations. - -``` -USAGE - $ shopify app bulk status [--client-id | -c ] [--id ] [--no-color] [--path ] [--reset - | ] [-s ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -s, --store= [env: SHOPIFY_FLAG_STORE] The store domain. Must be an existing dev store. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --id= [env: SHOPIFY_FLAG_ID] The bulk operation ID (numeric ID or full GID). If not provided, lists - all bulk operations belonging to this app on this store in the last 7 days. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Check the status of bulk operations. - - Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store - in the last 7 days. - - Bulk operations allow you to process large amounts of data asynchronously. Learn more about "bulk query operations" - (https://shopify.dev/docs/api/usage/bulk-operations/queries) and "bulk mutation operations" - (https://shopify.dev/docs/api/usage/bulk-operations/imports). - - Use "`bulk execute`" (https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) to start a new bulk operation. -``` - -_See code: [dist/commands/app/bulk/status.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/bulk/status.js)_ - -## `shopify app config link` - -Fetch your app configuration from the Developer Dashboard. - -``` -USAGE - $ shopify app config link [--client-id | -c ] [--no-color] [--path ] [--reset | ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Fetch your app configuration from the Developer Dashboard. - - Pulls app configuration from the Developer Dashboard and creates or overwrites a configuration file. You can create a - new app with this command to start with a default configuration file. - - For more information on the format of the created TOML configuration file, refer to the "App configuration" - (https://shopify.dev/docs/apps/tools/cli/configuration) page. -``` - -_See code: [dist/commands/app/config/link.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/config/link.js)_ - -## `shopify app config pull` - -Refresh an already-linked app configuration without prompts. - -``` -USAGE - $ shopify app config pull [--client-id | -c ] [--no-color] [--path ] [--reset | ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Refresh an already-linked app configuration without prompts. - - Pulls the latest configuration from the already-linked Shopify app and updates the selected configuration file. - - This command reuses the existing linked app and organization and skips all interactive prompts. Use `--config` to - target a specific configuration file, or omit it to use the default one. -``` - -_See code: [dist/commands/app/config/pull.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/config/pull.js)_ - -## `shopify app config use [config] [flags]` - -Activate an app configuration. - -``` -USAGE - $ shopify app config use [config] [flags] - -ARGUMENTS - [CONFIG] The name of the app configuration. Can be 'shopify.app.staging.toml' or simply 'staging'. - -FLAGS - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Activate an app configuration. - - Sets default configuration when you run app-related CLI commands. If you omit the `config-name` parameter, then you'll - be prompted to choose from the configuration files in your project. -``` - -_See code: [dist/commands/app/config/use.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/config/use.js)_ - -## `shopify app config validate` - -Validate your app configuration and extensions. - -``` -USAGE - $ shopify app config validate [--client-id | -c ] [-j] [--no-color] [--path ] [--reset | ] - [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -j, --json [env: SHOPIFY_FLAG_JSON] Output the result as JSON. Automatically disables color output. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Validate your app configuration and extensions. - - Validates the selected app configuration file and all extension configurations against their schemas and reports any - errors found. -``` - -_See code: [dist/commands/app/config/validate.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/config/validate.js)_ - -## `shopify app deploy` - -Deploy your Shopify app. - -``` -USAGE - $ shopify app deploy [--client-id | -c ] [-f] [--message ] [--no-build] [--no-color] - [--no-release | --allow-updates | --allow-deletes] [--path ] [--reset | ] [--source-control-url ] - [--verbose] [--version ] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -f, --force [env: SHOPIFY_FLAG_FORCE] [Deprecated] Deploy without asking for confirmation. - Equivalent to --allow-updates --allow-deletes. Use --allow-updates for CI/CD - environments instead. - --allow-deletes [env: SHOPIFY_FLAG_ALLOW_DELETES] Allows removing extensions and configuration - without requiring user confirmation. For CI/CD environments, the recommended flag is - --allow-updates. - --allow-updates [env: SHOPIFY_FLAG_ALLOW_UPDATES] Allows adding and updating extensions and - configuration without requiring user confirmation. Recommended option for CI/CD - environments. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --message= [env: SHOPIFY_FLAG_MESSAGE] Optional message that will be associated with this - version. This is for internal use only and won't be available externally. - --no-build [env: SHOPIFY_FLAG_NO_BUILD] Use with caution: Skips building any elements of the - app that require building. You should ensure your app has been prepared in advance, - such as by running `shopify app build` or by caching build artifacts. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --no-release [env: SHOPIFY_FLAG_NO_RELEASE] Creates a version but doesn't release it - it's not - made available to merchants. With this flag, a user confirmation is not required. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --source-control-url= [env: SHOPIFY_FLAG_SOURCE_CONTROL_URL] URL associated with the new app version. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - --version= [env: SHOPIFY_FLAG_VERSION] Optional version tag that will be associated with this - app version. If not provided, an auto-generated identifier will be generated for - this app version. - -DESCRIPTION - Deploy your Shopify app. - - "Builds the app" (https://shopify.dev/docs/api/shopify-cli/app/app-build), then deploys your app configuration and - extensions. - - This command creates an app version, which is a snapshot of your app configuration and all extensions. This version is - then released to users. - - This command doesn't deploy your "web app" (https://shopify.dev/docs/apps/tools/cli/structure#web-components). You - need to "deploy your web app" (https://shopify.dev/docs/apps/deployment/web) to your own hosting solution. -``` - -_See code: [dist/commands/app/deploy.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/deploy.js)_ - -## `shopify app dev` - -Run the app. - -``` -USAGE - $ shopify app dev [--checkout-cart-url ] [--client-id | -c ] [--localhost-port - ] [--no-color] [--no-update] [--notify ] [--path ] [--reset | ] - [--skip-dependencies-installation] [-s ] [--subscription-product-url ] [-t ] - [--theme-app-extension-port ] [--use-localhost | [--tunnel-url | ]] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -s, --store= [env: SHOPIFY_FLAG_STORE] Store URL. Must be an existing development or - Shopify Plus sandbox store. - -t, --theme= [env: SHOPIFY_FLAG_THEME] Theme ID or name of the theme app extension host - theme. - --checkout-cart-url= [env: SHOPIFY_FLAG_CHECKOUT_CART_URL] Resource URL for checkout UI extension. - Format: "/cart/{productVariantID}:{productQuantity}" - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --localhost-port= [env: SHOPIFY_FLAG_LOCALHOST_PORT] Port to use for localhost. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --no-update [env: SHOPIFY_FLAG_NO_UPDATE] Uses the app URL from the toml file instead an - autogenerated URL for dev. - --notify= [env: SHOPIFY_FLAG_NOTIFY] 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. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --skip-dependencies-installation [env: SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION] Skips the installation of - dependencies. Deprecated, use workspaces instead. - --subscription-product-url= [env: SHOPIFY_FLAG_SUBSCRIPTION_PRODUCT_URL] Resource URL for subscription UI - extension. Format: "/products/{productId}" - --theme-app-extension-port= [env: SHOPIFY_FLAG_THEME_APP_EXTENSION_PORT] Local port of the theme app - extension development server. - --tunnel-url= [env: SHOPIFY_FLAG_TUNNEL_URL] Use a custom tunnel, it must be running before - executing dev. Format: "https://my-tunnel-url:port". - --use-localhost [env: SHOPIFY_FLAG_USE_LOCALHOST] Service entry point will listen to - localhost. A tunnel won't be used. Will work for testing many app features, - but not those that directly invoke your app (E.g: Webhooks) - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Run the app. - - Builds and previews your app on a dev store, and watches for changes. "Read more about testing apps locally" - (https://shopify.dev/docs/apps/build/cli-for-apps/test-apps-locally). -``` - -_See code: [dist/commands/app/dev.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/dev.js)_ - -## `shopify app dev clean` - -Cleans up the dev preview from the selected store. - -``` -USAGE - $ shopify app dev clean [--client-id | -c ] [--no-color] [--path ] [--reset | ] [-s - ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -s, --store= [env: SHOPIFY_FLAG_STORE] Store URL. Must be an existing development store. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Cleans up the dev preview from the selected store. - - Stop the dev preview that was started with `shopify app dev`. - - It restores the app's active version to the selected development store. -``` - -_See code: [dist/commands/app/dev/clean.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/dev/clean.js)_ - -## `shopify app env pull` - -Pull app and extensions environment variables. - -``` -USAGE - $ shopify app env pull [--client-id | -c ] [--env-file ] [--no-color] [--path ] - [--reset | ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --env-file= [env: SHOPIFY_FLAG_ENV_FILE] Specify an environment file to update if the update flag is set - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Pull app and extensions environment variables. - - Creates or updates an `.env` files that contains app and app extension environment variables. - - When an existing `.env` file is updated, changes to the variables are displayed in the terminal output. Existing - variables and commented variables are preserved. -``` - -_See code: [dist/commands/app/env/pull.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/env/pull.js)_ - -## `shopify app env show` - -Display app and extensions environment variables. - -``` -USAGE - $ shopify app env show [--client-id | -c ] [--no-color] [--path ] [--reset | ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Display app and extensions environment variables. - - Displays environment variables that can be used to deploy apps and app extensions. -``` - -_See code: [dist/commands/app/env/show.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/env/show.js)_ - -## `shopify app execute` - -Execute GraphQL queries and mutations. - -``` -USAGE - $ shopify app execute [--client-id | -c ] [--no-color] [--output-file ] [--path ] - [-q ] [--query-file ] [--reset | ] [-s ] [--variable-file | -v ] [--verbose] - [--version ] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -q, --query= [env: SHOPIFY_FLAG_QUERY] The GraphQL query or mutation, as a string. - -s, --store= [env: SHOPIFY_FLAG_STORE] The myshopify.com domain of the store to execute against. The - app must be installed on the store. If not specified, you will be prompted to select a - store. - -v, --variables= [env: SHOPIFY_FLAG_VARIABLES] The values for any GraphQL variables in your query or - mutation, in JSON format. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --output-file= [env: SHOPIFY_FLAG_OUTPUT_FILE] The file name where results should be written, instead of - STDOUT. - --path= [env: SHOPIFY_FLAG_PATH] The path to your app directory. - --query-file= [env: SHOPIFY_FLAG_QUERY_FILE] Path to a file containing the GraphQL query or mutation. - Can't be used with --query. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --variable-file= [env: SHOPIFY_FLAG_VARIABLE_FILE] Path to a file containing GraphQL variables in JSON - format. Can't be used with --variables. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - --version= [env: SHOPIFY_FLAG_VERSION] The API version to use for the query or mutation. Defaults to - the latest stable version. - -DESCRIPTION - Execute GraphQL queries and mutations. - - Executes an Admin API GraphQL query or mutation on the specified store. Mutations are only allowed on dev stores. - - For operations that process large amounts of data, use "`bulk execute`" - (https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) instead. -``` - -_See code: [dist/commands/app/execute.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/execute.js)_ - -## `shopify app function build` - -Compile a function to wasm. - -``` -USAGE - $ shopify app function build [--client-id | -c ] [--no-color] [--path ] [--reset | ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your function directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Compile a function to wasm. - - Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes. -``` - -_See code: [dist/commands/app/function/build.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/function/build.js)_ - -## `shopify app function info` - -Print basic information about your function. - -``` -USAGE - $ shopify app function info [--client-id | -c ] [-j] [--no-color] [--path ] [--reset | ] - [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -j, --json [env: SHOPIFY_FLAG_JSON] Output the result as JSON. Automatically disables color output. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your function directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Print basic information about your function. - - The information returned includes the following: - - - The function handle - - The function name - - The function API version - - The targeting configuration - - The schema path - - The WASM path - - The function runner path -``` - -_See code: [dist/commands/app/function/info.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/function/info.js)_ - -## `shopify app function replay` - -Replays a function run from an app log. - -``` -USAGE - $ shopify app function replay [--client-id | -c ] [-j] [-l ] [--no-color] [--path ] - [--reset | ] [--verbose] [-w] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -j, --json [env: SHOPIFY_FLAG_JSON] Output the result as JSON. Automatically disables color output. - -l, --log= [env: SHOPIFY_FLAG_LOG] Specifies a log identifier to replay instead of selecting from a - list. The identifier is provided in the output of `shopify app dev` and is the suffix of the - log file name. - -w, --[no-]watch [env: SHOPIFY_FLAG_WATCH] Re-run the function when the source code changes. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your function directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Replays a function run from an app log. - - Runs the function from your current directory for "testing purposes" - (https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when - errors occur, refer to "Shopify Functions error handling" (https://shopify.dev/docs/api/functions/errors). -``` - -_See code: [dist/commands/app/function/replay.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/function/replay.js)_ - -## `shopify app function run` - -Run a function locally for testing. - -``` -USAGE - $ shopify app function run [--client-id | -c ] [-e ] [-i ] [-j] [--no-color] [--path - ] [--reset | ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -e, --export= [env: SHOPIFY_FLAG_EXPORT] Name of the WebAssembly export to invoke. - -i, --input= [env: SHOPIFY_FLAG_INPUT] The input JSON to pass to the function. If omitted, standard input - is used. - -j, --json [env: SHOPIFY_FLAG_JSON] Output the result as JSON. Automatically disables color output. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your function directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Run a function locally for testing. - - Runs the function from your current directory for "testing purposes" - (https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when - errors occur, refer to "Shopify Functions error handling" (https://shopify.dev/docs/api/functions/errors). -``` - -_See code: [dist/commands/app/function/run.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/function/run.js)_ - -## `shopify app function schema` - -Fetch the latest GraphQL schema for a function. - -``` -USAGE - $ shopify app function schema [--client-id | -c ] [--no-color] [--path ] [--reset | ] [--stdout] - [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your function directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --stdout [env: SHOPIFY_FLAG_STDOUT] Output the schema to stdout instead of writing to a file. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Fetch the latest GraphQL schema for a function. - - Generates the latest "GraphQL schema" (https://shopify.dev/docs/apps/functions/input-output#graphql-schema) for a - function in your app. Run this command from the function directory. - - This command uses the API type and version of your function, as defined in your extension TOML file, to generate the - latest GraphQL schema. The schema is written to the `schema.graphql` file. -``` - -_See code: [dist/commands/app/function/schema.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/function/schema.js)_ - -## `shopify app function typegen` - -Generate GraphQL types for a function. - -``` -USAGE - $ shopify app function typegen [--client-id | -c ] [--no-color] [--path ] [--reset | ] - [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output. - --path= [env: SHOPIFY_FLAG_PATH] The path to your function directory. - --reset [env: SHOPIFY_FLAG_RESET] Reset all your settings. - --verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output. - -DESCRIPTION - Generate GraphQL types for a function. - - Creates GraphQL types based on your "input query" (https://shopify.dev/docs/apps/functions/input-output#input) for a - function. Supports JavaScript functions out of the box, or any language via the `build.typegen_command` configuration. -``` - -_See code: [dist/commands/app/function/typegen.js](https://github.com/Shopify/cli/blob/v3.92.0/dist/commands/app/function/typegen.js)_ - -## `shopify app generate extension` - -Generate a new app Extension. - -``` -USAGE - $ shopify app generate extension [--client-id | -c ] [--flavor - vanilla-js|react|typescript|typescript-react|wasm|rust] [-n ] [--no-color] [--path ] [--reset | ] [-t - ] [-t ] [--verbose] - -FLAGS - -c, --config= [env: SHOPIFY_FLAG_APP_CONFIG] The name of the app configuration. - -n, --name= [env: SHOPIFY_FLAG_NAME] name of your Extension - -t, --template= [env: SHOPIFY_FLAG_EXTENSION_TEMPLATE] Extension template - -t, --type= [env: SHOPIFY_FLAG_EXTENSION_TYPE] Deprecated. Please use --template - --client-id= [env: SHOPIFY_FLAG_CLIENT_ID] The Client ID of your app. - --flavor=