Variables and secrets
Weik.io 2026.2Set the variables and secrets that routes use as Camel properties, as a default or for one environment. Video
Watch: Where the values live, 4:37
The video moves a value into a variable and an API key into a secret, and shows what reaches the running integration.
This part of the video couldn't be loaded.
On this page
Routes use variables and secrets as Camel properties, such as {{erp-url}}. A value set without --env is the default, and --env sets an override for one environment. A project’s values reach its integrations, while --integration sets a value for one integration only.
Setting a value doesn’t restart the deployments that use it, so they get the new value at their next start. The command lists those deployments with the command line that restarts them, or restarts them when you add --restart.
Weik.io stores secrets encrypted and lists them without their values.
Commands on this page#
| Command | What it does |
|---|---|
weikio get variables |
List the variables of a project and its integrations. |
weikio describe variable |
Show a variable’s value and description. |
weikio variable set |
Set a variable’s default, or with --env one environment’s override. |
weikio delete variable |
Delete a variable’s default, or with --env one environment’s override. |
weikio get secrets |
List the secrets of a project and its integrations, without values. |
weikio secret set |
Set a secret’s default, or with --env one environment’s override. |
weikio secret reveal |
Print a secret’s value where the environment allows reveals. |
weikio delete secret |
Delete a secret’s default, or with --env one environment’s override. |
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 get variables#
List the variables of a project and its integrations. --resolved with --integration shows the values one deployment receives and where each one comes from.
weikio get variables [--project P] [--env E] [--integration N] [--resolved]| Argument or flag | What it does |
|---|---|
<project> |
The project, by default the current one. |
-- |
Together with --, show the values that integration’s deployment receives. |
-- |
The integration whose own variables to list, or whose deployment -- shows. |
Who can run it: a grant on the project whose role has read.
API: GET /api/v1/projects/{project}/variables, GET /api/v1/environments/{environment}/projects/{project}/variables, GET /api/v1/projects/{project}/integration-variables, GET /api/v1/projects/{project}/integrations/{integration}/variables, GET /api/v1/environments/{environment}/projects/{project}/integrations/{integration}/variables, GET /api/v1/environments/{environment}/projects/{project}/deployments/{name}/configuration.
$ weikio get variables --env production --resolved --integration erp-invoice-exportNAME VALUE SOURCE
erp-url https://erp.example.internal variable:production
page-size 10 deployment-override
erp-api-key ******** secret:production$ weikio get variables --env devtest --resolved --integration billingNAME VALUE SOURCE
greeting Hello from the file application.propertiesweikio describe variable#
Show a variable’s value and description.
weikio describe variable <p>/<name> [--integration N] [--env E]| Argument or flag | What it does |
|---|---|
<variable> |
The variable, as project/name. |
-- |
The integration whose own variable to show. |
Who can run it: a grant on the project whose role has read.
API: GET /api/v1/projects/{project}/variables/{name}, GET /api/v1/environments/{environment}/projects/{project}/variables/{name}, GET /api/v1/projects/{project}/integrations/{integration}/variables/{name}, GET /api/v1/environments/{environment}/projects/{project}/integrations/{integration}/variables/{name}.
weikio variable set#
Set a variable’s default, or with --env one environment’s override. The command lists the deployments the new value reaches.
weikio variable set <p>/<name> <value> [--integration N] [--env E] [--description S] [--restart] [--dry-run] [-y]| Argument or flag | What it does |
|---|---|
<variable> |
The variable, as project/name. |
<value> |
The value. |
-- |
The integration whose own variable to set (only its deployments receive it). |
-- |
Description of the variable. |
-- |
Restart the deployments that use the value, instead of waiting for their next start. |
-- |
Print what would happen and change nothing. |
-y, --yes |
Don’t ask for confirmation. |
-- |
Reason for the change, stored with the audit record. |
Who can run it: a grant on the project whose role has author. A default, set without --env, needs a grant that covers every environment. With --restart, the grant’s role also needs operate.
API: GET /api/v1/projects/{project}/integration-variables, GET /api/v1/projects/{project}/integration-secrets, GET /api/v1/projects/{project}/variables/{name}, GET /api/v1/environments/{environment}/projects/{project}/variables/{name}, PUT /api/v1/projects/{project}/variables/{name}, PUT /api/v1/environments/{environment}/projects/{project}/variables/{name}, PUT /api/v1/projects/{project}/integrations/{integration}/variables/{name}, PUT /api/v1/environments/{environment}/projects/{project}/integrations/{integration}/variables/{name}, PATCH /api/v1/environments/{environment}/projects/{project}/deployments/{name}.
$ weikio apply -f ./finance/variables/ -f ./finance/production/variables/ --env productionTarget: https://hub.example, project finance (from finance/project.yaml), environment production (--env)
variable finance/erp-url unchanged
variable production/finance/erp-url updated
variable production/finance/page-size created
2 deployments take the new value at their next start: production/finance/erp-invoice-export (running), production/finance/nightly-payroll (stopped)
restart the running one now with: weikio restart finance/erp-invoice-export --env production$ weikio variable set finance/page-size 200Target: https://hub.example, project finance (argument), default environment (no --env)
variable finance/page-size updated (revision 4195)
2 deployments take the new value at their next start:
devtest finance/erp-invoice-export (started)
production finance/erp-invoice-export (started)
To restart them now, run:
weikio variable set finance/page-size 200 --restart$ weikio variable set finance/page-size 200 --restartTarget: https://hub.example, project finance (argument), default environment (no --env)
Deployments that will restart:
devtest finance/erp-invoice-export
production finance/erp-invoice-export
'production' is a production environment.
Continue? [y/N] y
variable finance/page-size updated (revision 4196)
deployment devtest/finance/erp-invoice-export restarted
deployment production/finance/erp-invoice-export restarted$ weikio variable set finance/page-size 200 --restart --dry-run --env devtestTarget: https://hub.example, project finance (argument), environment devtest (--env)
Deployments that will restart:
devtest finance/erp-invoice-export
variable finance/page-size would be set for devtest
1 deployment takes the new value at its next start:
devtest finance/erp-invoice-export (started)$ weikio variable set shop/greeting 'Hello from orders' --integration ordersTarget: https://hub.example, project shop (argument), integration orders (--integration), default environment (no --env)
variable shop/greeting created (integration orders, revision 5120)
1 deployment takes the new value at its next start:
devtest shop/orders (started)
To restart it now, run:
weikio variable set shop/greeting 'Hello from orders' --integration orders --restartweikio delete variable#
Delete a variable’s default, or with --env one environment’s override. After you delete an override, the default applies in that environment again.
weikio delete variable <p>/<name> [--integration N] [--env E] [--dry-run] [-y]| Argument or flag | What it does |
|---|---|
<variable> |
The variable, as project/name. |
-- |
The integration whose own variable to delete. |
-- |
Print what would happen and change nothing. |
-y, --yes |
Don’t ask for confirmation. |
-- |
Reason for the change, stored with the audit record. |
Who can run it: a grant on the project whose role has author.
API: DELETE /api/v1/projects/{project}/variables/{name}, DELETE /api/v1/environments/{environment}/projects/{project}/variables/{name}, DELETE /api/v1/projects/{project}/integrations/{integration}/variables/{name}, DELETE /api/v1/environments/{environment}/projects/{project}/integrations/{integration}/variables/{name}.
weikio get secrets#
List the secrets of a project and its integrations, without values.
weikio get secrets [--project P] [--env E] [--integration N]| Argument or flag | What it does |
|---|---|
<project> |
The project, by default the current one. |
-- |
The integration whose own secrets to list. |
Who can run it: a grant on the project whose role has read.
API: GET /api/v1/projects/{project}/secrets, GET /api/v1/environments/{environment}/projects/{project}/secrets, GET /api/v1/projects/{project}/integration-secrets, GET /api/v1/projects/{project}/integrations/{integration}/secrets, GET /api/v1/environments/{environment}/projects/{project}/integrations/{integration}/secrets.
weikio secret set#
Set a secret’s default, or with --env one environment’s override. The value comes from one of these:
- A hidden prompt
- Standard input
- The file you give with
--from-file
The command doesn’t accept the value as an argument, so it doesn’t end up in the shell history.
weikio secret set <p>/<name> [--integration N] [--env E] [--from-file PATH] [--as-file] [--description S] [--restart] [--dry-run] [-y]| Argument or flag | What it does |
|---|---|
<secret> |
The secret, as project/name. |
-- |
The integration whose own secret to set (only its deployments receive it). |
-- |
File to read the value from, instead of standard input. |
-- |
Store the file (up to 128 KiB) and give routes its path. |
-- |
Description of the secret. |
-- |
Restart the deployments that use the value, instead of waiting for their next start. |
-- |
Print what would happen and change nothing. |
-y, --yes |
Don’t ask for confirmation. |
-- |
Reason for the change, stored with the audit record. |
Who can run it: a grant whose role has operate in the environment. A default, set without --env, needs a grant that covers every environment.
API: GET /api/v1/projects/{project}/integration-variables, GET /api/v1/projects/{project}/integration-secrets, GET /api/v1/projects/{project}/secrets/{name}, GET /api/v1/environments/{environment}/projects/{project}/secrets/{name}, PUT /api/v1/projects/{project}/secrets/{name}, PUT /api/v1/environments/{environment}/projects/{project}/secrets/{name}, PUT /api/v1/projects/{project}/integrations/{integration}/secrets/{name}, PUT /api/v1/environments/{environment}/projects/{project}/integrations/{integration}/secrets/{name}, PATCH /api/v1/environments/{environment}/projects/{project}/deployments/{name}.
$ weikio secret set finance/erp-api-key --env devtestTarget: https://hub.example, project finance (argument), environment devtest (--env)
Value:
secret finance/erp-api-key set for devtest (revision 4192)
1 deployment takes the new value at its next start:
devtest finance/erp-invoice-export (started)
To restart it now, run:
weikio secret set finance/erp-api-key --env devtest --restartweikio secret reveal#
Print a secret’s value where the environment allows reveals. Weik.io rate limits reveals and writes each one to the audit log.
weikio secret reveal <p>/<name> [--integration N] [--env E]| Argument or flag | What it does |
|---|---|
<secret> |
The secret, as project/name. |
-- |
The integration whose own secret to reveal. |
-- |
Reason for the change, stored with the audit record. |
Who can run it: a grant whose role has reveal in the environment, and the environment has to allow reveals.
API: GET /api/v1/environments/{environment}/projects/{project}/secrets/{name}/reveal, GET /api/v1/projects/{project}/secrets/{name}/reveal, GET /api/v1/environments/{environment}/projects/{project}/integrations/{integration}/secrets/{name}/reveal, GET /api/v1/projects/{project}/integrations/{integration}/secrets/{name}/reveal.
$ weikio secret reveal finance/erp-api-key --env productionerror: Secret reveals aren't allowed in production.
Ask a platform admin to run:
weikio env set production --allow-secret-reveal=true$ echo $?3weikio delete secret#
Delete a secret’s default, or with --env one environment’s override.
weikio delete secret <p>/<name> [--integration N] [--env E] [--dry-run] [-y]| Argument or flag | What it does |
|---|---|
<secret> |
The secret, as project/name. |
-- |
The integration whose own secret to delete. |
-- |
Print what would happen and change nothing. |
-y, --yes |
Don’t ask for confirmation. |
-- |
Reason for the change, stored with the audit record. |
Who can run it: a grant whose role has operate in the environment.
API: DELETE /api/v1/projects/{project}/secrets/{name}, DELETE /api/v1/environments/{environment}/projects/{project}/secrets/{name}, DELETE /api/v1/projects/{project}/integrations/{integration}/secrets/{name}, DELETE /api/v1/environments/{environment}/projects/{project}/integrations/{integration}/secrets/{name}.
Exit codes#
The commands on this page exit with these codes from the exit code table:
| Code | Meaning |
|---|---|
| 0 | The command succeeded. |
| 1 | Weik.io refused the change. |
| 2 | The command line had a usage error. |
| 3 | The key is missing or not allowed. |
| 4 | Something wasn’t found. |
| 5 | The change conflicted with another change. |
| 6 | Weik.io couldn’t be reached. |
| 8 | A document isn’t valid. |
weikio secret reveal exits 3 in an environment that doesn’t allow reveals. It exits 6 when you go over the rate limit on reveals.