Installing and using bundles

STM32CubeCLI delivers tools and resources as bundles. Use the cube command line tool to browse the online bundle catalog, install a bundle, and access its commands.

Before you start

Install STM32CubeCLI by following the installation guide, then check that the cube command is available:

cube --version

Example: install CMake

The cmake bundle provides the CMake command-line interface. We are going to view available online versions, and then install one of them.

  1. List the bundles available in the online catalog:

    cube bundle list-online
    

    Sample output:

    Name        : Platform        Version
    cmake       : x86_64-windows  ["4.3.1+st.1", "4.2.3+st.1", "4.0.1+st.3"]
    

    The output includes the bundle name, supported platform, and available versions.

  2. Install the cmake bundle:

    cube bundle install cmake
    

    The command resolves the bundle, downloads it, and installs it. By default, it installs the latest available version:

    Need to download the following bundles:
          cmake : x86_64-windows ["4.3.1+st.1"]
       Total download size is 50.39 MiB, total approximate install size is 132.72 MiB
       Installing cmake@4.3.1+st.1...
       Installed cmake@4.3.1+st.1 successfully, 132.72 MiB used
    Installation has been completed.
    
  3. Verify that the bundle is installed:

    cube bundle list
    

    The list of installed bundles includes information about bundle version and installation location:

    Installed bundles:
    ...
    cmake@4.3.1+st.1 <bundle-installation-path>
    cmake@4.0.1+st.3 <bundle-installation-path>
    
  4. Display the CMake command-line help:

    cube cmake --help
    

    The help displays the CMake command-line interface:

    Usage
    cmake [options] <path-to-source>
    cmake [options] <path-to-existing-build>
    cmake [options] -S <path-to-source> -B <path-to-build>
    

Updating bundles

Update a specific installed bundle by providing its name:

cube bundle update cmake

If no newer version is available, the command reports:

Everything is up to date.

To update all installed bundles, omit the bundle name:

cube bundle update

For a project-scoped bundle, run the install from the project directory with the --project option:

cube bundle install --project cmake

Project-scoped installation

To install a bundle for the current project, run the command from the project directory with the --project option:

cube bundle install --project cmake

After installation, list the bundles in the current project context:

cube bundle list --project

The default install and list commands use the global context. Use the project-scoped alternatives when the bundle should be available only to one project. Use cube bundle list-online to inspect the catalog regardless of the installation context.

For non-interactive scripts, add --yes to automatically accept the install confirmation:

cube bundle --yes install cmake