---
title: app function run
description: Runs the function from your current directory for testing purposes.
source_url:
  html: 'https://shopify.dev/docs/api/shopify-cli/app/app-function-run'
  md: 'https://shopify.dev/docs/api/shopify-cli/app/app-function-run.md'
api_name: shopify-cli
---

# app function run

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).

#### Flags

The following flags are available for the `app function run` command:

* **--auth-alias \<value>**

  **string**

  **env: SHOPIFY\_FLAG\_AUTH\_ALIAS**

  Alias of the Shopify account to use for authentication.

* **--client-id \<value>**

  **string**

  **env: SHOPIFY\_FLAG\_CLIENT\_ID**

  The Client ID of your app.

* **--json-schema**

  **env: SHOPIFY\_FLAG\_JSON\_SCHEMA**

  Print the command's JSON schemas.

* **--no-color**

  **env: SHOPIFY\_FLAG\_NO\_COLOR**

  Disable color output.

* **--no-input**

  **env: SHOPIFY\_FLAG\_NO\_INPUT**

  Disable interactive prompts and browser authentication.

* **--path \<value>**

  **string**

  **env: SHOPIFY\_FLAG\_PATH**

  The path to your function directory.

* **--profile**

  **env: SHOPIFY\_FLAG\_PROFILE**

  Generate a WebAssembly performance profile for the function run. The profile can be viewed in Speedscope.

* **--reset**

  **env: SHOPIFY\_FLAG\_RESET**

  Reset all your settings.

* **--verbose**

  **env: SHOPIFY\_FLAG\_VERBOSE**

  Increase the verbosity of the output. May include sensitive data.

* **-c, --config \<value>**

  **string**

  **env: SHOPIFY\_FLAG\_APP\_CONFIG**

  The name of the app configuration.

* **-e, --export \<value>**

  **string**

  **env: SHOPIFY\_FLAG\_EXPORT**

  Name of the WebAssembly export to invoke.

* **-i, --input \<value>**

  **string**

  **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.

Examples

### Examples

* ####

  ##### app function run

  ```sh
  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

  ```sh
  shopify app function run --export run --input input.json --profile
  ```

***
