svanja auth env
Report the effective, non-secret authentication environment for this invocation.
svanja auth env [flags]
Works without a key.
svanja auth env
svanja auth env --profile staging --plain
svanja auth env --profile staging --json
svanja auth env --profile staging --jq .api_base_url
svanja auth env --profile staging --template '{{.profile}}'
Details
The command uses strict runtime resolution, including normal flag, environment, profile-file, normalization, and API-base derivation rules. This differs from profile show and config inspection, which report persisted profile-file state without applying all invocation overrides.
JSON output is one stable object with exactly profile, base_url, api_base_url, locale, and secret_variable. locale remains present as an empty string when unset. Use --plain for ordered SVANJA_* tab-separated rows; its SVANJA_LOCALE row is omitted when locale is unset. Use --jq or --template to reshape the same stable JSON value.
This is not an authentication or connectivity check. It does not look up a credential, read the auth file, construct an API client, or contact the network. Set SVANJA_API_KEY from your CI provider's secret store. Team API keys are created and revoked in the product web app.
Copying both URL rows freezes the resolved API base URL. A later change to only SVANJA_BASE_URL will not re-derive it while SVANJA_API_BASE_URL remains explicitly set.
svanja auth login
Authorize the CLI with browser device login when available, or validate a copied team API key with GET /api/v1/whoami and store it for future commands.
svanja auth login [flags]
Works without a key.
| Flag |
What it does |
--api-key
|
use manual API-key entry instead of browser login |
--web
|
use browser device login |
svanja auth login
svanja auth login --web
svanja auth login --api-key
svanja auth login --profile staging --base-url https://example.test
svanja auth login --plain --api-key --no-prompt --force < api-key.txt
Details
Team API keys are created and revoked in the product web app. Manual API-key entry reads the key from a secret prompt or from non-terminal stdin; it is never accepted from a flag or SVANJA_API_KEY. --api-key only selects manual entry and does not accept the key value.
Interactive input prompts for the product base URL only when the built-in default is still selected. Values supplied by --base-url, SVANJA_BASE_URL, or the selected profile are used as-is.
With no selector, interactive login discovers first-party browser login. If the server supports it, login prints the verification URL and user code to stderr, tries to open the browser, polls until approval or terminal failure, validates the issued API key with GET /api/v1/whoami, then stores it. Discovery responses that report browser login disabled or an older server fall back to manual API-key entry. Ambiguous discovery failures do not fall back.
Use --web to force browser login. With --web --no-prompt, login prints the verification URL and user code without opening a browser. Use --api-key to force manual entry and skip discovery. Non-terminal default login also uses manual entry without discovery, preserving piped-key automation. With --no-prompt and terminal stdin, manual login fails with guidance to pipe the key.
The write target is the resolved profile from --profile, SVANJA_PROFILE, current_profile, or the built-in local profile. When that profile already has a stored key, interactive login asks before reading the replacement key. --force accepts that overwrite confirmation, but it does not provide missing input. With --no-prompt, an overwrite without --force fails before stdin is consumed, the browser is opened, or an authenticated API request is made. Non-terminal manual stdin without --no-prompt keeps the compatible piped-key path and overwrites after successful API validation.
Output is human-readable even when --json is inherited from the root. Use --plain for copy-safe login result rows. jq and template output are not available because login has no stable JSON shape.
If SVANJA_API_KEY is set, login still validates and stores the manual or browser-issued key, then warns after successful output that the environment credential takes precedence for ordinary authenticated commands.
svanja auth logout
Remove the stored credential for the selected profile without changing non-secret configuration.
svanja auth logout [flags]
Works without a key.
svanja auth logout
svanja auth logout --plain --profile staging
Details
Logout is local and idempotent. It removes only the selected profile's stored auth record and cached metadata, preserving other profiles, config, and current_profile. It does not revoke the API key on the server; revoke keys in the product web app. If SVANJA_API_KEY is set, that environment credential still takes precedence until it is unset.
Team API keys are created and revoked in the product web app. svanja never prints the stored API key; logout shows only non-secret key metadata.
Output is human-readable even when --json is inherited from the root. Use --plain for copy-safe local removal rows. jq and template output are not available because logout has no stable JSON shape.
svanja auth status
Report credential and key state for the active profile.
svanja auth status [flags]
Works without a key.
svanja auth status
svanja auth status --json
svanja auth status --plain
svanja auth status --jq .usable
svanja auth status --template '{{.profile}}'
Details
The command is read-only. It never creates config or auth files and never refreshes cached auth metadata. When a credential exists, it makes at most one GET /api/v1/whoami request.
JSON output has exactly these top-level fields: profile, api_base_url, credential_source, usable, stored, live, and optional request_id. stored is null for environment or missing credentials. live is null when no live probe ran. Stored metadata is limited to key_display_id, key_name, team_display_id, team_name, plan_name, key_expiration_state, expires_at, and last_validated_at. Use --plain for copy-safe status rows. Use --jq or --template to reshape the same stable JSON bytes that --json emits.
Exit codes: 0 usable; 3 no credential, invalid, expired, or revoked; 4 plan, capability, project-scope, or authorization denial; 2 API/network/protocol error; 6 rate limited; 1 local usage or config error. Reports render on stdout for exits 0, 3, and 4. Stdout stays empty for exits 1, 2, and 6. Not-found responses from the whoami probe are folded into exit 2.
Team API keys are created and revoked in the product web app.
svanja auth
Inspect and manage API authentication for svanja.
svanja auth [flags]
Works without a key.
svanja auth login
svanja auth status
svanja auth env --json
svanja auth logout
Details
Team API keys are created and revoked in the product web app. This family stores an API key after browser authorization or manual entry validates it with GET /api/v1/whoami, reports the effective credential and key state, removes local stored credentials, and shows the effective non-secret runtime values used by CI invocations.
svanja never prints an API key. Only non-secret runtime, key, and team metadata can appear in output.
svanja completion
Generate the autocompletion script for svanja for the specified shell. See each sub-command's help for details on how to use the generated script.
svanja completion [flags]
Works without a key.
svanja config get
Print one known non-secret CLI configuration value.
svanja config get <key> [flags]
Works without a key.
svanja config get current_profile
svanja config get profiles.staging.base_url
svanja config get profiles.production.eu.api_base_url --jq .value
svanja config get current_profile --template '{{.value}}'
Details
Supported keys are current_profile and profiles.<name>.base_url, profiles.<name>.api_base_url, profiles.<name>.locale, profiles.<name>.default_output, and profiles.<name>.defaults.project_list_limit. Profile names may contain dots. Stored credential keys and unknown YAML keys are never shown.
All persisted profile names and known profile values are validated before any result is printed. An invalid persisted profile therefore makes the lookup fail without partial output, even when a different profile key was requested.
JSON output is an object with key, value, and source, where source is file, derived, or default.
Output modes: default human detail, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.
svanja config list
List known non-secret CLI configuration values.
svanja config list [flags]
Works without a key.
svanja config list
svanja config list --plain
svanja config list --jq '.values[].key'
svanja config list --template '{{range .values}}{{.key}}{{"\n"}}{{end}}'
Details
The output includes current_profile and known profile fields such as base_url, api_base_url, locale, default_output, and defaults.project_list_limit. Unknown YAML keys and stored credentials are never shown.
JSON output is an object with config_path and a values array. Each value has key, value, and source, where source is file, derived, or default.
Output modes: default human table, --plain tab-separated rows, --json stable JSON, and --jq/--template transforms over the documented JSON value.
svanja config path
Print the local config and auth file paths selected for this invocation.
svanja config path [flags]
Works without a key.
svanja config path
svanja config path --plain
svanja config path --jq .config_path
svanja config path --template '{{.config_path}}'
Details
This command resolves --config, --auth-file, SVANJA_CONFIG, SVANJA_AUTH_FILE, and the built-in defaults without loading or parsing either file. It still works when config.yml is malformed.
JSON output is an object with config_path and auth_path.
Output modes: default human detail, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.
svanja config set
Set one supported non-secret CLI configuration value.
svanja config set <key> <value> [flags]
Works without a key.
svanja config set current_profile staging
svanja config set profiles.staging.base_url https://staging.example.test
svanja config set profiles.staging.locale ""
svanja config set profiles.staging.defaults.project_list_limit 50 --plain
Details
Supported writable keys are current_profile, profiles.<name>.base_url, profiles.<name>.api_base_url, profiles.<name>.locale, and profiles.<name>.defaults.project_list_limit. The target profile must already exist; this command never creates profiles. Use an empty value for locale to persist an unset Accept-Language preference.
Stored credentials are not part of config.yml. Secret-bearing keys are refused locally; manage credentials with svanja login and svanja logout.
profiles.<name>.default_output is readable with config get and config list, but is not writable in this config contract.
This command has no stable JSON shape, so --jq and --template are not supported.
svanja config
Inspect and edit local non-secret CLI configuration such as profile defaults and product URL settings without contacting the API. Config files must contain one YAML document with unique mapping keys. Inspection validates every persisted profile before printing output. Stored API keys are never shown or set here.
svanja config [flags]
Works without a key.
svanja config list
svanja config get current_profile
svanja doctor
Check local setup and API readiness for common CLI workflows.
svanja doctor [flags]
Works without a key.
svanja doctor
svanja doctor --json
svanja doctor --plain
svanja doctor --jq .status
svanja doctor --template '{{.status}}'
Details
Doctor resolves local config and auth paths without creating files. When a credential exists, it makes at most one GET /api/v1/whoami request. Missing credentials, unsafe auth-file permissions, unreachable API, unusable keys, and blocked plan API access are warnings. Malformed local config/auth files and invalid persisted profile values are failing findings.
Stable finding ids are config.path, config.runtime, profile, api.base_url, locale, auth.path, auth.file, auth.permissions, credential.source, api.connectivity, key.state, plan.api_access, capabilities, project_scope, project_scope.truncation, runner.sandbox, and runner.network.
On Linux, doctor also checks what a paired runner needs (svanja runner start): runner.sandbox warns when bubblewrap is missing or cannot start its sandbox (on Ubuntu 24.04 and later because AppArmor has no profile for it), and runner.network warns when slirp4netns is missing on a machine paired for browser work (task commands there would have no internet). Each warning says how to fix it; the Svanja installer offers to set up both.
Exit model: 0 means pass or warnings; 1 means one or more failing findings. The readiness report still renders when doctor exits 1 because of failing findings. Invocation errors such as invalid flag or environment values keep stdout empty.
JSON output has exactly the top-level fields status and findings. Each finding has id, severity, summary, and optional detail and request_id. Use --plain for a copy-safe TSV table. Use --jq or --template to reshape the same stable JSON bytes that --json emits.
svanja help
Help provides help for any command in the application. Type svanja help [command] for full details.
svanja help [command] [flags]
Works without a key.
svanja login
Authorize the CLI with browser device login when available, or validate a copied team API key with GET /api/v1/whoami and store it for future commands.
svanja login [flags]
Works without a key.
| Flag |
What it does |
--api-key
|
use manual API-key entry instead of browser login |
--web
|
use browser device login |
svanja login
svanja login --web
svanja login --api-key
svanja login --profile staging --base-url https://example.test
svanja login --plain --api-key --no-prompt --force < api-key.txt
Details
Team API keys are created and revoked in the product web app. Manual API-key entry reads the key from a secret prompt or from non-terminal stdin; it is never accepted from a flag or SVANJA_API_KEY. --api-key only selects manual entry and does not accept the key value.
Interactive input prompts for the product base URL only when the built-in default is still selected. Values supplied by --base-url, SVANJA_BASE_URL, or the selected profile are used as-is.
With no selector, interactive login discovers first-party browser login. If the server supports it, login prints the verification URL and user code to stderr, tries to open the browser, polls until approval or terminal failure, validates the issued API key with GET /api/v1/whoami, then stores it. Discovery responses that report browser login disabled or an older server fall back to manual API-key entry. Ambiguous discovery failures do not fall back.
Use --web to force browser login. With --web --no-prompt, login prints the verification URL and user code without opening a browser. Use --api-key to force manual entry and skip discovery. Non-terminal default login also uses manual entry without discovery, preserving piped-key automation. With --no-prompt and terminal stdin, manual login fails with guidance to pipe the key.
The write target is the resolved profile from --profile, SVANJA_PROFILE, current_profile, or the built-in local profile. When that profile already has a stored key, interactive login asks before reading the replacement key. --force accepts that overwrite confirmation, but it does not provide missing input. With --no-prompt, an overwrite without --force fails before stdin is consumed, the browser is opened, or an authenticated API request is made. Non-terminal manual stdin without --no-prompt keeps the compatible piped-key path and overwrites after successful API validation.
Output is human-readable even when --json is inherited from the root. Use --plain for copy-safe login result rows. jq and template output are not available because login has no stable JSON shape.
If SVANJA_API_KEY is set, login still validates and stores the manual or browser-issued key, then warns after successful output that the environment credential takes precedence for ordinary authenticated commands.
svanja logout
Remove the stored credential for the selected profile without changing non-secret configuration.
svanja logout [flags]
Works without a key.
svanja logout
svanja logout --plain --profile staging
Details
Logout is local and idempotent. It removes only the selected profile's stored auth record and cached metadata, preserving other profiles, config, and current_profile. It does not revoke the API key on the server; revoke keys in the product web app. If SVANJA_API_KEY is set, that environment credential still takes precedence until it is unset.
Team API keys are created and revoked in the product web app. svanja never prints the stored API key; logout shows only non-secret key metadata.
Output is human-readable even when --json is inherited from the root. Use --plain for copy-safe local removal rows. jq and template output are not available because logout has no stable JSON shape.
svanja profile create
Create a saved profile in local config.yml.
svanja profile create <name> [flags]
Works without a key.
| Flag |
What it does |
--project-list-limit
|
default project list limit for the profile |
svanja profile create staging --base-url https://staging.example.test
svanja profile create staging --base-url https://staging.example.test --locale en --project-list-limit 50
svanja profile create staging --base-url https://staging.example.test --plain
Details
Pass the global --base-url flag to set the product base URL for the new profile. Optional global --api-base-url and --locale flags set that profile's API base URL and locale. The API base URL is derived from --base-url when --api-base-url is omitted. Use --project-list-limit to set the profile's default project list limit. Environment variables such as SVANJA_BASE_URL are not used as create input.
This command writes only non-secret config. Stored credentials are managed separately with svanja login and are never created or printed here.
This command has no stable JSON shape, so --jq and --template are not supported.
svanja profile delete
Delete a local profile from config.yml and remove its stored credential record when one exists.
svanja profile delete <name> [flags]
Works without a key.
svanja profile delete staging
svanja profile delete staging --force
svanja profile delete staging --force --plain
Details
This command is local-only. It never revokes a key on the server and never prints the stored API key. It requires confirmation before any write unless --force is supplied. In --no-prompt or non-interactive mode without --force, it fails before changing auth.json or config.yml.
When the deleted profile is current, the current profile switches to the first remaining saved profile in sorted order. If no profiles remain, the CLI-owned config file is removed. Deleting the last profile fails before confirmation when removing the file would discard comments or unknown top-level config keys.
This command has no stable JSON shape, so --jq and --template are not supported.
svanja profile list
List configured connection profiles and show which profile is selected for this invocation.
svanja profile list [flags]
Works without a key.
svanja profile list
svanja profile list --plain
svanja profile list --jq '.profiles[].name'
svanja profile list --template '{{.current_profile}}'
Details
This command reads local config.yml and auth.json only. Stored API keys are reported as non-secret presence, display id, and key name; the API key value is never printed and no API request is made. This stored-auth view is separate from the effective request credential: SVANJA_API_KEY wins for API commands. Run svanja auth status to inspect the effective credential source.
JSON output is an object with current_profile, config_path, auth_path, and a profiles array. Each profile includes name, selected, persisted, base_url, api_base_url, locale, default_output, project_list_limit, and stored_auth. stored_auth includes present, display_id, key_name, team_display_id, team_name, and last_validated_at.
Output modes: default human table, --plain tab-separated rows, --json stable JSON, and --jq/--template transforms over the documented JSON value.
svanja profile show
Show one profile's local, non-secret settings.
svanja profile show [name] [flags]
Works without a key.
svanja profile show
svanja profile show staging
svanja profile show staging --jq .api_base_url
svanja profile show staging --template '{{.name}}'
Details
When no name is supplied, the selected profile is resolved from --profile, SVANJA_PROFILE, current_profile, or the built-in local default. Missing profiles show built-in defaults and are marked as not saved. Stored API keys are reported only as non-secret presence and display metadata; the API key value is never printed and no API request is made. This stored-auth view is separate from the effective request credential: SVANJA_API_KEY wins for API commands. Run svanja auth status to inspect the effective credential source.
All persisted profile names and known profile values are validated before any result is printed. An invalid persisted profile therefore makes inspection fail without partial output, even when a different profile was requested.
JSON output is one profile object with name, selected, persisted, base_url, api_base_url, locale, default_output, project_list_limit, and stored_auth. stored_auth includes present, display_id, key_name, team_display_id, team_name, and last_validated_at.
Output modes: default human detail, --plain tab-separated fields, --json stable JSON, and --jq/--template transforms over the documented JSON value.
svanja profile use
Switch the current profile stored in local config.yml.
svanja profile use <name> [flags]
Works without a key.
svanja profile use staging
svanja profile use staging --plain
Details
The target profile must already exist in config.yml. This command does not read stored credentials, validate API access, or contact the API.
This command has no stable JSON shape, so --jq and --template are not supported.
svanja profile
Manage local connection profiles for product environments without contacting the API. Profiles hold base URL and locale defaults while credentials are stored separately by svanja login. Inspection validates every persisted profile before printing output.
svanja profile [flags]
Works without a key.
svanja profile list
svanja profile show staging
svanja setup
Set up and verify the selected profile with a copied team API key.
svanja setup [flags]
Works without a key.
svanja setup
svanja setup --profile staging --base-url https://example.test
svanja setup --no-prompt < api-key.txt
svanja setup --plain
Details
Team API keys are created and revoked in the product web app. An explicit missing profile name is created and selected. Setup reuses a stored key when possible, verifies it with one GET /api/v1/whoami request, and does not rewrite auth state when that check succeeds. It makes only the config repair needed to reproduce the resolved profile and connection settings later.
Piped stdin:
```text Stored key state | Piped stdin behavior | Result --- | --- | --- No usable stored key | Read the pipe as the copied key | Validate, persist, select the profile, and report ready Stored key passes /whoami | Never read the pipe | Reuse the identity, make only any required config repair, and report ready Stored key returns an authentication-class failure | Never read the pipe | Use the replacement policy below; a non-interactive invocation returns that API error with explicit recovery guidance ```
Only an interactive terminal may replace a stored key rejected for authentication. --force accepts that overwrite confirmation inside an interactive setup. --no-prompt disables replacement even with --force and even on a terminal; setup returns the authentication error and the recovery command instead. Other API, network, protocol, authorization, and rate-limit failures never offer replacement. Exit status 3 identifies the authentication failure. For explicit scripted replacement, run:
```text svanja login --api-key --no-prompt --force < api-key.txt ```
If SVANJA_API_KEY is set, setup still validates the stored or copied profile key, then warns after successful output that the environment credential takes precedence for ordinary authenticated commands.
Output is human-readable even when --json is inherited from the root. Use --plain for seven copy-safe setup result rows. jq, template, response metadata, and dry-run output are not available.
svanja version
Print build metadata for the svanja binary.
svanja version [flags]
Works without a key.
svanja version
svanja version --json
svanja version --jq .version
svanja version --template '{{.version}}'
svanja version --plain
Details
With --json, output is a stable JSON object with exactly these fields:
```text version release version, or "dev" for local builds commit source commit, or "none" for local builds date build date, or "unknown" for local builds go_version Go runtime version os runtime operating system arch runtime architecture ```
The same JSON shape can be filtered with --jq or rendered with --template. Use --plain for copy-safe key/value rows.
svanja whoami
Show the authenticated team and key for the active profile.
svanja whoami [flags]
Needs a stored key (svanja login) or SVANJA_API_KEY.
svanja whoami
svanja whoami --json
svanja whoami --plain
svanja whoami --jq '.team | .name'
svanja whoami --template '{{.team.name}}'
Details
Authentication uses SVANJA_API_KEY when set, otherwise the stored login for the selected profile. Missing credentials exit 3 with stdout empty.
Team API keys are created and revoked in the product web app.
JSON output has exactly these top-level fields: team, key, capabilities, and project_scope. team includes id, display_id, name, plan, plan_label, and api_access. key includes id, display_id, name, preset, expiration, last_used_at, and created_at. expiration includes state and nullable expires_at. The output has no top-level api_key, plan, locale, request_id, or metadata wrapper.
Use --plain for copy-safe detail rows. Use --jq or --template to reshape the same stable JSON bytes that --json emits.
For selected-project keys, whoami may return only a capped project sample. When has_more is true, the sample is not the complete accessible project set.
Global flags
The command line accepts these flags on every command. Whether one has
an effect depends on the command: --json, --jq
or --include-meta, for example, only apply to commands with
that output. A command's Details say which outputs it has.
| Flag |
What it does |
--api-base-url
|
API base URL (defaults to <base-url>/api/v1) |
--auth-file
|
path to the CLI auth file |
--base-url
|
product web base URL |
--config
|
path to the CLI config file |
--debug
|
write redacted request details to stderr |
--force
|
answer yes to every confirmation so the command runs without asking; does not supply missing input |
--include-meta
|
include safe response metadata in machine output where supported |
--jq
|
filter supported JSON output with a jq expression |
--json
|
print stable JSON output where supported |
--locale
|
response language sent as Accept-Language (en or de) |
--no-ansi
|
disable ANSI terminal controls and paging where supported |
--no-color
|
disable color in human output where supported |
--no-pager
|
disable pager use for long human output where supported |
--no-prompt
|
fail instead of prompting for interactive input |
--plain
|
print copy-safe plain output where supported |
--profile
|
profile to use for this invocation |
--template
|
render supported JSON output with a Go text/template |
--yes
|
same as --force |