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

Configure StackGen CLI

The stackgen login command authenticates the StackGen CLI with your StackGen server URL and credentials. stackgen configure is an alias for stackgen login (same command).

Usage

stackgen login [flags]

You can also run stackgen configure with the same flags.

Flags

Command-specific flags for stackgen login:

FlagDescription
-h, --helpHelp for login.
--url stringStackGen server URL. Optional if already in ~/.stackgen/config.yaml; overrides config and STACKGEN_URL when set.

--project, --interactive, --log, --output, and --stackgen-home are global flags on this command. See Global CLI flags. STACKGEN_PROJECT sets the default project when set.

Examples

Usage 1: Basic login with URL and project

stackgen login --project=my_project_id --url https://my-stackgen-server.com

The above command will:

  • Save the StackGen server URL (https://my-stackgen-server.com).
  • Set the default project id to my_project_id in your local configuration.

Usage 2: Login with environment variables

export STACKGEN_PROJECT=my_project_id
export STACKGEN_URL=https://my-stackgen-server.com
stackgen login

The above commands use the environment variables so you do not have to pass --url or --project on the command line. Precedence with ~/.stackgen/config.yaml follows the usual login rules for your CLI version.

Usage 3: Interactive login

stackgen login --url https://my-stackgen-server.com --interactive

The above command will:

  • Run stackgen login in interactive mode (-i / --interactive).
  • Prompt for additional inputs if the CLI needs them.