Cloud logins
komando talks to AWS itself, with no aws CLI: it uses the profiles in your ~/.aws/config, and a person renews an SSO login with one command.
Log in to AWS IAM Identity Center (SSO)
For a profile in ~/.aws/config that uses SSO (sso_session or sso_start_url), or a profile that assumes a role from one (role_arn with source_profile):
komando login aws --profile prod # a person signs in once in the browser
komando conn add backups 's3://my-bucket/db?region=eu-west-1' --option aws_profile=prod
komando storage list backups # uses the login until it runs out
komando shows a code and opens the AWS sign-in page in your browser. Confirm the same code there. The login is saved where the aws CLI keeps it (~/.aws/sso/cache, readable only by you), so komando, the AWS SDKs and the aws CLI all use it.
- Without
--profile, komando usesAWS_PROFILE, elsedefault. It does not ask: the usual profile is the answer. komando login aws --profile prod --dry-runchecks the profile and shows its sign-in page (sso_start_url) and region, and logs in to nothing.- A profile with keys in
~/.aws/credentialsneeds no login. Runningkomando login awsfor it says so (AWS_FAILED). - Cloud logins are lower case:
komando login AWSstops withUSAGEand points tokomando login aws. - komando opens only an
https://sign-in address in the browser. On a machine without a browser, open the printed address on any device. - Ctrl-C while komando waits for the sign-in stops it (
CANCELLED); the old login, if any, stays as it was.
AI agents cannot log in: the sign-in happens in a person's browser. An agent gets NEEDS_PERSON (exit 6) with the hint ask the user to run komando login aws --profile prod in their own terminal. After the person logs in, the agent's commands use that login. A script without a terminal gets NEEDS_PERSON (exit 6), as an agent does. komando never puts the token in a command line, its output or the audit log; the audit records only login.aws and the profile name.
Use an AWS profile in a conn
A conn names a profile with --option aws_profile=NAME. komando reads the profile each time, so SSO, assumed roles and temporary keys work as the aws CLI uses them, and no key is stored in komando:
komando conn add backups 's3://my-bucket/db?region=eu-west-1' --option aws_profile=prod # S3
komando conn add orders sqs://eu-west-1 --option aws_profile=prod # SQS
komando registry add ecr registry://AWS@123456789012.dkr.ecr.eu-west-1.amazonaws.com --option aws_profile=prod
komando conn edit backups --option aws_profile=staging # another profile
- The region comes from the conn (
region=for S3, the address for SQS and ECR), not from the profile. aws_profile=defaultuses the usual AWS chain: theAWS_*variables, the default profile, or the role of the machine komando runs on.- Secrets from AWS Secrets Manager (
--password-ref aws-sm:NAME) use the usual chain too (AWS_PROFILEpicks the profile).
See Storage, Queues and Container registries.
Add a conn for every S3 bucket
komando import aws --dry-run # what it would add
komando import aws # one storage conn per bucket of each profile
komando import aws ~/work/aws-config
Each conn uses its profile (aws_profile), so no key is copied. A profile whose login has run out, or that has no keys, is skipped with a note saying what fixes it: komando login aws --profile NAME for an SSO profile, the credentials file for the others. Then run the import again. See Moving in.
With a FILE, the conns keep only each profile's name: later commands read ~/.aws/config (or AWS_CONFIG_FILE), so put the profiles there too, or they stop with AWS_PROFILE_NOT_FOUND.
See and end an AWS login
komando status lists the SSO logins of the profiles in ~/.aws/config (made by komando login aws, aws sso login or an AWS SDK): the profiles that share each one and when its token runs out. A login with a refresh token (renews: true) gets a new token by itself after that, for as long as the AWS session lasts.
komando logout aws --profile prod # end it now
komando logout aws --all # every SSO login of your profiles
komando logout aws does what aws sso logout does: it tells AWS to end the token and deletes the login in ~/.aws/sso/cache, so komando, the AWS SDKs and the aws CLI all need komando login aws again. Profiles that share the login (one sso-session) are logged out together. When AWS cannot be reached, the login on this computer still ends (revoked: false); the token then runs out by itself. It never shows the token.
Google Cloud and Azure
Google Cloud and Azure sign-in are not available yet. What works instead:
- Google Cloud: your application default credentials (
GOOGLE_APPLICATION_CREDENTIALS, or the file gcloud saved), or a service account key in the vault:komando secret set gcs-key < key.json komando conn add media gs://my-bucket/site --password-ref secret:gcs-key - Azure: an Azure blob conn takes the storage account key or a SAS token. Key Vault secrets (
--password-ref azure-kv:VAULT/NAME) use a service principal (AZURE_TENANT_ID,AZURE_CLIENT_ID,AZURE_CLIENT_SECRET), a token the Azure CLI saved, or the machine's managed identity.komando secret set blob-key komando conn add files azblob://mystorageacct@uploads --password-ref secret:blob-key
Registries on Google Cloud and Azure log in the same way: see Container registries.
A cloud login goes only to the cloud's own sign-in address:
- A Google login file that names addresses (a workload or workforce identity file,
external_account; an impersonated service account) is used only when they are Google's token services (https://sts.googleapis.com/v1/token,https://iamcredentials.googleapis.com/...). AZURE_AUTHORITY_HOSThas to be one of Azure's sign-in hosts.- gcloud's login and the cloud registry logins never go to a conn with a CA of its own (
?ca=) or?resolve=.
For an AI agent's command, more is fixed, because the agent sets the variables on its own command line:
- As a Google login file only a gcloud login (
gcloud auth application-default login) or a service account key is used; any other kind stops withNEEDS_PERSON: the user sets that login up in their own terminal. AWS_ENDPOINT_URL,AWS_ENDPOINT_URL_*and a profile'sendpoint_urlare not followed, nor a container credentials address (AWS_CONTAINER_CREDENTIALS_FULL_URI) that is not ECS's or EKS's. An emulator or VPC endpoint goes in the conn (endpoint=).- The file named by
AZURE_FEDERATED_TOKEN_FILE,AWS_WEB_IDENTITY_TOKEN_FILE(orweb_identity_token_filein an AWS profile) may not be a private key, komando's own data, a credential store or a file that holds secrets by its name:NEEDS_PERSON(no flag lifts it; the user sets the login up in their own terminal).
Limits
- Only AWS has a
komando login; Google Cloud and Azure use the logins above. aws,gcpandazure(any case) cannot be the name of a new server, conn or VPN, asallcannot: those words are the cloud logins.
Troubleshooting
| Code | What happened | What to do |
|---|---|---|
AWS_LOGIN_REQUIRED (exit 4) | the SSO login of the profile ran out, or was never made | a person runs komando login aws --profile NAME, the command in the hint |
AWS_FAILED (exit 4) | the profile has no SSO and gave no keys, or the role it assumes was refused | the hint says which: add the keys to ~/.aws/credentials, or check the role and its source profile |
AWS_PROFILE_NOT_FOUND (exit 3) | the profile is not in ~/.aws/config or ~/.aws/credentials | add it, or fix the conn's --option aws_profile |
NEEDS_PERSON (exit 6) | an AI agent ran komando login aws | the person runs it in their own terminal |
CANCELLED (exit 1) | Ctrl-C while waiting for the sign-in | run it again; the old login is unchanged |
Source: docs/features/cloud.md in sgnd/komando at commit b622784.