Lunar CLI Reference
This document provides a comprehensive reference for all available options and commands in the Lunar CLI.
Global options
--config <config-dir>
, LUNAR_CONFIG=<config-dir>
--config <config-dir>
, LUNAR_CONFIG=<config-dir>
Type:
string
Optional
Default:
.
The path to the directory containing the Lunar configuration files.
--hub-host <hub-host-port>
, LUNAR_HUB_HOST=<hub-host-port>
--hub-host <hub-host-port>
, LUNAR_HUB_HOST=<hub-host-port>
Type:
string
Optional
Override the URL of the Lunar Hub server in the format host:port
. This setting is inferred from the Lunar config if not specified.
--hub-insecure
, LUNAR_HUB_INSECURE=true
--hub-insecure
, LUNAR_HUB_INSECURE=true
Type:
boolean
Optional
If true, use insecure HTTP connections to the Hub server.
Config Commands
lunar config apply
lunar config apply
Form:
The lunar config apply
command is used to download and install Lunar configuration in the Hub server.
--rerun-code-collectors
--rerun-code-collectors
Rerun affected code collectors after applying the configuration.
--pr-max-age-days <days>
--pr-max-age-days <days>
Type:
integer
Optional
Default:
5
Ignore PR commits older than this maximum number of days.
Domain Commands
lunar domain ls
lunar domain ls
Form:
The lunar domain ls
command is used to list all domains.
Component Commands
lunar component ls
lunar component ls
Form:
The lunar component ls
command is used to list all components.
lunar component get-json
lunar component get-json
Form:
The lunar component get-json
command is used to retrieve the component JSON for a specified component.
<component-name>
<component-name>
Type:
string
The name of the component to retrieve the JSON for.
--git-sha <git-sha>
--git-sha <git-sha>
Type:
string
Optional
The specific git SHA to retrieve the component JSON for. If not specified, the latest component JSON will be retrieved.
--pr <pr-number>
--pr <pr-number>
Type:
integer
Optional
The PR number to retrieve the component JSON for. If not specified, and no git SHA is provided, the component JSON for the primary branch will be retrieved. This is ignored if --git-sha
is specified.
Example:
Cataloger Commands
lunar cataloger get-json
lunar cataloger get-json
Form:
The lunar cataloger get-json
command is used to retrieve the catalog JSON.
--pr <pr-number>
--pr <pr-number>
Type:
integer
Optional
The PR number to retrieve the catalog JSON for. If not specified, and no git SHA is provided, the catalog JSON for the primary branch will be retrieved. This is ignored if --git-sha
is specified.
--git-sha <git-sha>
--git-sha <git-sha>
Type:
string
Optional
The specific git SHA to retrieve the catalog JSON for. If not specified, the latest catalog JSON will be retrieved.
lunar cataloger run
lunar cataloger run
Form:
The lunar cataloger run
command is used to run the catalogers and apply changes to the catalog. This command triggers execution in the cloud via Lunar Hub.
--output-json
--output-json
Output the resulting catalog JSON.
lunar cataloger dev
lunar cataloger dev
Form:
The lunar cataloger dev
command is used to run the catalogers in development mode without applying changes to the catalog. This command executes locally on the user's machine and outputs the resulting catalog JSON.
Collector Commands
lunar collector run
lunar collector run
Form:
The lunar collector run
command is used to rerun code and cron collectors for a given component. This command triggers execution in the cloud via Lunar Hub.
<component-name>
<component-name>
Type:
string
The name of the component to rerun collectors for.
--pr <pr-number>
--pr <pr-number>
Type:
integer
Optional
The PR number to rerun collectors for. If not specified, collectors will be run for the component's primary branch.
--git-sha <git-sha>
--git-sha <git-sha>
Type:
string
Optional
The specific git SHA to rerun collectors for. If specified, this takes precedence over --pr
.
--only-code
--only-code
Run only code collectors.
--only-cron
--only-cron
Run only cron collectors.
--collector <collector-name>
--collector <collector-name>
Type:
string
Optional
Repeatable
Run only the specified collector. This flag can be repeated to run multiple specific collectors.
--pr-max-age-days <days>
--pr-max-age-days <days>
Type:
integer
Optional
Default:
5
Ignore PR commits older than this maximum number of days.
--output-json
--output-json
Output the results in JSON format.
Example:
lunar collector dev
lunar collector dev
Form:
The lunar collector dev
command is used to run a collector for a given component in development mode without applying changes. This command executes locally on the user's machine and outputs the resulting component JSON.
--component <component-name>
--component <component-name>
Type:
string
Required
The name of the component to run collectors for.
--pr <pr-number>
--pr <pr-number>
Type:
integer
Optional
The PR number to run collectors for. If not specified, collectors will be run for the component's primary branch.
--git-sha <git-sha>
--git-sha <git-sha>
Type:
string
Optional
The specific git SHA to run collectors for. If specified, this takes precedence over --pr
.
<collector-name>
<collector-name>
Type:
string
Optional
The name of the collector to run. If not specified, all collectors will be run.
--script <path-to-collector-script>
--script <path-to-collector-script>
Type:
string
Optional
The path to a bash collector script file to run in development mode.
--fake-ci-cmd <bash-command>
--fake-ci-cmd <bash-command>
Type:
string
Optional
A bash command to execute with lunar instrumentation attached, simulating a CI environment. This option is used for testing CI collectors locally without requiring an actual CI pipeline execution.
Example:
Policy Commands
lunar policy ls
lunar policy ls
Form:
The lunar policy ls
command is used to list all policies.
lunar policy check ls
lunar policy check ls
Form:
The lunar policy check ls
command is used to list all checks.
lunar policy run
lunar policy run
Form:
The lunar policy run
command is used to rerun all policies for a given component. This command triggers execution in the cloud via Lunar Hub.
<component-name>
<component-name>
Type:
string
The name of the component to rerun policies for.
--pr <pr-number>
--pr <pr-number>
Type:
integer
Optional
The PR number to rerun policies for. If not specified, policies will be run for the component's primary branch.
--git-sha <git-sha>
--git-sha <git-sha>
Type:
string
Optional
The specific git SHA to rerun policies for. If specified, this takes precedence over --pr
.
--policy <policy-name>
--policy <policy-name>
Type:
string
Optional
Repeatable
Run only the specified policy. This flag can be repeated to run multiple specific policies.
--initiative <initiative-name>
--initiative <initiative-name>
Type:
string
Optional
Repeatable
Run only policies under the specified initiative. This flag can be repeated to run policies under multiple initiatives.
--output-json
--output-json
Output the results in JSON format.
Example:
lunar policy dev
lunar policy dev
Form:
The lunar policy dev
command is used to run a policy against a component for local testing purposes. This command executes locally on the user's machine and outputs the check results in JSON format.
--component <component-name>
--component <component-name>
Type:
string
The name of the component to run the policy against.
--component-json <path-to-json-or-stdin>
--component-json <path-to-json-or-stdin>
Type:
string
The path to the component JSON file or -
to read from stdin.
--pr <pr-number>
--pr <pr-number>
Type:
integer
Optional
The PR number to run the policy against. If not specified, the policy will be run against the component's primary branch.
--git-sha <git-sha>
--git-sha <git-sha>
Type:
string
Optional
The specific git SHA to run the policy against. If specified, this takes precedence over --pr
.
--script <path-to-policy-script>
--script <path-to-policy-script>
Type:
string
The path to the policy file.
<policy-name>
<policy-name>
Type:
string
Optional
The name of the policy from the Lunar config to run.
Example:
lunar policy ok-release
lunar policy ok-release
Form:
The lunar policy ok-release
command is used to check if a component at a specific git SHA passes its release policies.
<component>
<component>
Type:
string
The name of the component to check.
<git_sha>
<git_sha>
Type:
string
The git SHA to check.
lunar policy ok-pr
lunar policy ok-pr
Form:
The lunar policy ok-pr
command is used to check if a component at a specific git SHA passes its PR policies.
<component>
<component>
Type:
string
The name of the component to check.
<git_sha>
<git_sha>
Type:
string
The git SHA to check.
SDK Commands
lunar catalog
lunar catalog
Saves catalog-related information from within a cataloger.
lunar collect
lunar collect
Collects SDLC metadata from within a collector or external systems.
SQL Commands
lunar sql connection-string
lunar sql connection-string
Form:
Example:
Last updated