Skip to content

Python Library - Command-Line Interface ​

Available command-line tools provided by the Garden Linux Python Library

Features Commands ​

gl-features-parse ​

Parse and extract information from Garden Linux features.

gl-features-parse ​

Parse and extract information from Garden Linux features.

console
usage: gl-features-parse [-h] [--arch ARCH]
                         [--artifact-base-name ARTIFACT_BASE_NAME]
                         [--cname CNAME] [--commit COMMIT]
                         [--feature-dir FEATURE_DIR] [--flavor FLAVOR]
                         [--ignore IGNORE] [--release-file RELEASE_FILE]
                         [--version VERSION]
                         [--versioned-flavor VERSIONED_FLAVOR]
                         [{arch,artifact-base-name,cname,commit-id,container-name,container-tag,elements,features,flags,flavor,graph,platform,platform-variant,platforms,version,version_and_commit-id,versioned-flavor}]

type ​

Type of output to generate. Choices: arch, artifact-base-name, cname, commit-id, container-name, container-tag, elements, features, flags, flavor, graph, platform, platform-variant, platforms, version, version_and_commit-id, versioned-flavor. Default: ‘cname’.

-h, --help ​

show this help message and exit

--arch <arch> ​

Target architecture (e.g., amd64, arm64). Overrides architecture from CName.

--artifact-base-name <artifact_base_name> ​

Artifact base name to parse. Must be a valid Garden Linux Artifact Base Name.

--cname <cname> ​

Canonical Name (CName) to parse.

--commit <commit> ​

Git commit hash. If not specified, will be read from COMMIT file or release file.

--feature-dir <feature_dir> ​

Path to the features directory (default: ‘features’). Either –feature-dir or –release-file must be provided.

--flavor <flavor> ​

Garden Linux flavor name.

--ignore <ignore> ​

Comma-separated list of features to ignore when processing (e.g., ‘feature1,feature2’).

--release-file <release_file> ​

Path to a release file containing features metadata. Either –feature-dir or –release-file must be provided.

--version <version> ​

Version string. If not specified, will be read from VERSION file or release file.

--versioned-flavor <versioned_flavor> ​

Garden Linux versioned flavor name.

gl-features-metadata ​

Provides Garden Linux release metadata file handling.

gl-metadata ​

Handle GardenLinux metadata reading and writing.

console
usage: gl-metadata [-h] [--arch ARCH]
                   [--artifact-base-name ARTIFACT_BASE_NAME] [--cname CNAME]
                   [--commit COMMIT] [--flavor FLAVOR]
                   [--release-file RELEASE_FILE]
                   [--overwrite-file OVERWRITE_FILE] [--version VERSION]
                   [--versioned-flavor VERSIONED_FLAVOR]
                   [{output-release-metadata,write}]

action ​

-h, --help ​

show this help message and exit

--arch <arch> ​

Target architecture (e.g., amd64, arm64). Overrides architecture from CName.

--artifact-base-name <artifact_base_name> ​

Artifact base name to parse. Must be a valid Garden Linux Artifact Base Name.

--cname <cname> ​

Canonical Name (CName) to parse.

--commit <commit> ​

Git commit hash. If not specified, will be read from COMMIT file or release file.

--flavor <flavor> ​

GardenLinux flavor name.

--release-file <release_file> ​

Path to a release file containing features metadata.

--overwrite-file <overwrite_file> ​

Accept overwriting existing files.

--version <version> ​

Version string. If not specified, will be read from VERSION file or release file.

--versioned-flavor <versioned_flavor> ​

GardenLinux versioned flavor name.

Flavors Commands ​

gl-flavors-parse ​

Parse flavors.yaml and generate combinations.

__main__.py ​

Parse flavors.yaml and generate combinations.

console
usage: __main__.py [-h] [--commit COMMIT] [--no-arch]
                   [--include-only INCLUDE_ONLY] [--exclude EXCLUDE] [--build]
                   [--publish] [--test] [--test-platform]
                   [--category CATEGORY] [--exclude-category EXCLUDE_CATEGORY]
                   [--json-by-arch] [--markdown-table-by-platform]

-h, --help ​

show this help message and exit

--commit <commit> ​

Commit hash to fetch flavors.yaml from GitHub. An existing ‘flavors.yaml’ file will be preferred.

--no-arch ​

Exclude architecture from the flavor output.

--include-only <include_only> ​

Restrict combinations to those matching wildcard patterns (can be specified multiple times).

--exclude <exclude> ​

Exclude combinations based on wildcard patterns (can be specified multiple times).

--build ​

Filter combinations to include only those with build enabled.

--publish ​

Filter combinations to include only those with publish enabled.

--test ​

Filter combinations to include only those with test enabled.

--test-platform ​

Filter combinations to include only platforms with test-platform: true.

--category <category> ​

Filter combinations to include only platforms belonging to the specified categories (can be specified multiple times).

--exclude-category <exclude_category> ​

Exclude platforms belonging to the specified categories (can be specified multiple times).

