Init Command

The init command initializes a new package file for the PxPlus Package Manager, guiding the user through the process of setting up their package configuration.

Synopsis

init

Description

The init command prompts the user with a series of questions to gather necessary details about the project. After collecting these details, it creates a package.json file containing the provided configurations. The command also offers options to generate example readme.md and changelog.md files.

Usage

Simply enter the command:

init

Follow the interactive prompts to enter project details such as the project name, author, description, and initial version.

Prompts

  1. Project name: A valid name for your project. Only lowercase alphanumeric characters and hyphens (-) are allowed.
  2. Project author: Name of the project's author.
  3. Project description: A brief description of the project. This is optional, but if provided, it should not exceed 100 characters.
  4. Initial project version: Specify the starting version of the project. If left empty, the default version 1.0.0 is assigned.

Post these inputs, the command will also ask if you'd like to create:

  • An example readme.md file.
  • An example changelog.md file.

Output

  • If successful, the system will notify the user that the package.json file has been created. If chosen to generate, notifications for the creation of readme.md and changelog.md will also be displayed.
  • If a package.json file already exists in the directory, the system will throw a PackagesFileAlreadyExistsException.

See Also

  • To learn more about managing and updating your package configurations, refer to other commands in the PxPlus Package Manager documentation.