Skip to content

Configure a CLI profile

Configuring a CLI profile ensures all Stackit CLI commands run against the right organization and project without needing to repeat flags every time. By saving a named profile with your PARENT_FOLDER and PROJECT_ID, you:

  • Avoid accidental changes in the wrong project
  • Simplify scripting and automation (commands stay short and consistent)
  • Make it easy to switch between environments (e.g., dev, staging, prod)
  • Keep team instructions reproducible: everyone shares the same profile name and context

The steps below guide you to find the correct project, create a profile, and set it as the active context for subsequent CLI operations:

Terminal window
## Parent folder / organization you belong to
> PARENT_FOLDER="12345678-abcd-abcd-abcd-12345678"
### Name of the project to create your STEC instance in
> PROJECT_NAME="YOUR-PROJECT"
### Find the project ID
> PROJECT_ID=$(stackit project list --parent-id $PARENT_FOLDER -o json | jq -r --arg NAME "$PROJECT_NAME" 'map(select(.name == $NAME)) | if length > 1 then error("Expected exactly one element, but found (length) elements.") else.[0] end |.projectId')
> echo $PROJECT_ID
12345678-ffff-abcd-ffff-12345678
### Configure the CLI profile to use the selected project
> stackit config profile create $PROJECT_NAME
> stackit config set --project-id $PROJECT_ID
> stackit config profile set $PROJECT_NAME