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.
| Credential | Used for | Lifetime |
|---|---|---|
| Console session | The console. | 12 hours. |
| CLI login | kode, the SDKs, and the /v1 API. One for each computer: a new login replaces the old one. | 30 days, or until revoked. |
| API token | Scripts, 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 key | Git over SSH. | Until removed. |
| Signing key | Verified commits. It gives no access. | Until removed. |
Sign-in methods
| Method | Note |
|---|---|
| Email link | The link works once and expires after 15 minutes. |
| Passkey | Add it in Profile settings after the first sign-in. |
| GitHub or Google | Shown 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.
| Variable | Default | Meaning |
|---|---|---|
BIN_DIR | ~/.local/bin | The install directory. |
KD_CONNECT_VERSION | Newest release | A 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
Run the install script.
curl -fsSL https://dev.kloudlite.io/install.sh | shIf the script prints
Add it to your PATH, run theexportline it shows and add it to your shell profile.
Close-out
- 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
Run the login command. It opens the approval page in your browser.
kode loginMake sure that the page shows the name of your computer, then select Approve.
Close-out
- Make sure that the command prints
Logged in asand your handle.
Sign out of kode
Reason for the task
Remove the login from a computer.
Job set-up
- Access: you.
- References:
kode logout.
Procedure
Run the logout command. It revokes the login and deletes
~/.config/kode/config.json.kode logout
Close-out
- 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
- Access: you.
- References:
GET /v1/cli/tokens,DELETE /v1/cli/tokens/{id}.
A revoked login stops at once. That computer must sign in again.
Procedure
Show your CLI logins. The
nameis the computer.from kloudlite import Kodekl = Kloudlite()for t in kl.request("GET", "/v1/cli/tokens"): print(t["id"], t["name"], t["expiresAt"])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);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"])}require_relative "kloudlite"kl = Kloudlite::Client.newkl.request("GET", "/v1/cli/tokens").each { |t| puts [t["id"], t["name"], t["expiresAt"]].join(" ") }var kl = new Kloudlite();System.out.println(kl.request("GET", "/v1/cli/tokens"));kode request GET /v1/cli/tokensDelete the login. Replace
{id}with theidof the login.kl.request("DELETE", "/v1/cli/tokens/{id}")await kl.request("DELETE", "/v1/cli/tokens/{id}");if err := kl.Request("DELETE", "/v1/cli/tokens/{id}", kloudlite.RequestOptions{}); err != nil { log.Fatal(err)}kl.request("DELETE", "/v1/cli/tokens/{id}")kl.request("DELETE", "/v1/cli/tokens/{id}");kode request DELETE /v1/cli/tokens/{id}
Close-out
- Show the logins again. Make sure that the
idis gone.
Troubleshooting
| Symptom | Possible cause | Corrective action |
|---|---|---|
unsupported OS or unsupported architecture | The computer is not macOS or Linux on x86_64 or arm64. | Use a supported computer. |
could not find the latest release | The script cannot reach GitHub. | Check the network and run the script again. |
checksum mismatch | The download is incomplete or changed. | Run the script again. |
kode: command not found | The install directory is not in PATH. | Run the export line that the script printed. |
timed out waiting for approval | The code was not approved within 10 minutes. | Run kode login again. |
that login expired or was denied | The code expired or was already used. | Run kode login again. |
pick a handle before signing in from the CLI | The account has no handle. | Sign in to the console, choose a handle, then run kode login. |
429 from kode login | More than 20 codes from your network in 10 minutes. | Wait 10 minutes. |
not logged in or your login has expired | The computer has no valid CLI login. | Run kode login. |
401 with this CLI login was revoked | The login was revoked. | Run kode login. |
That sign-in link is no longer valid | The link was used or is older than 15 minutes. | Request a new link. |