Command lineGetting started
Signing in
kcloud acts as the account you use in the panel, with its role and its permissions. Signing in through the browser types no password into the terminal.
Step 1: Sign in through the browser
The command shows a code and opens the panel on the page that approves a sign-in. Check that the panel shows the same code and click Approve. The terminal then receives a token and keeps it in ~/.kikimora-cloud/cli.json.
$ kcloud loginOutput
┌ kcloud login https://cloud.kikimora.dev │ ◇ Waiting for the panel ───────────────────────────────────────╮ │ │ │ Code BCDF-GHJK │ │ Address https://cloud.kikimora.dev/authorize?code=BCDF-GHJK │ │ │ │ Approve the sign-in there. The code expires in ten minutes. │ │ │ ├───────────────────────────────────────────────────────────────╯ │ ◇ Approved by anna.nowak@example.com │ └ Signed in to https://cloud.kikimora.dev as anna.nowak@example.com of Acme on 1.9.0.
The code expires in ten minutes. When no browser opens, open the address printed under the code yourself. In the panel this is the page Authorize a command line, which the guide “Approving a kcloud sign-in” describes.
Step 2: Sign in with a token
On a machine without a browser, create a token on the Access tokens page of the panel or with kcloud tokens create, and pipe it into the command, here from the file token.txt.
$ kcloud login --with-token < token.txtOutput
┌ kcloud login https://cloud.kikimora.dev │ └ Signed in to https://cloud.kikimora.dev as anna.nowak@example.com of Acme on 1.9.0.
Step 3: Check who you are
The command shows the address of the platform, the account, the organization, the role in it, the language of the panel and the organization kcloud acts in.
$ kcloud whoamiOutput
FIELD VALUE instance https://cloud.kikimora.dev email anna.nowak@example.com organization Acme (acme) role admin platform admin no acts in Acme (acme) locale en
Step 4: Sign out
The command revokes the token of this address and forgets it here. The token stops working everywhere you copied it to as well.
$ kcloud logoutOutput
Revoked the token of https://cloud.kikimora.dev and forgot it here.
Step 5: Sign out and keep the token
With --keep-token kcloud only forgets the token on this machine, and the token keeps working, for instance in the CI pipeline that uses it.
$ kcloud logout --keep-tokenOutput
Forgot https://cloud.kikimora.dev here. Its token is still usable.
Matches the panel at cloud.kikimora.dev.