Skip to main content

CLI Reference

Global Flags

These flags are available on all commands:

FlagDescription
-v, --verboseVerbose output
--debugDebug mode (show detection commands and timing)
-h, --helpHelp for any command

Commands

ground init

Scan your machine and create a .ground.yaml file.

ground init [flags]
FlagDescription
--forceOverwrite existing .ground.yaml
--dir <path>Directory to create config in (default: current)

ground check

Compare your machine against the team standard.

ground check [flags]
FlagDescription
-c, --config <path>Path to .ground.yaml (default: auto-detect)
--jsonOutput report as JSON
-q, --quietOnly show errors and warnings
--ciOutput GitHub Actions annotations

Exit codes: 0 = all ok, 1 = warnings only, 2 = errors present.

ground fix

Auto-fix detected drift using available package managers.

ground fix [flags]
FlagDescription
-c, --config <path>Path to .ground.yaml
--dry-runShow what would be done without doing it
--autoSkip confirmation prompts
--jsonOutput fix plan as JSON

ground snapshot

Capture your machine state as JSON.

ground snapshot [flags]
FlagDescription
-o, --output <path>Write snapshot to file

ground diff

Show what changed since the last snapshot.

ground diff [flags]
FlagDescription
-f, --from <path>Path to previous snapshot JSON
--jsonOutput diff as JSON

ground report

Generate a drift report in various formats.

ground report [flags]
FlagDescription
-f, --format <fmt>Output format: json, markdown, html
-o, --output <path>Write to file (default: stdout)
-c, --config <path>Path to .ground.yaml

ground export

Export environment spec for use in other contexts.

ground export [flags]
FlagDescription
-f, --format <fmt>Output format: dockerfile, shell, json
-o, --output <path>Write to file (default: stdout)
-c, --config <path>Path to .ground.yaml

ground doctor

Diagnose groundctl configuration and environment.

ground doctor

Checks: config validity, git availability, package managers, profiles, shell.

ground watch

Watch for drift changes in the background.

ground watch [flags]
FlagDescription
-i, --interval <dur>Check interval (default: 30s)
-c, --config <path>Path to .ground.yaml

Press Ctrl+C to stop.

ground pull

Fetch a team standard from a remote source.

ground pull <source> [flags]
FlagDescription
-o, --output <path>Output file path

Sources: git repos, URLs, local file paths.

ground push

Publish your config to the team repo.

ground push [flags]
FlagDescription
-m, --message <msg>Commit message

ground profile

Manage environment profiles.

ground profile <subcommand>
SubcommandDescription
listList all saved profiles
save <name>Save current config as a profile
switch <name>Set active profile
show <name>Display a profile's config
delete <name>Remove a saved profile

ground secrets

Manage secret references in your config.

ground secrets <subcommand> [flags]
SubcommandDescription
checkValidate all secret references are resolvable
listList all configured secrets
envGenerate a .env file from secret references
FlagDescription
-c, --config <path>Path to .ground.yaml
-o, --output <path>Output path for .env (default: .env)

ground validate

Validate a .ground.yaml file.

ground validate [flags]
FlagDescription
-c, --config <path>Path to .ground.yaml
--jsonOutput errors as JSON

ground hook

Generate shell hooks for auto-checking on cd.

ground hook <shell>
ground hook --prompt <prompt>

Shells: bash, zsh, fish, powershell. Prompts: starship, p10k.

ground completion

Generate tab completion scripts.

ground completion <shell>

Shells: bash, zsh, fish, powershell.

ground version

Print the groundctl version.

ground version