Skip to main content
Version: 7.0

Updating data (update)

Overview

update modifies Passwork record values (password, name, custom fields) according to the provided parameters.

Use cases

  1. Updating individual fields — change password, name, login, URL, description, tags, or custom fields separately
  2. Clearing field values — set fields to empty by passing an empty string
  3. Bulk updates — change multiple fields with a single command
  4. Updating custom fields — add/change custom fields for items and shortcuts

Item identification

ParameterDescription
--password-idItem ID (item)
--shortcut-idShortcut ID (shortcut)

Update parameters

ParameterDescription
--nameNew item name. Empty value will return an error
--passwordNew password value
--loginNew login value
--urlNew URL address
--descriptionNew note value
--tagsComma-separated list of tags. Empty string clears tags
--custom-{name}Set a custom field by name, e.g., --custom-API_KEY "..."

Syntax

passwork-cli update --password-id <id> [field-changes]

Basic usage

Specify either --password-id or --shortcut-id to identify the object to update.

passwork-cli update \
--host "https://passwork.example.com" \
--token "your_access_token" \
--master-key "your_master_key" \
--password-id "68793e13dfc88d879e0f2e39" \
--password "new-password-value"

Using environment variables

You can export Passwork data as environment variables:

export PASSWORK_HOST="https://passwork.example.com"
export PASSWORK_TOKEN="your_access_token"
export PASSWORK_MASTER_KEY="your_master_key"

# Then update without specifying credentials
passwork-cli update \
--password-id "68793e13dfc88d879e0f2e39" \
--password "new-password"

This is useful for automation scripts and CI/CD pipelines, where credentials can be securely stored as environment variables.

Updating standard fields

Standard fields: name, password, login, URL, description, and tags.

# Update password
passwork-cli update --password-id "68793e13dfc88d879e0f2e39" --password "new-password"

# Update login
passwork-cli update --password-id "68793e13dfc88d879e0f2e39" --login "new-login"

# Update name
passwork-cli update --password-id "68793e13dfc88d879e0f2e39" --name "New Item Name"

# Update URL
passwork-cli update --password-id "68793e13dfc88d879e0f2e39" --url "https://example.com"

# Update description
passwork-cli update --password-id "68793e13dfc88d879e0f2e39" --description "Updated description"

# Update tags (comma-separated)
passwork-cli update --password-id "68793e13dfc88d879e0f2e39" --tags "tag1,tag2,tag3"

# Clear field (set to empty)
passwork-cli update --password-id "68793e13dfc88d879e0f2e39" --description ""

Updating custom fields

Updated using the --custom-* syntax, where * is the custom field name.

# Update custom field API_KEY
passwork-cli update \
--password-id "68793e13dfc88d879e0f2e39" \
--custom-API_KEY "new-api-key-value"

# Clear custom field
passwork-cli update \
--password-id "68793e13dfc88d879e0f2e39" \
--custom-API_KEY ""

Bulk updates

Update multiple fields with a single command.

# Update login and password together
passwork-cli update \
--password-id "68793e13dfc88d879e0f2e39" \
--login "new-login" \
--password "new-password"

# Update multiple fields including custom field
passwork-cli update \
--password-id "68793e13dfc88d879e0f2e39" \
--password "new-password" \
--description "Updated description" \
--tags "production,database,api" \
--custom-API_KEY "new-api-key-value"

# Full update with all fields
passwork-cli update \
--password-id "68793e13dfc88d879e0f2e39" \
--name "UpdateName" \
--login "UpdateLogin" \
--password "UpdatePassword" \
--description "UpdateDescription" \
--tags "update,all,tags" \
--url "https://update.url" \
--custom-API_KEY "update_api_key"

Working with shortcuts

Similar parameters work for shortcuts via --shortcut-id.

# Update shortcut fields
passwork-cli update \
--shortcut-id "68d6c94bec3a3fe41209546e" \
--password "shortcut-password" \
--login "shortcut-login"

# Update shortcut with multiple fields
passwork-cli update \
--shortcut-id "68d6c94bec3a3fe41209546e" \
--name "Update name" \
--description "Updated shortcut" \
--tags "shortcut,updated" \
--custom-API_KEY "shortcut-api-key"

How it works

  1. CLI connects to the Passwork server using the provided credentials
  2. Retrieves an item or shortcut by ID
  3. Decrypts data using the master key (if client-side encryption is used)
  4. Applies new values to the specified fields
  5. Empty strings ("") clear the corresponding fields
  6. Custom fields are changed via the --custom-* syntax
  7. Tags are accepted as a comma-separated list and replace existing ones
  8. The updated object is saved to Passwork