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

Configure StackGen CLI

Configure StackGen CLI

The stackgen login command is used to authenticate 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.

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.

Logout

The stackgen logout command is used to clear your token and project from ~/.stackgen/config.yaml. Run stackgen login again before you use authenticated commands.

Usage

stackgen logout

Examples

Usage 1: Log out of the CLI

stackgen logout

The above command will remove saved credentials from your local StackGen config.

Whoami

The stackgen whoami command is used to verify authentication and print account details such as name, email, and current project.

Usage

stackgen whoami

Examples

Usage 1: Show the logged-in user

stackgen whoami

The above command will print the logged-in user and the active project.