Table of Contents
- Description
- Installation
- Usage
- Checking Installation and Getting Help
- User Authentication
- Checking Logged-In User Information
- Org setting
- Device Inventory Management
- Connecting Device to an Organization
- Disconnecting Device to an Organization
- Managing API Tokens
- Resetting API Token
- Logging Out
- HTTPS access test
- Phone home
- Log level
- Logging Sample
- Note
The JSI CLI is a command-line interface designed for Junos devices. This script offers a range of functionalities, including user authentication, organization and device management, and API token configuration, making it a comprehensive tool for managing Junos devices within the JSI ecosystem.
To install the JSI CLI script as a Juniper Op script on Junos Devices, run this command on your Junos Device CLI terminal:
start shell command "curl -k -s https://raw.githubusercontent.com/simonrho/jsi-cli/main/install.sh | /bin/sh"
This command fetches and executes the installation script from this GitHub repository, ensuring you have the latest version of the CLI.
- The
jsi-cli
script will be downloaded and installed automatically. - Once the installation is complete, you can run the
op jsi
command to use the tool.
Here are some command samples to get you started:
poc@alpha> op jsi
Help: Main commands: user, device, org, api-token, check, proxy, phone, log
poc@alpha> op jsi user login
Username: [your_username]
Password: [your_password]
Enter the two-factor authentication code: [your_2FA_code]
poc@alpha> op jsi user whoami
poc@alpha> op jsi org setting
poc@alpha> op jsi device inventory
poc@alpha> op jsi device connect
Enter your choice (1-N): [selected_number]
poc@alpha> op jsi device disconnect
poc@alpha> op jsi api-token set
API Token: [your_api_token]
poc@alpha> op jsi api-token reset
poc@alpha> op jsi user logout
poc@alpha> op jsi check https
poc@alpha> op jsi phone home
poc@alpha> op jsi log level
poc@alpha> op jsi log debug
The log file is located at /var/db/scripts/op/jsi-cli.log
. Refer to the sample log file for more information.
For detailed usage and more commands, refer to the built-in help in the tool by running op jsi
.