Manage secrets from the command line | Pathfinder

A workflow for Workload Credentials on BeyondTrust Pathfinder

When two people or scripts update the same secret at the same time, one change can silently overwrite the other. A lost database password or API key can break services until someone notices. This workflow shows you how to manage secrets from the Workload Credentials command line interface (CLI) and make updates that can't overwrite someone else's change.

Scope of this guide

This guide covers downloading the CLI, logging in, and updating a static secret safely with check-and-set. Check-and-set means the update only goes through if the secret hasn't changed since you last read it. This guide does not cover dynamic secrets or integrations from the CLI.

Prerequisites

  • You have a Workload Credentials role assigned to your group in the BeyondTrust Pathfinder platform.
  • You have permission to read and update the secret you want to change.
  • At least one static secret exists, for example at the path /prod/db.
  • You have a terminal on Windows, macOS, or Linux.

Steps

Step 1: Download the CLI and log in

  1. In Pathfinder, select Menu > Workload Credentials.
  2. Select Resources > Download CLI.
  3. In the Download CLI Tool dialog box, select a Version and your Operating system and architecture.
  4. Select Download.
  5. In the header, open your user profile and create a personal access token for Workload Credentials. Copy the token.
  6. Open a terminal and go to the folder that contains the CLI file.
  7. Run the login command for your operating system, and enter your token when prompted:
    • macOS and Linux: ./wlc login
    • Windows: wlc.exe login

The CLI stores your token in a folder under $HOME and uses it for later requests. To remove the stored token, run wlc logout.

Step 2: Read and update a secret safely

The examples in this step use wlc. On macOS and Linux, use ./wlc. On Windows, use wlc.exe.

  1. Read the secret, and note its version number in the metadata:

    wlc static get /prod/db --format json
  2. Update the secret only if it's still at that version. Replace 5 with the version you noted:

    wlc static update /prod/db -e password=<new-value> --cas 5
  3. If the secret changed after you read it, the command fails with this message:

    check-and-set parameter did not match the current version

    Read the secret again to get the new version, check what changed, then repeat the update with the new version.

🚧

Important

If you leave out --cas, the update overwrites the secret even if someone else changed it. Always use --cas when other people or scripts might update the same secret. To work with a specific site, add --site-id <site-id> to the command.

When the check fails, the command exits with a non-zero code. Scripts can use this to detect the conflict, read the secret again, and retry.

Verify the results

Run wlc static get /prod/db --format json again. Confirm that the secret shows your new value and that its version number went up.

Next steps

Related resources


©2003-2026 BeyondTrust Corporation. All Rights Reserved. Other trademarks identified on this page are owned by their respective owners. BeyondTrust is not a chartered bank or trust company, or depository institution. It is not authorized to accept deposits or trust accounts and is not licensed or regulated by any state or federal banking authority.