Kater CLI Set up
kater login
Signs you in to the Kater API of your target through your browser, and saves your credentials in your computer's keychain.
You sign in one time, and the CLI refreshes your sign-in when it expires. Commands that reach Kater need it, such as kater git clone. Commands that only read your files do not.
Examples
# Sign in to the Kater API of your profile's default targetkater login# Sign in to the Kater API of the prod targetkater login --target prod# Check that you are signed in, and as whomkater auth statusOptions
It also takes the global options --json and --help.
How the sign-in works
- The CLI opens your default browser on the sign-in page. It waits up to 3 minutes for you to sign in.
- The browser comes back to the CLI on your own computer. When another program uses that port, close that program and try again.
- The CLI asks the Kater API who you are. When the API does not accept the sign-in, the CLI saves nothing.
Which Kater API
The target’s api_url in profiles.yml names the Kater API. When there is no profiles.yml, kater login writes ~/.kater/profiles.yml with the profile kater, whose target prod is Kater’s own API, as kater init does. --target and --profile select another target or profile. See Configuration. kater debug shows the target that a command uses.
Where your sign-in is kept
- In your keychain. The CLI keeps your credentials in macOS Keychain, Windows Credential Locker, or Secret Service or KWallet on Linux. The keychain must be available and unlocked. The CLI never writes them to a plain file.
- Without a keychain. On a computer with no keychain, such as a server, give the target a
tokenfrom the environment, such astoken: "{{ env_var('KATER_CI_TOKEN') }}". See Install and sign in. - One sign-in for each Kater API. The CLI keeps one token for each Kater API. Every target that names the same Kater API uses that one sign-in.
- Your addresses. The sign-in address, the client id and the address your browser comes back to come from the target’s
auth_url,client_idandredirect_uri. Without them, the CLI gets them from the Kater API, atGET /v1/sign-in-config, the first time you sign in to it. It accepts only an HTTPS sign-in address, or alocalhostaddress for a Kater API onlocalhost. It saves them for that API in~/.kater/sign-ins.json. These values are not secrets.