{"meta":{"title":"Deploy your Spark app from the command line","intro":"Learn how to deploy your Spark app from the command line.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/en/enterprise-cloud@latest/copilot/tutorials","title":"Tutorials"},{"href":"/en/enterprise-cloud@latest/copilot/tutorials/spark","title":"Spark"},{"href":"/en/enterprise-cloud@latest/copilot/tutorials/spark/deploy-from-cli","title":"Deploy from CLI"}],"documentType":"article"},"body":"# Deploy your Spark app from the command line\n\nLearn how to deploy your Spark app from the command line.\n\n## Introduction\n\nIf you’re developing your spark further in a GitHub codespace, you can deploy it directly from the command line using the Spark CLI, an extension of the GitHub CLI.\n\n### Prerequisites\n\n* **Access to GitHub Copilot**. You need a Copilot Pro+ or Copilot Enterprise license to use Spark. See [What is GitHub Copilot?](/en/enterprise-cloud@latest/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot).\n* You must have **built a Spark app** (a \"spark\"). To start building, navigate to [Spark](https://github.com/spark).\n* You have **created a repository** for your spark on GitHub. For instructions, see [Building and deploying AI-powered apps with GitHub Spark](/en/enterprise-cloud@latest/copilot/tutorials/spark/build-apps-with-spark#step-8-invite-collaborators-with-a-repository).\n\n## Open your spark in a codespace\n\nThe Spark CLI currently only works within a GitHub codespace.\n\n1. Navigate to the main page of your spark's repository on GitHub.\n2. Click the **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-code\" aria-label=\"code\" role=\"img\"><path d=\"m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z\"></path></svg> Code** button, then click the **Codespaces** tab.\n3. Click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-plus\" aria-label=\"Create a codespace on main\" role=\"img\"><path d=\"M7.75 2a.75.75 0 0 1 .75.75V7h4.25a.75.75 0 0 1 0 1.5H8.5v4.25a.75.75 0 0 1-1.5 0V8.5H2.75a.75.75 0 0 1 0-1.5H7V2.75A.75.75 0 0 1 7.75 2Z\"></path></svg>** to create a codespace. The codespace opens in a new browser tab.\n\n## Install the Spark CLI\n\n1. In the terminal in your codespace, run the following command to install the Spark CLI:\n\n   ```bash copy\n   gh extensions install github/gh-runtime-cli\n   ```\n\n2. Once the installation is complete, to verify that the Spark CLI is installed, run:\n\n   ```bash copy\n   gh runtime-cli version\n   ```\n\n## Build your spark\n\n1. In the terminal in your codespace, run the following command to install the latest version of the Spark SDK:\n\n   ```bash copy\n   npm install @github/spark@latest\n   ```\n\n2. Next, run the following command to compile your Spark app.\n\n   ```bash copy\n   npm run build\n   ```\n\n## Deploy your spark\n\n1. To deploy your Spark app, run:\n\n   ```bash copy\n   gh runtime-cli deploy --dir ./dist\n   ```\n\n## Troubleshooting\n\nIf you're being asked to supply the `--app` parameter when deploying your spark, update to the latest version of the Spark SDK by following step 1 in [Build your spark](#build-your-spark)."}