Add New CLI Commands to Existing Projects

When a new command is introduced to the CLI, it enhances the functionality and capabilities available for development. However, it's important to note that projects created before the release of the new command won't automatically have it integrated into their environments. Instead, you need to add the new command to your package.json file manually before you can use it.

Failure to update the package.json with the new command will result in errors when you attempt to use the new command.

Adding a new command

  1. Identify the new command from the CLI Command Reference.

  2. Open your project and locate the package.json. This file contains all the dependencies and configurations for your project.

    Note: Your project's file structure is documented in CLI Project Structure.

  3. Under the scripts section in the package.json file, add the command and a name as a key

    pair.

    For example:

    Copy
  4. Save your changes.

  5. Ensure you are using the latest version of the CLI before using the new command.

Did this help?