How does `spacectl profile login` work with and without an alias?

Last updated: September 23, 2026

When using the Spacelift CLI, the behavior of spacectl profile login differs depending on whether you provide an alias or not. This can be a source of confusion, so here's a breakdown of how it works.

Running spacectl profile login (no alias)

Running spacectl profile login without any alias is specifically designed to refresh an existing default profile that uses API Token authentication. If you already have a default profile saved with an endpoint, the CLI will skip the endpoint prompt and go straight to re-authentication.

Running spacectl profile login <alias> (with an alias)

When you provide an alias (e.g., spacectl profile login myprofile), the alias is simply a name — it is not linked to any endpoint automatically. This means the first time you use a given alias, the CLI will always prompt you for:

  1. The Spacelift endpoint URL

  2. Your preferred authentication method (API key, GitHub token, or browser)

This is expected behavior, even if the alias name resembles your Spacelift account URL.

Skipping the prompts

If you want to avoid the interactive prompts, you can pass all the required information upfront. For example, to log in using browser authentication:

spacectl profile login myprofile --endpoint https://myaccount.app.spacelift.io --method browser

Useful commands

A couple of handy commands to inspect your current setup:

  • spacectl profile list — lists all saved profiles with their endpoint and authentication type

  • spacectl profile current — shows which profile is currently active