Skip to main content

Update

Write the value of a key.

The command reads the value from standard input with --value -, so the value is not in the shell history. A request then uses the key as secret://<vault>/<key>.

osapi client secret update [flags]

Examples​

# Read the value from standard input
osapi client secret update --vault default --key registry-token --value -

Result​

Read the value from standard input:

$ osapi client secret update --vault default --key registry-token --value -
Secret:

  trace 26e448c9dbe1c4a8d216a98c675079c9
  Vault:    default
  Key:      registry-token
  Version:  4
  Changed:  2026-01-15 10:00:00
  By:       ops@example.com

With --json, the API's response:

{
"vault": "default",
"key": "registry-token",
"version": 4,
"changed": "2026-01-15T10:00:00Z",
"by": "ops@example.com"
}

Permission​

It needs the secret:write permission. osapi controller role get --name <role> shows what a role grants.

Flags​

FlagDescriptionDefault
--keyThe name of the key, such as registry-token (required)
--valueThe value of the key, which no method gives back (a secret: secret://<vault>/<key>, or - to read it from standard input) (required)
--vaultThe name of the vault, such as default (required)

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file; without one at the default path, osapi runs on the defaults/etc/osapi/osapi.yaml
--urlBase URL the CLI client connects to (controller.client.url)https://localhost:8080

Output tells how the result is printed, and what --json gives.