Skip to content
DocsAll docs
Console

Access

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

Last updated

On this page

Overview

You sign in to the console in a browser. The kode 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, or an API token that you set in KODE_TOKEN.

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 loginkode, the SDKs, and the /v1 API. One for each computer: a new login replaces the old one.30 days, or until revoked.
API tokenScripts, CI jobs, and integrations on a set of /v1 routes, within a reach and grants that you choose.1 to 365 days, or 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 kode and kd-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. kd-tui is not available on Linux arm64.

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

Tasks

Install kode

Reason for the task

Install the CLI on your computer.

Job set-up

  • Access: you.
  • References: kode.

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 kode --version. It prints the version.

Sign in with kode

Reason for the task

Give the CLI and the SDKs a login for your account.

Job set-up

  • Access: you. Only you can approve the code.
  • References: kode login.

Procedure

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

    CLI
    kode 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 kode

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/kode/config.json.

    CLI
    kode 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 Kodekl = Kloudlite()for t in kl.request("GET", "/v1/cli/tokens"):    print(t["id"], t["name"], t["expiresAt"])
    TypeScript
    import { Kode } 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
    kode request GET /v1/cli/tokens
  2. Delete the login. Replace {id} with the id of the login.

    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
    kode 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.
kode: 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 kode login again.
that login expired or was deniedThe code expired or was already used.Run kode 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 kode login.
429 from kode 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 kode login.
401 with this CLI login was revokedThe login was revoked.Run kode login.
That sign-in link is no longer validThe link was used or is older than 15 minutes.Request a new link.