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

We proudly present: a new Look for opsi

We proudly present: a new Look for opsi

opsi is getting a new design! Discover the new logos and our new mascot.

Read More
opsi at T-DOSE 2023: A personal Report

opsi at T-DOSE 2023: A personal Report

Get a behind-the-scenes look at T-DOSE 2023, an Open Source technology conference that brought together experts and enthusiasts from all over the world. As an attendee of the conference, I was excited to be a part of this event and meet members of other Open Source projects.

Read More
opsi Docker on ARM64: Cost-Efficient Solutions for Small Businesses

opsi Docker on ARM64: Cost-Efficient Solutions for Small Businesses

Build opsi Depot Servers with a Single Board Computer and external Hard Drives.

Read More