Updating data (update)
Overview
update modifies Passwork record values (password, name, custom fields) according to the provided parameters.
Use cases
- Updating individual fields — change password, name, login, URL, description, tags, or custom fields separately
- Clearing field values — set fields to empty by passing an empty string
- Bulk updates — change multiple fields with a single command
- Updating custom fields — add/change custom fields for items and shortcuts
Item identification
| Parameter | Description |
|---|---|
--password-id | Item ID (item) |
--shortcut-id | Shortcut ID (shortcut) |
Update parameters
| Parameter | Description |
|---|---|
--name | New item name. Empty value will return an error |
--password | New password value |
--login | New login value |
--url | New URL address |
--description | New note value |
--tags | Comma-separated list of tags. Empty string clears tags |
--custom-{name} | Set a custom field by name, e.g., --custom-API_KEY "..." |
Syntax
- shell
passwork-cli update --password-id <id> [field-changes]
Basic usage
Specify either --password-id or --shortcut-id to identify the object to update.
- shell
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:
- shell
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.
- shell
# 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.
- shell
# 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.
- shell
# 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.
- shell
# 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
- CLI connects to the Passwork server using the provided credentials
- Retrieves an item or shortcut by ID
- Decrypts data using the master key (if client-side encryption is used)
- Applies new values to the specified fields
- Empty strings (
"") clear the corresponding fields - Custom fields are changed via the
--custom-*syntax - Tags are accepted as a comma-separated list and replace existing ones
- The updated object is saved to Passwork