Workload Secrets Vault CLI

This feature is currently available only to customers participating in a Private Preview. If you'd like to participate and be among the first to try this feature, ask our support or account team for details.

You work with Workload Secrets Vault from the command line through the Delinea CLI, delinea. The Workload Secrets Vault commands are under delinea workload. The CLI gets its list of commands from your tenant, so new commands become available without updating the CLI.

Installing the CLI

The standalone CLI is available for macOS and for 64-bit x86 Linux. On Linux, it needs glibc 2.39 or later, which is included in Ubuntu 24.04 and later. On Windows, the CLI that comes with the Delinea desktop app supports interactive sign-in only, not service-user sign-in.

To run the CLI in an Ubuntu 24.04 container, also install the libssl3t64 and ca-certificates packages in the container, for example with apt-get install -y libssl3t64 ca-certificates.

During the preview, ask your Delinea account team for the CLI package. To check the installed version, run delinea --version.

Starting the CLI

The CLI runs a background process that holds your sign-in and fetches the command list from your tenant. Start it before you sign in or run commands:

Copy
delinea start
delinea status

delinea status shows whether the background process is running and who you're signed in as. To stop it, run delinea stop. Until the background process is running, delinea workload commands and their help aren't available.

The workload commands are also available only when Workload Secrets Vault is enabled for your tenant. If delinea workload --help fails while the background process is running, ask your Delinea account team to check that Workload Secrets Vault is enabled for the tenant.

Signing In as a User

Copy
delinea login --tenant <your-tenant>.delinea.app

The CLI opens your browser to the tenant's sign-in page. Sign in as you normally do, including any MFA. When you're done, the CLI shows your name and email address.

  • Your sign-in is saved in the operating system's keychain, so it survives a restart of the CLI. Add --no-save to keep it in memory only. If the computer has no usable keychain, the CLI tells you that you'll need to sign in again after a restart.

  • If you leave out --tenant, the CLI uses the last tenant you signed in to and asks you to confirm it.

  • To sign out, run delinea logout.

Signing In as a Service User

Pipelines and scripts sign in as a Delinea Platform service user with its username as the client ID and its password as the client secret. For how to create a service user, see Service Users.

Signing in as a service user needs a recent version of the CLI. Older versions can't sign in as a service user. If yours is one of them, ask your Delinea account team for a newer package.

Pass the secret on standard input or in a file so that it doesn't appear in your shell history or the process list:

Copy
delinea start
echo "$CLIENT_SECRET" | delinea login --tenant "$TENANT" --client-id "$CLIENT_ID" --client-secret-file -
delinea status

A service-user sign-in is never saved. If the CLI's background process restarts, sign in again.

Signing In with Environment Variables

In containers and CI jobs, you can set environment variables instead of running delinea login. delinea start then signs in automatically, and fails if the credentials are rejected.

Variable Value
DELINEA_CLI_TENANT Your tenant host, such as example.delinea.app
DELINEA_CLI_CLIENT_ID The service user's username
DELINEA_CLI_CLIENT_SECRET_FILE or DELINEA_CLI_CLIENT_SECRET The path of a file that holds the password, or the password itself. Set only one of them. Prefer the file, for example a mounted secret in Docker or Kubernetes.

While DELINEA_CLI_CLIENT_ID is set, delinea login and delinea logout are disabled.

Running Commands

Commands follow the pattern delinea workload <group> [<subgroup>] <verb> [<arguments>] [--flags]. Positional arguments come before flags. To see the available commands and their arguments, use --help at any level:

Copy
delinea workload --help
delinea workload secret --help
delinea workload secret get --help

Request Fields

Commands that create or change something take each field of the request as its own flag. Each flag is named after its field, in lowercase with hyphens between the words: for example, the ttlHours field is --ttl-hours. To see a command's flags, which of them are required, and the values they accept, run the command with --help.

  • Give the value after the flag, as in --ttl-hours 24, or join the two with =, as in --ttl-hours=24. If a value might start with --, for example text that you read from a file or a variable, use the = form, such as --plaintext="$value". Otherwise, the CLI reads the value as another flag.

  • A field that holds a list or an object takes JSON, for example --versions '[1,2]' or --data '{"username":"demo"}'. In scripts, build the JSON with jq -n --arg so that values with quotes, backslashes, or line breaks are escaped correctly. Other values are sent exactly as you give them, so they don't need escaping.

  • A true-or-false flag, such as --chain, is true when you give it without a value. You can also give it true or false.

  • A flag that you leave out isn't sent, and the service uses its default.

  • Flag values are visible in your shell history and to other processes on the computer, and the CLI can't read a value from a file or from standard input. Don't type secret values on the command line on a shared computer.

