3. Managing CLI plug-ins

This chapter contains procedures for installing, modifying, and removing a CLI plug-in on the SR Linux.

3.1. Install a CLI plug-in

To install a CLI plug-in, perform the following steps:

  1. Open an SSH session.
  2. Save the CLI plug-in Python code to a file; for example, my_cli.py.
  3. Copy the CLI plug-in file to the /opt/srlinux/python/virtual-env/lib/python3.6/site-packages/srlinux/mgmt/cli/plugins/reports directory.
  4. Edit the file /opt/srlinux/python/virtual-env/lib/python3.6/site-packages/srlinux-0.1-py3.6.egg-info/entry_points.txt and add an entry for the new CLI plug-in. For example:
    my_cli = srlinux.mgmt.cli.plugins.reports.my_cli:Plugin
  5. Restart the SR Linux CLI by closing the SSH session and reconnecting via SSH as the admin user.

3.2. Modify a CLI plug-in

To modify an existing CLI plug-in, perform the following steps:

  1. Open an SSH session.
  2. Modify and save the CLI plug-in file in the /opt/srlinux/python/virtual-env/lib/python3.6/site-packages/srlinux/mgmt/cli/plugins/reports directory.
  3. Restart the SR Linux CLI by closing the current SSH session and reconnecting via SSH as the admin user.

3.3. Remove a CLI plug-in

To remove an existing plug-in from the SR Linux CLI, perform the following steps:

  1. Open an SSH session.
  2. Open the file /opt/srlinux/python/virtual-env/lib/python3.6/site-packages/srlinux-0.1-py3.6.egg-info/entry_points.txt
  3. Delete the entry for the CLI plug-in you are removing. Save the file.
  4. Restart the SR Linux CLI by closing the current SSH session and reconnecting via SSH as the admin user.