Login and contexts
Weik.io 2026.2Log in to a hub, keep several hubs and defaults as contexts, and check which server and key a command uses.
On this page
A context is a server 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 $XDG_CONFIG_HOME/weikio/config.yaml on Linux and macOS and %APPDATA%\weikio\config.yaml on Windows. A pipeline doesn’t log in at all: 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 a server 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 server, project or environment (a new server removes its stored key). |
weikio context rename |
Rename a context. |
weikio context delete |
Delete a context and its stored key. |
weikio whoami |
Show the server, the context, the key’s owner and its grants. |
weikio version |
Print the CLI and server 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 a server and make it the current context. With no key given, the command opens your browser at the hub’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 server. |
-- |
The context’s name, by default the server’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 is kept). The context stays, so weikio login with the same server fills it again.
weikio logout [<ctx>]| Argument or flag | What it does |
|---|---|
<context> |
The context, by default the current one. |
Who can run it: nothing on the server, because the command runs on your machine.
weikio context list#
List the contexts and which one is current.
weikio context listWho can run it: nothing on the server, 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: nothing on the server, 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: nothing on the server, because the command runs on your machine.
weikio context set#
Change a context’s server, project or environment (a new server 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: nothing, except a check of the environment on the server when the context has a key.
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: nothing on the server, 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: nothing on the server, because the command runs on your machine.
weikio whoami#
Show the server, 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 and server versions. The same two lines come from weikio --version, and the server line needs a context or --server.
weikio versionWho can run it: nothing for the CLI’s version, and any API key for the server’s.
API: GET /api/v1/version.
$ weikio versionweikio 2026.2.1 (linux/x64)
server: https://hub.example 2026.2.1weikio 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: nothing on the server, 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 the hub 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 the hub can’t be reached and 8 when a document isn’t valid.