Login and contexts
Weik.io 2026.2Log in to your Weik.io installation, keep several installations and defaults as contexts, and check which installation and key a command uses. Video
Watch: Connecting the Weik.io CLI, 2:59
The video installs the weikio CLI, signs in to an installation through the browser and switches between two contexts.
This part of the video couldn't be loaded.
On this page
A context is an installation’s address with an API key and an optional default project and environment, kept on your machine. weikio login creates a context and makes it current, and every later command uses the current context unless you pass --context, --server, --project or --env.
The key goes to the system keyring when there is one, and otherwise to a credentials file beside the configuration that only you can read. The configuration is ~/.config/weikio/config.yaml on Linux and macOS, or under $XDG_CONFIG_HOME when it’s set, and %APPDATA%\weikio\config.yaml on Windows. A pipeline doesn’t log in: it sets WEIKIO_SERVER and WEIKIO_API_KEY, and WEIKIO_PROJECT and WEIKIO_ENV when it needs them.
Commands on this page#
| Command | What it does |
|---|---|
weikio login |
Log in to an installation and make it the current context. |
weikio logout |
Remove a context’s stored key (the context is kept). |
weikio context list |
List the contexts and which one is current. |
weikio context use |
Make a context current. |
weikio context show |
Show a context and the ID of its API key. |
weikio context set |
Change a context’s address, project or environment (a new address removes its stored key). |
weikio context rename |
Rename a context. |
weikio context delete |
Delete a context and its stored key. |
weikio whoami |
Show the installation, the context, the key’s owner and its grants. |
weikio version |
Print the CLI’s and the installation’s versions. |
weikio completion |
Print the completion script for one shell. |
The flags every command accepts, such as --env, --project, -o and --context, are on the CLI reference page and are left out of the tables below.
weikio login#
Log in to an installation and make it the current context. A login to an http address on another machine says first that the key will travel unencrypted and names the same login at the https address. With no key given, the command opens your browser at the installation’s approval page and waits. The page shows your machine’s name, the address the request came from and the key’s rights and expiry, and approving it gives the CLI a key named after your machine. On a machine without a browser, give the key in WEIKIO_API_KEY or pipe it in, and the command asks for it with hidden input otherwise. When the platform’s own authority signed the hub’s certificate, --authority-fingerprint gives that authority’s SHA-256 fingerprint for a login without a terminal.
weikio login <server-url> [--name <ctx>] [--project P] [--env E] [--authority-fingerprint SHA256]| Argument or flag | What it does |
|---|---|
<server- |
The base URL of the installation. |
--name <name> |
The context’s name, by default the installation’s host[:port]. |
-- |
The SHA-256 fingerprint of the platform authority to trust, for a login without a terminal. |
Who can run it: any valid API key.
API: POST /api/v1/auth/cli-login/_start, GET /api/v1/auth/cli-login/{requestId}, POST /api/v1/auth/cli-login/{requestId}/approve, POST /api/v1/auth/cli-login/{requestId}/redeem, GET /api/v1/whoami, GET /api/v1/settings/install/authority.
$ weikio login https://hub.example --project sandbox --env devtestAPI key: ********
Context 'hub.example' saved and made current (server https://hub.example, project sandbox, environment devtest).$ weikio login https://hub.exampleAPI key: ********
Context 'hub.example' updated and made current (project sandbox and environment devtest kept).$ WEIKIO_API_KEY="$CI_KEY" weikio get environments --server https://hub.example -o json | jq -r '.items[].name'devtest
productionweikio logout#
Remove a context’s stored key. The context stays, so weikio login with the same address fills it again.
weikio logout [<ctx>]| Argument or flag | What it does |
|---|---|
<context> |
The context, by default the current one. |
Who can run it: anyone, because the command runs on your machine.
weikio context list#
List the contexts and which one is current.
weikio context listWho can run it: anyone, because the command runs on your machine.
$ weikio context listNAME SERVER PROJECT ENVIRONMENT CURRENT
hub.example https://hub.example sandbox devtest *
ops https://hub.example - -weikio context use#
Make a context current.
weikio context use <name>| Argument or flag | What it does |
|---|---|
<name> |
The context to make current. |
Who can run it: anyone, because the command runs on your machine.
weikio context show#
Show a context and the ID of its API key.
weikio context show [<name>]| Argument or flag | What it does |
|---|---|
<name> |
The context, by default the current one. |
Who can run it: anyone, because the command runs on your machine.
weikio context set#
Change a context’s address, project or environment (a new address removes its stored key).
weikio context set [<name>] [--server URL] [--project P] [--env E]| Argument or flag | What it does |
|---|---|
<name> |
The context, by default the current one. |
Who can run it: anyone. When the context has a key, the command also checks the environment on the installation.
API: GET /api/v1/environments/{name}.
$ weikio context set --env productionwarning: 'production' is a production environment: every write to it needs --env production.
Context 'hub.example' updated (environment production).weikio context rename#
Rename a context.
weikio context rename <old> <new>| Argument or flag | What it does |
|---|---|
<old> |
The context to rename. |
<new> |
The new name. |
Who can run it: anyone, because the command runs on your machine.
weikio context delete#
Delete a context and its stored key.
weikio context delete <name>| Argument or flag | What it does |
|---|---|
<name> |
The context to delete. |
Who can run it: anyone, because the command runs on your machine.
weikio whoami#
Show the installation, the context, the key’s owner and its grants. Use it to check which key a pipeline runs with and what that key may do.
weikio whoamiWho can run it: any valid API key.
API: GET /api/v1/whoami.
weikio version#
Print the CLI’s and the installation’s versions. The same two lines come from weikio --version, and the server: line needs a context or --server.
weikio versionWho can run it: anyone for the CLI’s version, and any API key for the installation’s.
API: GET /api/v1/version.
$ weikio versionweikio 2026.2.2 (linux/x64)
server: https://hub.example 2026.2.2weikio completion#
Print the completion script for one shell. Write the script to your shell’s completion folder, for example weikio completion bash > ~/.local/share/bash-completion/completions/weikio.
weikio completion bash|zsh|fish|powershell| Argument or flag | What it does |
|---|---|
<shell> |
bash, zsh, fish or powershell. |
Who can run it: anyone, because the command runs on your machine.
Exit codes#
The commands on this page exit with the codes in the exit code table: 0 on success, 1 when Weik.io refuses a change, 2 for a usage error, 3 when the key is missing or not allowed, 4 when something isn’t found, 5 for a conflicting change, 6 when Weik.io can’t be reached and 8 when a document isn’t valid.