Login Command

The login command in the PxPlus Package Manager allows you to sign in to your pxpm account. It ensures API connectivity needed for tasks such as uploading or downloading private packages.

Synopsis

login

Description

When you run the login command, the following steps occur:

  1. API Connectivity Check:
    The command first verifies that the API is accessible. If the API cannot be reached, a NoApiAccessException is thrown.

  2. Existing Session Check:
    If a user is already logged in, the command displays the current user's email and asks if you want to continue and log in as a different user.

  3. Credential Prompt:
    The command interactively prompts you for your email and password.

    • Email: Must be provided and cannot be empty.
    • Password: Input is hidden for security and also cannot be empty.

Parameters

The login command does not require any command-line parameters. Instead, it interactively requests the following inputs:

  • Email: Your login email address.
  • Password: Your account password (input is hidden).

Examples

  • To log in to your account:
login

Output

  • Success:
    A message confirming a successful login is displayed along with your email address.

  • Failure:
    If the login fails due to incorrect credentials or other issues, an error message is displayed.

Exceptions

  • NoApiAccessException:
    Thrown if the API is not accessible.

  • Exception:
    Thrown if the email or password is empty.

  • Other Exceptions:
    Additional errors during the authentication process are caught and logged accordingly.