Main commands
Single results support text and JSON output. Lists support table, CSV, JSON, YAML, and count output, and column selection with --fields.
Initial setup
Generates a signing key when the configured algorithm has none, enables the /auth endpoint, and prints the endpoint URL with a sample curl request. An existing key is kept unless --force or a different --algorithm is passed.
Full docs →$ wp jwt setup Generated a new HS256 signing key. curl -X POST 'https://example.com/?rest_route=/simple-jwt-login/v1/auth' -d 'username=<user>' -d 'password=<password>' Or, from here: wp jwt login --login=<user> Success: The /auth endpoint is enabled. $ # Switch to RS256 with a new RSA key pair $ wp jwt setup --algorithm=RS256
Use cases for teams
The REST API serves client applications. The CLI serves the people who operate the site: developers, DevOps, support, and security.
Local and preview environments
Provisioning scripts and Docker entrypoints can produce a site that issues JWTs, with the project settings applied, without anyone opening the admin.
wp plugin install simple-jwt-login --activate
wp jwt setup
wp jwt config import config/jwt.json --merge --yesCI tests without a stored password
The pipeline issues a 10-minute token for a test user and revokes it after the run. No WordPress password is kept in CI secrets.
TOKEN=$(wp jwt generate ci-bot --ttl=10)
curl -fsS -H "Authorization: Bearer $TOKEN" \
https://staging.example.com/wp-json/wp/v2/users/me
wp jwt revoke "$TOKEN"Configuration as code
Settings live in the repository and go through code review. The deploy step previews the diff, then applies it. Keep secrets out of the committed file.
wp jwt config export --file=config/jwt.json
# deploy step
wp jwt config import config/jwt.json --merge --dry-run
wp jwt config import config/jwt.json --merge --yesSecurity checks in CI
Fail the build when the configuration has critical findings, such as a short signing key or an endpoint without an auth code.
wp jwt security-report --min-severity=critical \
--format=json | jq -e '.findings | length == 0'Incident response
Revoke a user's sessions, invalidate a leaked signing key, and export failed requests from the audit log for the post-mortem.
wp jwt revoke-all [email protected] --yes
wp jwt key rotate --immediate --yes
wp jwt log analyze --hours=24
wp jwt log list --status=failure --format=csv > incident.csvPartner API keys
Create a read-only key with an expiration date for an integration, track its last use, and revoke it when the contract ends.
wp jwt api-key create integrations --name="Partner ACME" \
--permissions=read --expires-at="2027-06-30 23:59:59"
wp jwt api-key list --fields=id,name,last_used_at
wp jwt api-key revoke 7Enable the commands
Requirements
- Simple JWT Login4.3.0+
- WP-CLIany recent stable
- General > CLIenabled (default)
The commands are registered by the plugin from version 4.3.0. No other plugin is needed.
The Simple JWT Login CLI plugin is deprecated. While it is active, the built-in commands are not registered. Deactivate and delete it, then check that General > CLI is on.
$ wp jwt --help usage: wp jwt <command> [<args>]
Command reference
Every command and subcommand.
wp jwt setupGenerate a signing key if there is none and enable /authwp jwt loginAuthenticate a user with a password and print a JWTwp jwt generateIssue a JWT for a user without a passwordwp jwt refreshExchange a refresh token for a new JWTwp jwt decodePrint the claims of a JWT (signature not verified)wp jwt validateVerify signature, expiry, audience, user, and revocationwp jwt revokeRevoke a JWT and delete the user's refresh tokenswp jwt revoke-allRevoke every JWT and refresh token of a userwp jwt key generate | rotatePrint a new signing key, or replace the stored onewp jwt api-key create | list | revokeManage API keyswp jwt auth-code list | add | removeManage auth codeswp jwt config get | set | list | export | importRead and change the settingswp jwt doctorVersions, REST URLs, endpoint status, and configuration warningswp jwt security-reportSecurity score (0-100, grade A-F) and findingswp jwt explain-errorMeaning, HTTP status and related settings of an error codewp jwt log list | analyzeQuery and summarize the audit logwp jwt webhook list | test | logsList webhooks, send a test call, read the call logwp jwt cleanupRun the daily cleanup job immediatelyOptions, output formats, and error messages
The documentation lists every option, the add-on migration notes and a troubleshooting table.