Examples
# List user application passwords and only show app name and password hash
$ wp user application-password list 123 --fields=name,password
+--------+------------------------------------+
| name | password |
+--------+------------------------------------+
| myapp | $P$BVGeou1CUot114YohIemgpwxQCzb8O/ |
+--------+------------------------------------+
# Get a specific application password and only show app name and created timestamp
$ wp user application-password get 123 6633824d-c1d7-4f79-9dd5-4586f734d69e --fields=name,created
+--------+------------+
| name | created |
+--------+------------+
| myapp | 1638395611 |
+--------+------------+
# Create user application password
$ wp user application-password create 123 myapp
Success: Created application password.
Password: ZG1bxdxdzjTwhsY8vK8l1C65
# Only print the password without any chrome
$ wp user application-password create 123 myapp --porcelain
ZG1bxdxdzjTwhsY8vK8l1C65
# Update an existing application password
$ wp user application-password update 123 6633824d-c1d7-4f79-9dd5-4586f734d69e --name=newappname
Success: Updated application password.
# Delete an existing application password
$ wp user application-password delete 123 6633824d-c1d7-4f79-9dd5-4586f734d69e
Success: Deleted 1 of 1 application password.
# Check if an application password for a given application exists
$ wp user application-password exists 123 myapp
$ echo $?
1
# Bash script for checking whether an application password exists and creating one if not
if ! wp user application-password exists 123 myapp; then
PASSWORD=$(wp user application-password create 123 myapp --porcelain)
fi
Subcommands
Name | Description |
---|---|
wp user application-password create | Creates a new application password. |
wp user application-password delete | Delete an existing application password. |
wp user application-password exists | Checks whether an application password for a given application exists. |
wp user application-password get | Gets a specific application password. |
wp user application-password list | Lists all application passwords associated with a user. |
wp user application-password record-usage | Record usage of an application password. |
wp user application-password update | Updates an existing application password. |