--json-by-arch ​

Output a JSON dictionary where keys are architectures and values are lists of flavors.

--markdown-table-by-platform ​

Generate a markdown table by platform.

OCI Commands ​

gl-oci ​

Push OCI artifacts to a registry and manage manifests.

gl-oci ​

gl-oci provides functionality to handle OCI containers. It can pull and push images from remote repositories as well as handle GardenLinux artifacts, OCI image indices and manifests.

  • since: 0.7.0

Usage ​

shell
gl-oci [OPTIONS] COMMAND [ARGS]...
add-container-to-index ​

Adds an image container to an OCI image index.

  • since: 1.0.0

Usage ​

shell
gl-oci add-container-to-index [OPTIONS]

Options ​

--index <index> ​

Required OCI image index

--index-tag <index_tag> ​

Required OCI image index tag

--container <container> ​

Required Container Name

--tag <tag> ​

Required OCI tag of image

--insecure <insecure> ​

Use HTTP to communicate with the registry

--additional_tag <additional_tag> ​

Additional tag to push the index with

build-container ​

Build an OCI container based on the defined Containerfile.

  • since: 1.0.0

Usage ​

shell
gl-oci build-container [OPTIONS]

Options ​

--container <container> ​

Required Container Name

--tag <tag> ​

Required OCI tag of image

--dir <directory> ​

Required Path to the build Containerfile

--platform <platform> ​

OCI platform as os/arch/variant

--additional_tag <additional_tag> ​

Additional tag to push the manifest with

--build_arg <build_arg> ​

Additional build args for Containerfile

--oci_archive <oci_archive> ​

Write build result to the OCI archive path and file name

load-container ​

Load an OCI archive.

  • since: 1.0.0

Usage ​

shell
gl-oci load-container [OPTIONS]

Options ​

--oci_archive <oci_archive> ​

Write build result to the OCI archive path and file name

--additional_tag <additional_tag> ​

Additional tag to push the manifest with

load-containers-from-directory ​

Load multiple OCI archives.

  • since: 1.0.0

Usage ​

shell
gl-oci load-containers-from-directory [OPTIONS]

Options ​

--dir <directory> ​

Required path to the build artifacts

new-index ​

Create a new OCI image index.

  • since: 1.0.0

Usage ​

shell
gl-oci new-index [OPTIONS]

Options ​

--index <index> ​

Required OCI image index

--index-tag <index_tag> ​

Required OCI image index tag

--insecure <insecure> ​

Use HTTP to communicate with the registry

--additional_tag <additional_tag> ​

Additional tag to push the index with

pull-container ​

Pull an OCI image container from a remote OCI registry.

  • since: 1.0.0

Usage ​

shell
gl-oci pull-container [OPTIONS]

Options ​

--container <container> ​

Required Container Name

--tag <tag> ​

OCI tag of image

--platform <platform> ​

OCI platform as os/arch/variant

--insecure <insecure> ​

Use HTTP to communicate with the registry

push-container ​

Push an OCI image container to a remote OCI registry.

  • since: 1.0.0

Usage ​

shell
gl-oci push-container [OPTIONS]

Options ​

--container <container> ​

Required Container Name

--tag <tag> ​

OCI tag of image

--destination <destination> ​

OCI container destination

--insecure <insecure> ​

Use HTTP to communicate with the registry

push-index-from-directory ​

Pushes manifests stored in a directory to a given OCI image index.

  • since: 0.10.9

Usage ​

shell
gl-oci push-index-from-directory [OPTIONS]

Options ​

--index <index> ​

Required OCI image index

--index-tag <index_tag> ​

Required OCI image index tag

--manifest_folder <manifest_folder> ​

A folder where the index entries are read from.

--insecure <insecure> ​

Use HTTP to communicate with the registry

--additional_tag <additional_tag> ​

Additional tag to push the index with

push-index-tags ​

Push OCI image index tags to a registry.

  • since: 0.10.9

Usage ​

shell
gl-oci push-index-tags [OPTIONS]

Options ​

--index <index> ​

Required OCI image index

--index-tag <index_tag> ​

Required OCI image index tag

--insecure <insecure> ​

Use HTTP to communicate with the registry

--tag <tag> ​

Required Tag to push the OCI image index with

push-manifest ​

Push to an OCI image container given GardenLinux canonical named artifacts in a specified directory.

  • since: 0.7.0

Usage ​

shell
gl-oci push-manifest [OPTIONS]

Options ​

--container <container> ​

Required Container Name

--cname <cname> ​

Required Canonical Name of Image

--arch <arch> ​

Target Image CPU Architecture

--version <version> ​

Version of image

--commit <commit> ​

Commit of image

--dir <directory> ​

Required path to the build artifacts

--cosign_file <cosign_file> ​

A file where the pushed manifests digests is written to. The content can be used by an external tool (e.g. cosign) to sign the manifests contents

--manifest_file <manifest_file> ​

A file where the index entry for the pushed manifest is written to.

--insecure <insecure> ​

