CLI reference
Weik.io 2026.2Look up the commands of the weikio CLI by group and the rules every command follows.
On this page
Each command of the weikio CLI calls the HTTP API of your Weik.io installation. The CLI is a single program file for Linux and Windows.
These pages describe the weikio CLI of 2026.2.4. weikio version prints the release of your CLI and of the installation it connects to.
Command groups#
Commands that run on a hub server without the API, such as backup and restore, are part of the backend image. The weikio-backend page describes them.
How commands are written#
Commands that read or delete something put the verb first, as in weikio get integrations and weikio delete apikey <key-id>. Commands that create or change something put the kind first, as in weikio project create and weikio env set. If you’re used to kubectl, you can also write weikio create <kind> for every kind that weikio <kind> create creates.
You refer to a record of a project, such as an integration or an API, as <project>/<name>, for example finance/erp-invoice-export. When the project comes from somewhere else, the name alone is enough. The CLI looks for the project in order and uses the first it finds:
metadata.projectin the document--projectWEIKIO_PROJECT- The nearest
project.yamlin a parent folder, for the commands that read files - The current context
When none of them sets a project, or a document and --project refer to different projects, the command stops with exit code 2.
Besides lower-case letters and digits, the only character a name can contain is a hyphen. The names of variables and secrets follow Camel’s property names instead, which also allow upper-case letters and the characters . and _.
Every record also has an ID that never changes. When you rename a record with weikio rename <kind> <name> <new-name>, it keeps its ID and everything stored for it, such as its history.
Contexts and defaults#
A command gets the installation’s address, the key, the project and the environment from the first place that sets each one:
- The command’s flags
- The environment variables
WEIKIO_SERVER,WEIKIO_API_KEY,WEIKIO_PROJECT,WEIKIO_ENVandWEIKIO_CONTEXT - The current context
Login and contexts describes contexts.
A production environment is protected. To change something in it, set the environment outside the context:
--envmetadata.environmentin the documentWEIKIO_ENV
Otherwise, the command stops with exit code 2 and prints the same command with --env added.
Flags every command accepts#
| Flag | What it does |
|---|---|
-- |
Uses this context instead of the current one. |
-- |
Uses this address instead of the context’s. |
-- |
Works in this project. |
--env, -- |
Works in this environment. |
-o, -- |
Sets the output format to table, json or yaml. The default is table. |
-- |
Prints a table without its header row. |
-q |
Prints only the names, one to a line. |
-- |
Prints without colour. |
-h, --help |
Shows the command’s help. |
Every command that changes something also accepts --reason "<text>", which Weik.io stores with the audit record of the change. A pipeline can set WEIKIO_REASON once, for example to the commit’s subject line.
Some commands also record where the change came from:
applyrunversion create
In GitHub Actions, GitLab CI and Azure Pipelines, the CLI fills that in from the pipeline’s variables.
You confirm some changes at a prompt:
- Deleting something
- Changing a production environment
- Restarting a deployment in production
With apply, you confirm only --prune. With variable set and secret set, you confirm only a --restart that reaches a deployment in production.
Add -y to confirm in advance. Without a terminal for the prompt, the command stops with exit code 2 and prints the same command with -y added.
Output#
A list prints as a table with upper-case headers and a dash in each empty cell. A single record prints one Label: and its value to a line.
When a table has no rows, the CLI prints no header row and leaves standard output empty. It prints a line on standard error instead, such as No problems found., or No problems match the filters. when you gave filters.
With -o json or -o yaml, standard output has only the records as the API returns them.
Every command that changes something first prints a Target: line. The line shows which installation, project and environment the command writes to, and where each value came from:
Target: https://hub.example, project finance (from finance/project.yaml), environment production (--env)
A write prints one line for each thing it changed, such as integration finance/hello created (version 0.1.0, built in 4.0 s). An error is one error: line with the reason, followed by the command that fixes it.
| Value | How it’s written |
|---|---|
| A time the CLI prints | In UTC, such as 2026- |
| An age | Such as 4m ago |
| A size | In binary units, such as 512 MiB and 1.5 GiB |
| A length of time you give a flag | With units and without spaces, such as 500ms, 30s, 1h30m or 7d |
A --since value counts back from now.
weikio export is the one command whose output you can give to weikio apply unchanged. The JSON of the other commands is the API’s records.
Roles in this reference#
Each command on these pages has a “Who can run it” line. A grant is a role that a person or a key has in one project, for some or all of its environments. You can limit a grant to named integrations and APIs. What a grant allows depends on the verbs of its role:
| Verb | What it allows |
|---|---|
read |
Reading the project’s records, logs, metrics and traces |
author |
Writing integrations, APIs, kamelets and variables |
operate |
Setting secrets, starting, stopping and invoking deployments, and resending events |
reveal |
Showing a secret’s value, where the environment allows it |
deploy |
Deploying, promoting and rolling back into an environment |
entity- |
Creating and changing entity types |
members |
Adding and removing the project’s members |
Weik.io comes with built-in roles:
| Role | Verbs |
|---|---|
viewer |
read |
editor |
read, author, operate and reveal |
deployer |
The editor’s verbs plus deploy and entity- |
admin |
Every verb |
A platform administrator is a user or key with the platform administrator flag. You need the flag to run any command that manages projects, environments, roles, agents, users, identity providers or settings.
Exit codes#
| Code | Meaning |
|---|---|
| 0 | The command succeeded, including a write that changed nothing. |
| 1 | The command stopped without making the change, for example because a version already exists or a secret has no value. The message ends with the command that fixes it. |
| 2 | A usage error, such as an unknown flag, a missing --env for a production environment, a missing project or a name that breaks the naming rule. |
| 3 | Your key is missing, expired or revoked, or its access doesn’t cover the command. You also get code 3 when your computer’s address is outside the installation’s allowed networks. |
| 4 | What you named doesn’t exist. |
| 5 | The record changed since it was read. The command shows the current one. |
| 6 | Weik.io couldn’t be reached or wasn’t ready, or it was rate limiting your calls or out of storage. Run the command again later. When the change may already be stored or a delete stopped part way, follow the steps in the message instead. |
| 7 | weikio apply wrote some documents and printed refused for others, or weikio diff printed would refuse for a document. |
| 8 | A document or folder isn’t valid. |
| 130 | You stopped the command with Ctrl+C. weikio run and weikio logs -f stop following, but the integration keeps running. |
When you confirm a delete with the wrong name, the command stops with exit code 2 without deleting anything.
weikio diff has codes of its own:
| Code | Meaning |
|---|---|
| 0 | Nothing would change. |
| 1 | The diff failed for the reason in the message. |
| 2 | Something would change. |
| 7 | The diff printed would refuse for at least one document. |
When a nightly weikio diff -f ./finance --env production exits with 2, either someone changed production by hand after the last apply or a change in ./finance hasn’t been applied yet. A usage error also exits with 2. Read the output to find the cause.