Skip to content

Options

The application provides a wide range of options that can be used to customize its behavior. Common for all these options is that they must be specified before the command to run:

harbor \
--url https://my-harbor.com/api/v2.0 \
--username admin \
--secret my-secret \
project list

Many of these options can override configuration file options, and will always take precedence if used. For a more in-depth look at persistent configuration, see Configuration. Each option listed below has a link to the relevant section in the configuration file if applicable.


--config, -c

Environment variable: HARBOR_CLI_CONFIG

Path to config file.


--url, -u

Environment variable: HARBOR_CLI_URL

Configuration option: harbor.url

Harbor API URL.


--username, -U

Environment variable: HARBOR_CLI_USERNAME

Configuration option: harbor.username

Harbor username.


--secret, -S

Environment variable: HARBOR_CLI_SECRET

Configuration option: harbor.secret

Harbor secret (password).


Environment variable: HARBOR_CLI_BASICAUTH

Configuration option: harbor.basicauth

Harbor basic access credentials (base64).


--credentials-file, -F

Environment variable: HARBOR_CLI_CREDENTIALS_FILE

Configuration option: harbor.credentials_file

Path to Harbor JSON credentials file.


--validate/--no-validate

Environment variable: HARBOR_CLI_HARBOR_VALIDATE_DATA

Configuration option: harbor.validate_data

Validate Harbor API response data. Forces JSON output format if disabled.


--raw/--no-raw

Environment variable: HARBOR_CLI_HARBOR_RAW_MODE

Configuration option: harbor.raw_mode

Return raw data from Harbor API. Overrides all output formatting options.


--verify-ssl/--no-verify-ssl

Environment variable: HARBOR_CLI_HARBOR_VERIFY_SSL

Configuration option: harbor.verify_ssl

Verify SSL certificates when connecting to Harbor.


--retry/--no-retry

Environment variable: HARBOR_CLI_HARBOR_RETRY_ENABLED

Configuration option: harbor.retry.enabled

Retry failed HTTP requests.


--retry-max-tries

Environment variable: HARBOR_CLI_HARBOR_RETRY_MAX_TRIES

Configuration option: harbor.retry.max_tries

Number of times to retry failed HTTP requests.


--retry-max-time

Environment variable: HARBOR_CLI_HARBOR_RETRY_MAX_TIME

Configuration option: harbor.retry.max_time

Maximum number of seconds to retry failed HTTP requests.


--table-description/--no-table-description

Environment variable: HARBOR_CLI_TABLE_DESCRIPTION

Configuration option: output.table.description

Include field descriptions in tables.


--table-max-depth

Environment variable: HARBOR_CLI_TABLE_MAX_DEPTH

Configuration option: output.table.max_depth

Maximum depth to print nested objects in tables.


--table-compact/--no-table-compact

Environment variable: HARBOR_CLI_TABLE_COMPACT

Configuration option: output.table.compact

Compact table output. Has no effect on other formats.


--json-indent

Environment variable: HARBOR_CLI_JSON_INDENT

Configuration option: output.json.indent

Indentation level for JSON output.


--json-sort-keys/--no-json-sort-keys

Environment variable: HARBOR_CLI_JSON_SORT_KEYS

Configuration option: output.json.sort_keys

Sort keys in JSON output.


--format, -f

Environment variable: HARBOR_CLI_OUTPUT_FORMAT

Configuration option: output.format

Specifies the output format to use.


--paging/--no-paging

Environment variable: HARBOR_CLI_PAGING

Configuration option: output.paging

Display output in a pager (less, etc.).


--pager

Environment variable: HARBOR_CLI_PAGER

Configuration option: output.pager

Pager command to use. The default Rich pager will be used.


--confirm-deletion/--no-confirm-deletion

Environment variable: HARBOR_CLI_CONFIRM_DELETION

Configuration option: general.confirm_deletion

Confirm before deleting resources.


--confirm-enumeration/--no-confirm-enumeration

Environment variable: HARBOR_CLI_CONFIRM_ENUMERATION

Configuration option: general.confirm_enumeration

Confirm before enumerating all resources without a limit or query.


--warnings/--no-warnings

Environment variable: HARBOR_CLI_WARNINGS

Configuration option: general.warnings

Show/hide warnings.


Configuration option: cache.enabled

Enable caching of API responses.


Configuration option: cache.ttl

Cache TTL in seconds.


--output, -o

Output file, by default None, which means output to stdout. If the file already exists, it will be overwritten.


--no-overwrite

Do not overwrite the output file if it already exists.


--verbose, -v

Enable verbose output.


--with-stdout

Output to stdout in addition to the specified output file, if any. Has no effect if no output file is specified.


--version

Show application version and exit.