Use HTTP to communicate with the registry

--additional_tag <additional_tag> ​

Additional tag to push the manifest with

push-manifest-tags ​

Push tags to an OCI image container for a given GardenLinux canonical named image.

  • since: 0.10.0

Usage ​

shell
gl-oci push-manifest-tags [OPTIONS]

Options ​

--container <container> ​

Required Container Name

--cname <cname> ​

Canonical Name of Image

--arch <arch> ​

Target Image CPU Architecture

--version <version> ​

Version of image

--commit <commit> ​

Commit of image

--insecure <insecure> ​

Use HTTP to communicate with the registry

--tag <tag> ​

Required Tag to push the manifest with

save-container ​

Saves a given OCI image container as an OCI archive.

  • since: 1.0.0

Usage ​

shell
gl-oci save-container [OPTIONS]

Options ​

--container <container> ​

Required Container Name

--tag <tag> ​

OCI tag of image

--oci_archive <oci_archive> ​

Write build result to the OCI archive path and file name

tag-container ​

Adds additional tags to a given OCI image container.

  • since: 1.0.0

Usage ​

shell
gl-oci tag-container [OPTIONS]

Options ​

--container <container> ​

Required Container Name

--tag <tag> ​

OCI tag of image

--additional_tag <additional_tag> ​

Additional tag to push the manifest with

S3 Commands ​

gl-s3 ​

Upload and download artifacts from S3 buckets.

gl-s3 ​

console
usage: gl-s3 [-h] [--bucket BUCKET] [--path PATH] [--dry-run]
             {download-artifacts-from-bucket,upload-artifacts-to-bucket} ...

-h, --help ​

show this help message and exit

--bucket <bucket> ​

S3 bucket name to upload to or download from.

--path <path> ​

Local directory path for upload (source) or download (destination).

--dry-run ​

Perform a dry run without actually uploading or downloading files.

gl-s3 download-artifacts-from-bucket ​
console
usage: gl-s3 download-artifacts-from-bucket [-h]
                                            [--artifact-base-name ARTIFACT_BASE_NAME]

-h, --help ​

show this help message and exit

--artifact-base-name <artifact_base_name> ​

Artifact base name used as the S3 key prefix for artifacts.

gl-s3 upload-artifacts-to-bucket ​
console
usage: gl-s3 upload-artifacts-to-bucket [-h]
                                        [--artifact-base-name ARTIFACT_BASE_NAME]

-h, --help ​

show this help message and exit

--artifact-base-name <artifact_base_name> ​

S3 artifact base name.

GitHub Commands ​

gl-gh-release ​

Create and manage GitHub releases.

gl-gh-release ​

Create and manage GitHub releases.

console
usage: gl-gh-release [-h] {create,create-with-gl-release-notes,upload} ...

-h, --help ​

show this help message and exit

gl-gh-release create ​
console
usage: gl-gh-release create [-h] [--owner OWNER] [--repo REPO] --tag TAG
                            [--name NAME] --body BODY [--commit COMMIT]
                            [--pre-release] [--latest]

-h, --help ​

show this help message and exit

--owner <owner> ​

GitHub repository owner (default: ‘gardenlinux’).

--repo <repo> ​

GitHub repository name (default: ‘gardenlinux’).

--tag <tag> ​

Git tag name for the release (required).

--name <name> ​

Release name/title. If not specified, the tag will be used.

--body <body> ​

Release notes/description body (required).

--commit <commit> ​

Git commit hash. If not specified, the tag will be used to find the commit.

--pre-release ​

Mark the release as a pre-release (default: True).

--latest ​

Mark this release as the latest release (default: False).

gl-gh-release create-with-gl-release-notes ​
console
usage: gl-gh-release create-with-gl-release-notes [-h] [--owner OWNER]
                                                  [--repo REPO] --tag TAG
                                                  --commit COMMIT [--latest]
                                                  [--dry-run]

-h, --help ​

show this help message and exit

--owner <owner> ​

GitHub repository owner (default: ‘gardenlinux’).

--repo <repo> ​

GitHub repository name (default: ‘gardenlinux’).

--tag <tag> ​

Git tag name for the release (required).

--commit <commit> ​

Git commit hash used to generate release notes (required).

--latest ​

Mark this release as the latest release (default: False).

--dry-run ​

Perform a dry run without actually creating the release.

gl-gh-release upload ​
console
usage: gl-gh-release upload [-h] [--owner OWNER] [--repo REPO]
                            --release_id RELEASE_ID --file_path FILE_PATH
                            [--dry-run] [--overwrite-same-name]

-h, --help ​

show this help message and exit

--owner <owner> ​

GitHub repository owner (default: ‘gardenlinux’).

--repo <repo> ​

GitHub repository name (default: ‘gardenlinux’).

--release_id <release_id> ​

GitHub release ID to upload the file to (required).

--file_path <file_path> ​

Path to the file to upload (required).

--dry-run ​

Perform a dry run without actually uploading the file.

--overwrite-same-name ​