.gitpod.yml.
Understanding tasks - command
The simplest first task to automate is the installation of packages. We do that by adding them as acommand in a task definition. Add a .gitpod.yml at the root of your repository, add the following code, commit and re-open the workspace.
.gitpod.yml
Understanding tasks - multiple commands
Now let’s take that example, and add some more steps to install our packages, and start both our frontend and backend applications. Go ahead and update your.gitpod.yml stop your workspace and then start a new one.
.gitpod.yml
gp tasks in a workspace. You’ll notice that we also use openMode in each task to specify how these terminals open in the workspace.
Here’s how it should look:

split terminal example
Optimizing your .gitpod.yml
The above.gitpod.yml will run all of your tasks in the “foreground”, e.g. once the workspace has started. This is a great way to get started, however you might want to optimize your workspaces to open faster, which you can do by using Prebuilds.
To use Prebuilds you need to:
- Modify your
.gitpod.ymlto specify which steps can be ran in advance. - Enable Prebuilds in your Repository Settings.
.gitpod.yml however, we’re going to run our npm install command in a prebuild.
.gitpod.yml