Install the CLI
Weik.io 2026.2Install the weikio CLI, a native binary for Linux and Windows on x64, and sign in to your Weik.io installation. Product page · 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
You and your pipelines work with your Weik.io installation through the weikio CLI, whose commands are HTTP calls to the installation’s API.
Install it#
The install scripts download the newest release and check the file against the release’s SHA256SUMS. They run the CLI once before they put it in place.
On Linux (x64):
$ curl -fsSL https://weik.io/install.sh | shThe line needs curl and ca-certificates. Minimal images such as debian:12 don’t have them, so install them there first with apt-get update && apt-get install -y curl ca-certificates.
The script installs the CLI as ~/.local/bin/weikio without asking anything or changing your shell profiles. When ~/.local/bin isn’t on your PATH, the script prints the line to add. When another weikio comes first on your PATH, the script warns you.
On Windows (x64), in Windows PowerShell 5.1 or PowerShell 7:
irm https://weik.io/install.ps1 | iexThe script installs %LOCALAPPDATA%\Programs\weikio\weikio.exe without administrator rights and adds its folder to your user PATH once.
Adafy Oy signs the Windows CLI.
To install one release, such as the one a pipeline is pinned to, set WEIKIO_CLI_VERSION:
$ curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.4 shThe download page has the CLI files of each release with their checksums.
Check the version#
$ weikio versionweikio 2026.2.2 (linux/x64)
server: https://hub.example 2026.2.2The second line is the installation’s release. Before you sign in, it says server: not logged in.
Sign in#
$ weikio login https://hub.example --project sandbox --env devtestOn a machine with a browser, the CLI opens the installation’s approval page. When you approve the request there, the CLI gets a new key with the rights and expiry the page shows.
When WEIKIO_API_KEY has a key, or you pipe one in, the CLI uses that key as it is.
Without a browser, the CLI asks for an API key with hidden input:
API key: ********
Context 'hub.example' saved and made current (server https://hub.example, project sandbox, environment devtest).
The CLI keeps the key in your system’s keyring, or in the Credential Manager on Windows. Where there is no keyring, the key goes into a file only you can read, next to the CLI’s configuration.
Contexts#
A context keeps an installation’s address and a key, and optionally a default project and environment. weikio login creates a context named after the host in the address, and --name gives it another name.
$ weikio context listNAME SERVER PROJECT ENVIRONMENT CURRENT
hub.example https://hub.example sandbox devtest *
ops https://hub.example - -weikio context use ops switches to another context.
weikio context set --env production changes the current one, and the CLI warns that a write to production still needs --env production, as Environments and promotion explains.
Who you are#
When a command is refused with exit code 3, run weikio whoami to see what the key may do. It prints the installation the call went to and these facts about the key:
- The key’s id and the user it belongs to
- Whether it’s a platform administrator’s key
- The key’s grants, each with its project and role and what the grant is limited to
Output formats#
Commands print a table by default and accept -o json or -o yaml for scripts. With those, standard output has only the records, so you can pipe it to jq:
$ WEIKIO_API_KEY="$CI_KEY" weikio get environments --server https://hub.example -o json | jq -r '.items[].name'devtest
productionThese flags shorten the output:
| Flag | What it does |
|---|---|
-q |
Prints only the name of each record |
-- |
Leaves out the header row |
The CLI prints times in UTC.
In a pipeline#
A pipeline sets the context with these environment variables instead of a login:
| Variable | What it sets |
|---|---|
WEIKIO_ |
The installation’s address |
WEIKIO_ |
The API key |
WEIKIO_ |
The project |
WEIKIO_ENV |
The environment |
WEIKIO_ |
The reason every change records in the audit log |
A flag wins over the variable, and the variable wins over the context. Keep integrations in Git has complete workflow files.
Shell completion#
weikio completion prints the completion script for bash, zsh, fish or PowerShell. For bash, add this line to ~/.bashrc:
$ source <(weikio completion bash)weikio --help lists the commands under nine headings, and weikio <command> --help prints the help of one command. The CLI reference has every command with its flags.