Flags for request fields need a recent version of the CLI. With an older version, commands that create or change something fail. If that happens, ask your Delinea account team for a newer package.

Output

By default, the CLI prints readable output. Add --json to print the service's JSON response instead. Use --json in scripts, and parse the output with a tool such as jq:

Copy
delinea --json workload secret get payments/prod/orders-db | jq -r '.data.data.password'
  • Readable output shortens table cells to 40 characters and shows at most 8 items of a list, so it isn't suitable for scripts. For example, secret list without --json shows at most 8 names.

  • Both output formats print secret values in clear text. Don't run secret get where others can see your screen or where the output is logged.

  • With --json, errors are printed as {"ok": false, "error": {"category": "...", "message": "..."}}, and a readable message goes to standard error.

Exit Codes

Code Meaning
0 Success
1 An error that has no more specific code
2 Usage error, such as an unknown flag or an invalid argument
3 The CLI's background process isn't running. Run delinea start.
4 Not signed in
7 Sign-in failed
8 Permission denied (HTTP 403)
9 Not found (HTTP 404 or 410)
10 The service couldn't be reached, or the request timed out

Command Reference

All commands start with delinea workload. Flags in square brackets are optional, and a <json> value is a JSON array or object. The topic for each area describes the fields by their names in the API, such as ttlHours for --ttl-hours. See Request Fields.

Secrets

See Managing Secrets and Dynamic Secrets.

Command Description
secret create <path> --data <json> Creates a static secret, or writes a new version of an existing one.
secret base create <path> --type <type> --credential <json> [--site-id <id>] Creates a base secret, or writes a new version of one. A base secret holds the target and the credential that dynamic secrets mint against. The CLI has no flags for the target-specific fields, such as a database's connection, so write base secrets through the API.
secret dynamic create <path> --type <type> --base-secret-path <path> [--ttl-seconds <n>] Creates a dynamic secret, or writes a new version of one. The CLI has no flags for the target-specific fields, such as access, so write dynamic secrets through the API.
secret get <path> [--version <n>] Reads the current or a specific version. A dynamic secret has no stored values, so the service refuses to read one with 409 (secret_mint_required). To get a credential from it, use secret mint. See Minting a Credential.
secret mint <path> Creates a new short-lived credential from the current version of a dynamic secret, and a lease that controls when the credential expires. Each call creates another credential, so don't retry it automatically.
secret describe <path> [--version <n>] Shows a secret's kind and version information without its data. Never creates a credential.
secret list <path> Lists the names one level below a path.
secret delete <path> [--version <n>] Soft-deletes the current version, or a specific version.
secret version delete <path> --versions <json> Soft-deletes the listed versions.
secret restore <path> --versions <json> Restores the listed deleted versions.
secret rollback <path> --version <n> Copies an earlier version into a new current version.
secret destroy <path> --versions <json> Permanently erases the data of the listed versions.
secret metadata delete <path> Permanently removes a secret and all its versions.

Leases

See Leases and Revocation.

Command Description
lease list --dynamic-secret-path <path> [--status <status>] [--limit <n>] [--offset <n>] Lists the leases minted from one dynamic secret, newest first. --dynamic-secret-path is the exact path of the dynamic secret. --status is pending, active, or revoked. --limit is 1 to 100, 50 by default, and --offset is the number of leases to skip.
lease get <id> Looks up one lease.
lease revoke <id> [--sync] Revokes an active lease before it expires. The revoke is queued; add --sync to wait for it to finish. A lease that's still pending can't be revoked, because its mint might still be running.

Policies

See Workload Secrets Vault Policies.

Command Description
policy list Lists all policies.
policy get <id> Reads a policy.
policy create --name <name> --status <status> --effect <effect> --actions <json> --subjects <json> --targets <json> [--description <text>] [--conditions <json>] Creates a policy.
policy update <id> with the same flags as policy create Replaces a policy with the fields you pass. A field you leave out goes back to its default.
policy delete <id> Deletes a policy.

Encryption with Service-Managed Keys

See Encryption as a Service.

