app function run
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.
Anchor to flagsFlags
The following flags are available for the app function run command:
- Anchor to --auth-alias <value>--auth-alias <value>--auth-alias <value>stringstringenv: SHOPIFY_FLAG_AUTH_ALIASenv: SHOPIFY_FLAG_AUTH_ALIAS
Alias of the Shopify account to use for authentication.
- Anchor to --client-id <value>--client-id <value>--client-id <value>stringstringenv: SHOPIFY_FLAG_CLIENT_IDenv: SHOPIFY_FLAG_CLIENT_ID
The Client ID of your app.
- Anchor to --no-color--no-color--no-colorenv: SHOPIFY_FLAG_NO_COLORenv: SHOPIFY_FLAG_NO_COLOR
Disable color output.
- Anchor to --path <value>--path <value>--path <value>stringstringenv: SHOPIFY_FLAG_PATHenv: SHOPIFY_FLAG_PATH
The path to your function directory.
- Anchor to --profile--profile--profileenv: SHOPIFY_FLAG_PROFILEenv: SHOPIFY_FLAG_PROFILE
Generate a WebAssembly performance profile for the function run. The profile can be viewed in Speedscope.
- Anchor to --reset--reset--resetenv: SHOPIFY_FLAG_RESETenv: SHOPIFY_FLAG_RESET
Reset all your settings.
- Anchor to --verbose--verbose--verboseenv: SHOPIFY_FLAG_VERBOSEenv: SHOPIFY_FLAG_VERBOSE
Increase the verbosity of the output. May include sensitive data.
- Anchor to -c, --config <value>-c, --config <value>-c, --config <value>stringstringenv: SHOPIFY_FLAG_APP_CONFIGenv: SHOPIFY_FLAG_APP_CONFIG
The name of the app configuration.
- Anchor to -e, --export <value>-e, --export <value>-e, --export <value>stringstringenv: SHOPIFY_FLAG_EXPORTenv: SHOPIFY_FLAG_EXPORT
Name of the WebAssembly export to invoke.
- Anchor to -i, --input <value>-i, --input <value>-i, --input <value>stringstringenv: SHOPIFY_FLAG_INPUTenv: SHOPIFY_FLAG_INPUT
The input JSON to pass to the function. If omitted, standard input is used.
- Anchor to -j, --json-j, --json-j, --jsonenv: SHOPIFY_FLAG_JSONenv: SHOPIFY_FLAG_JSON
Output the result as JSON. Automatically disables color output.
app function run
Examples
app function run
shopify app function run [flags]Description
Pass `--profile` to generate a WebAssembly performance profile for the run, which you can open in [Speedscope](https://www.speedscope.app/) to see where the function spends its time. JavaScript functions built with Javy report their frames as `<unknown>`, because Javy doesn't emit a WebAssembly function name section.
app function run --profile
shopify app function run --export run --input input.json --profile