Shopify CLI Docs

shopify app function run

Run a function locally for testing.

Runs the function from your current directory for testing purposes. To learn how you can monitor and debug functions when errors occur, refer to Shopify Functions error handling.

Usage

shopify app function run [flags]

Summary

Run a function locally for testing.

Flags

  • --client-id <value> string — The Client ID of your app. optional Environment: SHOPIFY_FLAG_CLIENT_ID.
  • --no-color — Disable color output. optional Environment: SHOPIFY_FLAG_NO_COLOR.
  • --path <value> string — The path to your function directory. optional Environment: SHOPIFY_FLAG_PATH.
  • --reset — Reset all your settings. optional Environment: SHOPIFY_FLAG_RESET.
  • --verbose — Increase the verbosity of the output. optional Environment: SHOPIFY_FLAG_VERBOSE.
  • -c, --config <value> string — The name of the app configuration. optional Environment: SHOPIFY_FLAG_APP_CONFIG.
  • -e, --export <value> string — Name of the WebAssembly export to invoke. optional Environment: SHOPIFY_FLAG_EXPORT.
  • -i, --input <value> string — The input JSON to pass to the function. If omitted, standard input is used. optional Environment: SHOPIFY_FLAG_INPUT.
  • -j, --json — Output the result as JSON. Automatically disables color output. optional Environment: SHOPIFY_FLAG_JSON.

Official source

On this page