Command Description
crypto auto key create <path> Creates a key.
crypto auto key get <path> Shows a key's versions and status, never the key material.
crypto auto key delete <path> Soft-deletes a key.
crypto auto restore <path> Restores a deleted key within 30 days.
crypto auto encrypt --path <path> --plaintext <text> Encrypts plaintext with a key.
crypto auto decrypt --path <path> --ciphertext <text> Decrypts ciphertext with a key.
crypto auto rotate <path> [--starting-version <n>] Adds a new key version and makes it current.
crypto auto rewrap <path> --ciphertext <text> Re-encrypts ciphertext with the current key version.

Encryption with Your Own Keys

See Bring Your Own Key.

Command Description
crypto manual wrapping-key get Gets the tenant's public wrapping key for importing keys.
crypto manual key create <path> --wrapping-key-id <id> --wrapped-key <key> Imports a wrapped key.
crypto manual key get <path> Shows a key's versions and status.
crypto manual key rotate <path> --wrapping-key-id <id> --wrapped-key <key> Imports a new wrapped key as the next version.
crypto manual key update <path> --wrapping-key-id <id> --wrapped-key <key> Replaces a key's material with a new wrapped key, which becomes the next version.
crypto manual key delete <path> Soft-deletes a key.
crypto manual restore <path> Restores a deleted key within 30 days.
crypto manual encrypt --path <path> --plaintext <text> Encrypts plaintext with a key.
crypto manual decrypt --path <path> --ciphertext <text> Decrypts ciphertext with a key.
crypto manual rewrap <path> --ciphertext <text> Re-encrypts ciphertext with the newest key version.

Secret Share

See Sharing Secrets with Secret Share.

Command Description
crypto share create --plaintext <text> [--passphrase <text>] [--ttl-seconds <n>] [--max-views <n>] Creates a share and returns its token, share ID, and expiry time.
crypto share get --token <token> Shows a share's status without using a view.
crypto share unwrap --token <token> [--passphrase <text>] Redeems a share and returns its value.
crypto share delete <share-id> Revokes a share you created.

Managed Certificate Authorities

See Managed Certificate Authorities.

Command Description
pki ca create --name <name> --common-name <name> --domains <json> --max-ttl-hours <n> [--subject <json>] Creates a managed root CA.
pki ca list Lists the managed CAs in the tenant.
pki ca get <name> Shows a CA.
pki ca root-certificate get <name> Gets the CA certificate, never the private key.
pki ca crl get <name> Gets the CA's current certificate revocation list.
pki ca delete <name> Deletes a CA that has no certificate records or templates.
pki ca certificate create <ca-name> --common-name <name> [--subject-alternative-names <json>] [--ttl-hours <n>] Issues a certificate directly from a CA.
pki ca certificate list <ca-name> Lists the certificate records of a CA.
pki template create --name <name> --ca-name <name> --allowed-domains <json> --max-ttl-hours <n> Creates a template for a CA.
pki template list Lists the templates in the tenant.
pki template get <name> Shows a template.
pki template update <name> --allowed-domains <json> --max-ttl-hours <n> Changes a template's allowed domains and maximum lifetime.
pki template delete <name> Deletes a template.
pki template certificate create <name> --common-name <name> [--subject-alternative-names <json>] [--ttl-hours <n>] Issues a certificate through a template.
pki certificate get <id> Shows a certificate record, never the private key.
pki certificate revoke <id> [--reason <n>] Revokes a certificate. This can't be undone.
pki certificate validate <id> Checks that a certificate chains to its CA and isn't expired or revoked.
pki certificate delete <id> Deletes a certificate record without revoking the certificate.

Your Own CA

See Signing with Your Own CA.

Command Description
pki ca register --root-ca-path <path> --certificate <base64> --private-key <base64> --domains <json> --max-ttl-hours <n> [--crl <url>] Registers an existing root CA from its certificate and private key.
pki ca generate --root-ca-path <path> --common-name <name> --domains <json> --max-ttl-hours <n> [--crl <url>] [--subject <json>] Generates a new self-signed root CA.
pki sign --root-ca-path <path> --csr <base64> [--subject-alternative-names <json>] [--ttl-hours <n>] [--chain] Signs a certificate signing request. Nothing is stored.
pki leaf create --root-ca-path <path> --common-name <name> [--store-path <path>] [--ttl-hours <n>] [--subject <json>] [--chain] Generates a key pair and a certificate signed by the CA.
pki ssh-cert create --root-ca-path <path> --leaf-ca-path <path> --principals <json> --ttl-hours <n> Issues an SSH user certificate for a stored key pair.