build Command

Learn how you can use the jovo build command to create platform specific project files that are ready for deployment.

Introduction

The Jovo CLI can be used to deploy projects to various developer consoles like the Alexa and Actions on Google consoles. The build command helps with creating platform specific files that can be deployed to the respective platform developer consoles using the deploy command.

jovo build turns the files from the models folder and the project configuration from jovo.project.js into platform specific files in the build folder. These files can then be used for deployment.

$ jovo build:platform <platform>

Running the build command from above will execute the command for a platform plugin that needs to added to the project configuration before. Learn more about the command flags in the build:platform section.

It is also possible to reverse the process and create models from the contents of the build folder. Learn more in the reverse build section.

build:platform

The build:platform file is used to build files for a single platform. The files are created into the build folder, specifically a platform.<platform> subfolder:

$ jovo build:platform <platform>

# Example
$ jovo build:platform alexa

If you added stages to your project configuration, the platform folder will be inside the respective stage folder: build/<stage>/platform.<platform>.

You can also add flags from the table below.

FlagDescriptionExamples
--locale, -lThe locales to be built from the models folder--locale en, --locale en de
--stageThe stage to be built. See staging.--stage dev
--cleanDelete the relevant folders in build at the beginning of the process
--reverse, -rTurn contents of the build folder into models. See reverse build section below.
--deploy, -dDirectly deploy the platform after the build process. See the deploy:platform command for more information.

CLI integrations may also add their own flags. Learn more in the respective docs:

Reverse Build

In this reverse process, you can create a Jovo Model from an existing build folder, for example after you fetched the files with jovo get.

$ jovo build:platform <platform> --reverse

# Example
$ jovo build:platform alexa --reverse

This will prompt you if you want to overwrite the existing files or rather create a backup first. You can also skip this step and delete the files before the this by using the --clean option:

$ jovo build:platform <platform> --reverse --clean

Troubleshooting

Command Not Found

All global CLI commands are referenced in the user config file in .jovo/config. If you run into command not found errors, it's possible that the CLI can't access the user config.

If you need to access local versions of this command, for example in an npm script or CI environment, you can add it to the jovo.project.js configuration like this:

const { ProjectConfig } = require('@jovotech/cli');
const { BuildCommand } = require('@jovotech/cli-command-build');
// ...

const project = new ProjectConfig({
  endpoint: '${JOVO_WEBHOOK_URL}',
  plugins: [
    new BuildCommand(),
    // ...
  ],
});