Command Line Options

Generic Options

Some command line options aren’t associated with a specific command, but can provided to any command instead.

--working-dir

Commodore creates a large amount of directories and files. By default, this happens in the current working directory of the environment in which Commodore is executed. If this option is provided, Commodore will create its directories and files in the provided location.

--version

Show the version and exit.

-v, --verbose

Control verbosity. Can be repeated for more verbose output. Can also be provided after subcommands (for example commodore catalog compile -v).

Currently three verbosity levels are implemented, regular operation is active when the flag isn’t provided, debug verbosity is enabled when the flag is provided once or more, and trace verbosity is enabled when the flag is provided three times or more.

--help

Show help message for generic options and available commands then exit.

Catalog Clean

This command doesn’t have any command line options.

Catalog Compile

--api-url URL

Lieutenant API URL.

--api-token TOKEN

Lieutenant API token.

--local

Run in local mode. Intended to be used to test/verify local changes (for example during component development) against an existing cluster inventory and catalog.

Local mode doesn’t try to connect to the Lieutenant API or fetch/push Git repositories. However, local mode expects the working directory to contain a valid inventory in inventory/ and all the dependencies (components and Jsonnet libraries) required by the inventory in dependencies/, with component classes symlinked to inventory/ and component and 3rd party Jsonnet libraries symlinked to dependencies/lib.

In local mode, uncommitted modifications to the inventory and dependencies are never discarded.

Local mode will fail when the cluster id of the inventory differs from the cluster id for which compilation was requested.

If catalog/ is provided for a local mode compilation, Commodore will show a diff of the changes compared to the provided catalog. There’s currently no mechanism that ensures that the provided cluster catalog actually matches the cluster for which compilation was requested.

The quickest way to get a working directory setup for local mode is to run a "regular" catalog compile for the cluster you want to work against.

--fetch-dependencies/--no-fetch-dependencies

Whether to fetch Jsonnet and Kapitan dependencies in local mode.

This flag doesn’t have an effect in regular mode, but speeds up local mode by not fetching Jsonnet dependencies, and disabling Kapitan’s dependency fetching. By default, Jsonnet and Kapitan dependencies are fetched in local mode, to make local testing of component and configuration changes easier. Additionally, having Jsonnet and Kapitan dependency fetching enabled in local mode is required to test some types of changes such as upgrading versions.

When you want to test adding a new component in local mode, you must run local mode with dependency fetching enabled at least once. After that, all the symlinks and dependencies which are required to compile the component will be present and you can disable dependency fetching.

--push

Push catalog to remote repository as discovered in the cluster configuration fetched from the Lieutenant API.

--interactive

Show changes and prompt if they should be pushed to the remote repository. This doesn’t do anything unless --push is provided.

--git-author-name USERNAME

Name of catalog commit author

--git-author-email EMAIL

E-mail address of catalog commit author

--global-repo-revision-override REV

Git tree-ish to checkout for the global config repository. This command line parameter overrides the global git repository revision configured on the cluster or tenant object in Lieutenant. When this option is provided, Commodore will abort without compiling the catalog if --push is also provided.

--tenant-repo-revision-override REV

Git tree-ish to checkout for the tenant config repository. This command line parameter overrides the tenant git repository revision configured on the cluster object in Lieutenant. When this option is provided, Commodore will abort without compiling the catalog if --push is also provided.

--help

Show catalog clean usage and options then exit.

Catalog List

This command doesn’t have any command line options.

Component Compile

-f, --values FILE

Specify inventory class in a YAML file. This option can be repeated to provide multiple files. Files specified later win when resolving inventory values.

-a, --alias ALIAS

Provide component alias to use when compiling component.

-J, --search-paths DIRECTORY

Specify additional search paths.

-o, --output DIRECTORY

Specify output path for compiled component. Defaults to ./.

--help

Show catalog compile usage and options then exit.

Component New

--name TEXT

The component’s name as it will be written in the documentation. Defaults to the slug.

--lib / --no-lib

Add a component library template. Defaults to no.

--pp / --no-pp

Add a component postprocessing template. Defaults to no.

--owner TEXT

The GitHub user or project name where the component will be hosted. Defaults to projectsyn.

--copyright TEXT

The copyright holder added to the license file. Defaults to "VSHN AG <info@vshn.ch>."

--golden-tests / --no-golden-tests

Enable golden tests for the component. Defaults to yes.

--matrix-tests / --no-matrix-tests

Enable test matrix for the component compile and golden tests. Defaults to yes.

--help

