Add New CLI Commands to Existing Apps

When a new command is introduced to the CLI, it enhances the functionality and capabilities available for app development. However, it's important to note that apps created before the release of the new command will not automatically have it integrated into their environment. Instead, you need to add the new command to your package.json file manually in order to utilize 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 app.

Note: Your app's file structure is documented in CLI App Structure.

  1. Add the new command under the scripts section in the package.json file. For example:

    Copy
  2. Save your changes.

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

Did this help?