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, but one set with --env overrides it in that environment. A project’s values reach all of its integrations, while a value set with --integration reaches only that integration.
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> |
Identifies the project, which is the current one by default. |
-- |
Shows the values the integration’s deployment receives. Use it with --. |
-- |
Lists this integration’s own variables, or with -- the values its deployment receives. |
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> |
Identifies the variable as project/name. |
-- |
Identifies 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> |
Identifies the variable as project/name. |
<value> |
Sets the variable’s value. |
-- |
Sets the variable for this integration’s deployments only. |
-- |
Sets the variable’s description. |
-- |
Restarts the deployments that use the value, instead of waiting for their next start. |
-- |
Prints what would happen and changes nothing. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change 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> |
Identifies the variable as project/name. |
-- |
Identifies the integration whose own variable to delete. |
-- |
Prints what would happen and changes nothing. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change 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> |
Identifies the project, which is the current one by default. |
-- |
Lists only this integration’s own secrets. |
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 command doesn’t accept the value as an argument, so it doesn’t end up in the shell history. Type the value at the hidden prompt or pipe it to standard input. To read it from a file, use --from-file.
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> |
Identifies the secret as project/name. |
-- |
Sets the secret for this integration’s deployments only. |
-- |
Uses the value in this file instead of standard input. |
-- |
Stores a file of up to 128 KiB and gives routes its path. |
-- |
Sets the secret’s description. |
-- |
Restarts the deployments that use the value, instead of waiting for their next start. |
-- |
Prints what would happen and changes nothing. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change 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> |
Identifies the secret as project/name. |
-- |
Identifies the integration whose own secret to reveal. |
-- |
Stores a reason for the reveal with the audit record. |
Who can run it: a grant whose role has reveal in an environment that allows 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> |
Identifies the secret as project/name. |
-- |
Identifies the integration whose own secret to delete. |
-- |
Prints what would happen and changes nothing. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change 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 codes match the exit code table in the CLI reference.
| Code | Meaning |
|---|---|
| 0 | The command succeeded. |
| 1 | The command stopped without making the change. |
| 2 | The command has a usage error. |
| 3 | Your key is missing, expired or revoked, or its access doesn’t cover the command. |
| 4 | What you named doesn’t exist. |
| 5 | The change conflicts with another change. |
| 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. |
| 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 limit of 10 reveals a minute and prints how many seconds to wait.