User Commands - pilotcli user

User Commands - pilotcli user

User commands for the pilotcli tool.

User Commands: pilotcli user

Help

$ pilotcli user --help Usage: pilotcli user [OPTIONS] COMMAND [ARGS]... Options: --help Show this message and exit. Commands: login For user to login. logout For user to logout.

Command: login

  • Options: --api-key

  • Usage:

    1. pilotcli user login allows users to log into the platform by the device validation link or QR code through pilotcli. After login, users must be actively using the Pilot Command Line Interface to remain logged in, otherwise, users will be logged out automatically after the session is idle for a period of time.

    2. pilotcli user login --api-key allows users to authorize pilotcli in a non-interactive way using an API key which is issued (impersonated) to the user from the portal. See Using Your Account articles for more information.

  • Prerequisites: None.

$ pilotcli user login --help Usage: pilotcli user login [OPTIONS] For user to login. Options: --api-key TEXT Specify API Key for login. --help Show this message and exit.

Examples

(1) User login by the device validation link or QR code

a. Use the output device validation link or QR code to launch authentication validation

$ pilotcli user login Please, access https://iam.staging.pilot.indocresearch.com/realms/pilot/device?user_code=XXXX-XXXX to proceed ▄▄▄▄▄▄▄ ▄▄ ▄ ▄ ▄ ▄▄▄▄ ▄ ▄▄▄▄▄▄▄ █ ▄▄▄ █ ▄ ▄▄▀█ █▀▀▀▄▀█▀ ▀██▄ █ ▄▄▄ █ █ ███ █ ██▄ ▀▀▄▀▄▄█▄ ▄ ▀▀▀▄ █ ███ █ █▄▄▄▄▄█ █▀▄▀█▀▄▀█▀▄ █ ▄ ▄ █▀█ █▄▄▄▄▄█ ▄▄▄▄▄▄▄ ▀█▀█▄▄█▄ █▀█ ▄▀▄▄ █ ▄ █▀▄▄▄ █ ▄▄▄ █ █▄█▄██ ▀ ▀█▀▀█ ▀▄█▄█▄▄▄█▀▄█ █ ███ █ █▀█ ▄▀██▄█▀▀█▄▀▀█▄▀█ ▀ ▀▄▀██ █▄▄▄▄▄█ ▄▀▄ ██▄▀▀▄ ▀▀▄ ▄▄▀▀▀▄ █▄▄▄█ Waiting validation finish... Welcome to the Command Line Interface!

b. Grant access by clicking ‘Yes’:

image-20241113-190244.png

c. Device Login Successful message will appear and your browser window can be closed.

image-20241113-190306.png

(2) User login using API key

a. Get the API key from the portal User Profile. For details on how to generate an API key, please see: https://indocpilot.atlassian.net/servicedesk/customer/portal/1/article/1084885

b. Copy the API Key into the CLI login command:

$ pilotcli user login --api-key pP3******************* Trying to log in using "api-key" method. Welcome to the Pilot Command Line Interface!

c. The API login session will be established and you can use the pilotcli as usual without the need for additional login.

 


Command: logout

  • Options: -y --yes

  • Usage: allows users to log out of the platform through pilotcli.

  • Prerequisites: User login is required, otherwise error is returned: ‘The current login session is invalid. Please login to continue.'.

$ pilotcli user logout --help Usage: pilotcli user logout [OPTIONS] For user to logout. Options: -y, --yes Input Y/yes to confirm you want to logout, otherwise input N/no to remain logged in. --help Show this message and exit.

Examples

(1) User logout:

$ pilotcli user logout Are you sure you want to logout? [y/N]: y Logged out successfully. Bye!

(2) User logout but canceled:

$ pilotcli user logout Are you sure you want to logout? [y/N]: n Logout cancelled.

(3) User logout with option to skip additional confirmation:

$ pilotcli user logout -y Logged out successfully. Bye!

 Related articles