Skip to content
DocsAll docs
Console

Access

Install the kloudlite CLI, sign in, and manage the logins and credentials of your account.

Last updated

On this page

Description and operation

General

You sign in to the console in a browser. The kloudlite CLI signs in with a device code that you approve in the console. The SDKs use the CLI login of the computer they run on.

Your handle identifies your account in every address, for example alice/api for a repository. You choose it after the first sign-in.

CredentialUsed forLifetime
Console sessionThe console.12 hours.
CLI loginkloudlite, the SDKs and the /v1 API. One for each computer.30 days, or until revoked.
API tokenGit over HTTPS and the container registry, for one owner.Until revoked.
SSH keyGit over SSH.Until removed.
Signing keyVerified commits. It gives no access.Until removed.

Sign-in methods

MethodNote
Email linkThe link works once and expires after 15 minutes.
PasskeyAdd it in Profile settings after the first sign-in.
GitHub or GoogleShown when the provider is enabled.

A handle has 3 to 39 characters: lowercase letters, digits and -, with no - at the start or end. Accounts and teams share one set of handles.

Install

The install script puts kloudlite and kl-tui in ~/.local/bin and verifies each file against the release checksum. It supports macOS and Linux on x86_64 and arm64, and needs no administrator rights. kl-tui is not available on Linux arm64.

VariableDefaultMeaning
BIN_DIR~/.local/binThe install directory.
KL_CONNECT_VERSIONNewest releaseA release tag, for example kloudlite-v0.1.0.

Tasks

Install kloudlite

Reason for the task: Install the CLI on your computer.

Job set-up

Procedure

  1. Run the install script.

    CLI
    curl -fsSL https://dev.kloudlite.io/install.sh | sh
  2. If the script prints Add it to your PATH, run the export line it shows and add it to your shell profile.

Close-out

  1. Run kloudlite --version. It prints the version.

Sign in with kloudlite

Reason for the task: Give the CLI and the SDKs a login for your account.

Job set-up

Procedure

  1. Run the login command. It opens the approval page in your browser.

    CLI
    kloudlite login
  2. Make sure that the page shows the name of your computer, then select Approve.

Close-out

  1. Make sure that the command prints Logged in as and your handle.

Sign out of kloudlite

Reason for the task: Remove the login from a computer.

Job set-up

Procedure

  1. Run the logout command. It revokes the login and deletes ~/.config/kloudlite/config.json.

    CLI
    kloudlite logout

Close-out

  1. Make sure that the command prints Logged out.

Revoke a CLI login

Reason for the task: End the login of a computer that you no longer use.

Job set-up

CAUTION

A revoked login stops at once. That computer must sign in again.

Procedure

  1. Show your CLI logins. The name is the computer.

    Python
    from kloudlite import Kloudlitekl = Kloudlite()for t in kl.request("GET", "/v1/cli/tokens"):    print(t["id"], t["name"], t["expiresAt"])
    TypeScript
    import { Kloudlite } from "./index.ts";const kl = new Kloudlite();const tokens = (await kl.request("GET", "/v1/cli/tokens")) as { id: string; name: string; expiresAt: string }[];for (const t of tokens) console.log(t.id, t.name, t.expiresAt);
    Go
    kl := kloudlite.New(kloudlite.Options{})var tokens []map[string]anyif err := kl.Request("GET", "/v1/cli/tokens", kloudlite.RequestOptions{Out: &tokens}); err != nil {    log.Fatal(err)}for _, t := range tokens {    fmt.Println(t["id"], t["name"], t["expiresAt"])}
    Ruby
    require_relative "kloudlite"kl = Kloudlite::Client.newkl.request("GET", "/v1/cli/tokens").each { |t| puts [t["id"], t["name"], t["expiresAt"]].join(" ") }
    Java
    var kl = new Kloudlite();System.out.println(kl.request("GET", "/v1/cli/tokens"));
    CLI
    kloudlite request GET /v1/cli/tokens
  2. Delete the login. Replace ID with its id.

    Python
    kl.request("DELETE", "/v1/cli/tokens/ID")
    TypeScript
    await kl.request("DELETE", "/v1/cli/tokens/ID");
    Go
    if err := kl.Request("DELETE", "/v1/cli/tokens/ID", kloudlite.RequestOptions{}); err != nil {    log.Fatal(err)}
    Ruby
    kl.request("DELETE", "/v1/cli/tokens/ID")
    Java
    kl.request("DELETE", "/v1/cli/tokens/ID");
    CLI
    kloudlite request DELETE /v1/cli/tokens/ID

Close-out

  1. Show the logins again. Make sure that the id is gone.

Troubleshooting

SymptomPossible causeCorrective action
unsupported OS or unsupported architectureThe computer is not macOS or Linux on x86_64 or arm64.Use a supported computer.
could not find the latest releaseThe script cannot reach GitHub.Check the network and run the script again.
checksum mismatchThe download is incomplete or changed.Run the script again.
kloudlite: command not foundThe install directory is not in PATH.Run the export line that the script printed.
timed out waiting for approvalThe code was not approved within 10 minutes.Run kloudlite login again.
that login expired or was deniedThe code expired or was already used.Run kloudlite login again.
pick a handle before signing in from the CLIThe account has no handle.Sign in to the console, choose a handle, then run kloudlite login.
429 from kloudlite loginMore than 20 codes from your network in 10 minutes.Wait 10 minutes.
not logged in or your login has expiredThe computer has no valid CLI login.Run kloudlite login.
401 with this CLI login was revokedThe login was revoked.Run kloudlite login.
That sign-in link is no longer validThe link was used or is older than 15 minutes.Request a new link.