Show component new usage and options then exit.

Inventory Components

-f, --values

Specify an additional inventory class in a YAML file. This option can be repeated to provide multiple files. Files specified later win when resolving inventory values. Use this mechanism to specify any facts (such as the cluster’s distribution) that should be taken into account when extracting component versions.

-o, --output-format

The output format for the command. Supported values are json and yaml. Defaults to yaml.

Inventory Lint

-l, --linter

Which linters to enable. Supported values are component-versions and deprecated-parameters. Can be repeated. If this parameter isn’t specified, all known linters are enabled.

Login

--oidc-discovery-url URL

The discovery URL of the IdP. OpenID Connect defines a discovery mechanism, called OpenID Connect Discovery, where an OpenID server publishes its metadata at a well-known URL. Typically this is at auth.example.com/.well-known/openid-configuration.

--oidc-client TEXT

The OIDC client-id.

--api-url URL

Lieutenant API URL.

Fetch Token

--oidc-discovery-url URL

The discovery URL of the IdP. OpenID Connect defines a discovery mechanism, called OpenID Connect Discovery, where an OpenID server publishes its metadata at a well-known URL. Typically this is at auth.example.com/.well-known/openid-configuration.

--oidc-client TEXT

The OIDC client-id.

--api-url URL

Lieutenant API URL. This parameter is required. If the OIDC discovery URL and OIDC client aren’t provided, Commodore will try to fetch those informations from the given Lieutenant API.

Package New

--name TEXT

The package’s name as it will be written in the documentation. Defaults to the slug.

--owner TEXT

The GitHub user or project name where the package will be hosted. Defaults to projectsyn.

--copyright TEXT

The copyright holder added to the license file. Defaults to "VSHN AG <info@vshn.ch>."

--golden-tests / --no-golden-tests

Enable golden tests for the component. Defaults to yes.

--template-url TEXT

The URL of the package cookiecutter template. Defaults to github.com/projectsyn/commodore-config-package-template.git.

--template-version TEXT

The package template version (Git tree-ish) to use. Defaults to main.

--output-dir DIRECTORY

The directory in which to place the new package. If this option isn’t provided, the command will place the new package under inventory/classes/ in the Commodore working directory.

--additional-test-case, -t CASE

Additional test cases to generate in the new package. Can be repeated. Test case defaults will always be generated.

Package Compile

-f, --values FILE

Specify an additional inventory class in a YAML file. This option can be repeated to provide multiple files. Files specified later win when resolving inventory values.

These classes are included before the target class which is getting compiled. This allows users to customize cluster facts or similar when compiling packages standalone.

--local

Run in local mode. Intended to be used to test/verify local changes (for example during component development) of a package.

Local mode doesn’t try to fetch components included by the package. In local mode, uncommitted modifications to the inventory and dependencies are never discarded.

However, local mode expects that the working directory contains:

  • a valid inventory in inventory/

  • all the dependencies required by the package available locally

  • component classes symlinked to inventory/

  • components and Jsonnet dependencies symlinked to vendor/

The quickest way to get a working directory setup for local mode is to run a "regular" package compile for the package you want to work on.

+ Overall, this flag has the same semantics as --local of catalog compile.

--fetch-dependencies/--no-fetch-dependencies

Whether to fetch Jsonnet and Kapitan dependencies in local mode.

This flag doesn’t have an effect in regular mode, but speeds up local mode by not fetching Jsonnet dependencies, and disabling Kapitan’s dependency fetching. By default, Jsonnet and Kapitan dependencies are fetched in local mode, to make local testing of component and configuration changes easier. Additionally, having Jsonnet and Kapitan dependency fetching enabled in local mode is required to test some types of changes such as upgrading versions.

When you want to test adding a new component in local mode, you must run local mode with dependency fetching enabled at least once. After that, all the symlinks and dependencies which are required to compile the component will be present and you can disable dependency fetching.

Overall, this flag has the same semantics as --fetch-dependencies of catalog compile.

--keep-dir / --no-keep-dir

Whether to keep the compilation temp directory after the compilation is done.

This flag allows users to keep the package compilation temp directory created by Commodore for subsequent package compilations in local mode. If this flag isn’t provided, Commodore will delete the temp directory after compilation is done.

--tmp-dir PATH

Temp directory to use for compilation. Implies --keep-dir.

When this flag is provided, Commodore will use the provided path as the directory for the compilation. It’s the users responsibility to clean up the temp directory when this flag is provided.

If the specified path doesn’t exist, Commodore will create it as a directory.