Skip to main content
⏳ Estimated read time: 2 min read

Global CLI Flags in StackGen

StackGen CLI provides global flags that can be used with various commands to modify their behavior, control output formats, and enable interactive execution. These flags help tailor the command-line experience to different use cases, whether in automation, debugging, or interactive mode.

Defaults and available flags can differ by CLI release.

Available Flags

FlagDescription
-i, --interactiveRuns the CLI in interactive mode, prompting for required inputs.
--log intSets the logging verbosity level: 2: DEBUG, 3: INFO (default), 4: WARN, 5: ERROR.
-o, --output stringSets the output format: json for JSON output, or human (default) for human-readable output.
--project stringThe project identifier. Can also be set using the STACKGEN_PROJECT environment variable.
--stackgen-home stringArtifact output directory. Default depends on your install (often under your home directory).

These flags can be combined with StackGen CLI commands to fine-tune the command execution experience.

Examples

Run a command in interactive mode

stackgen provision --interactive

This command runs stackgen provision in interactive mode and prompts for required inputs.

Set log level to debug

stackgen provision --log 2

This command runs stackgen provision with log level DEBUG (numeric 2).

Change output format to JSON

stackgen resource type --output json

This command returns JSON for easier parsing. stackgen resource type lists supported resource types.