Managing opsi packages with opsi-cli

Managing opsi packages with opsi-cli

The cross-platform command line tool opsi-cli allows server-side tasks to be executed from any computer with a connection to the opsi server, without having to work directly on the opsi server. This simplifies the workflow significantly. In addition, its functionality can be expanded using various plugins.

Here we introduce the new opsi-cli plugin: package. This plugin provides a comprehensive set of new commands for managing opsi packages. Some of them even work without a connection to the server. Whether you need to create, extract, list, install or uninstall packages, the package plugin for the opsi-cli has you covered!

Creating an opsi package

The make command allows you to package a specified source directory and save it to a destination directory. This will create a .opsi package along with .md5 and .zsync files.

opsi-cli package make.

You can customize the packaging process with several options:

  • --md5/--no-md5: Create md5 checksum for the package (default: true).
  • --zsync/--no-zsync: Create zsync file for the package (default:true).
  • --custom-name: Include directories with the specified custom name.
  • --custom-only: Include only custom directories.
  • --follow-symlinks: Follow symlinks.
  • -o, --overwrite: Overwrite existing package if it exists.

Generating control.toml

The control-to-toml command generates a control.toml from a control file located in the specified source directory.

opsi-cli package control-to-toml [SOURCE_DIR]

Extracting an opsi package

The extract command extracts an opsi package from the specified package archive to the destination directory.

opsi-cli package extract [OPTIONS] [PACKAGE_ARCHIVE] [DESTINATION_DIR]

You can customize the extraction process with options like replacing the existing product ID in the control file using --new-product-id or overwriting the destination directory with -o, --overwrite.

Listing opsi products

The list command lists opsi products installed on an opsi-Depotserver, optionally filtered by product IDs.

opsi-cli package list.

By default, it will show products installed on all depots. Use the --depots option to specify depot IDs (comma-separated) or all to list products from all depots.

Installing opsi packages

The install command allows you to install opsi packages directly from local paths or URLs, eliminating the need to download the package first. Simply provide the URL or path to the local .opsi archive, and opsi-cli will handle the rest.

opsi-cli install package.

By default, it will be installed on the opsi-Configserver, but you can specify other depots using the --depots option or use all to install on all depots. During installation, if you need to change the default product property values, an interactive prompt will guide you through the process using the --update-properties option. If there are locked products, you can use --force to force the installation.

Uninstalling opsi products

The uninstall command allows you to uninstall opsi products specified by their product IDs.

opsi-cli package uninstall [OPTIONS] [PRODUCT_IDS]

By default, it will be uninstalled from the opsi-Configserver, but you can specify other depots using the --depots option or use all to uninstall from all depots. If there are conflicts or issues, you can use --force to force the uninstallation.


With these commands, managing your opsi packages becomes effortless. Whether you’re creating new packages or managing existing ones, the package plugin for opsi-cli offers a unified solution to streamline your workflow, eliminating the need for multiple tools.

Tip

Many of these commands feature a modern and colorful progress bar to keep you informed of the status. If you need to run opsi-cli in scripts or prefer a less verbose output, you can use the --quiet option to suppress the progress bar and other non-essential output.

We appreciate your feedback, so please share your thoughts in our forum.

Related Posts

New opsi Basic License: Paid Extensions now free for 30 Clients

New opsi Basic License: Paid Extensions now free for 30 Clients

Upgrade your opsi experience with our new Basic license! Enjoy free installation of almost all our paid extensions on up to 30 clients. This blog post offers a quick overview of the new opsi license.

Read More
Real-Time Log Viewing with opsi-cli log view

Real-Time Log Viewing with opsi-cli log view

View server and client logs in real-time with opsi-cli log view, enabling the streaming, filtering, and continuous following of logs for effective troubleshooting.

Read More
Simplifying Remote Administration: An Introduction to JSON-RPC and opsi-cli

Simplifying Remote Administration: An Introduction to JSON-RPC and opsi-cli

Explore the world of JSON-RPC and learn more about the opsi-cli command jsonrpc. It offers a user-friendly way to execute JSON-RPC methods on an opsi server, simplifying the process of remote administration of your opsi environment.

Read More