Every command you need
From token generation to full config management — the CLI covers the complete JWT lifecycle.
Authenticate & get a token
Authenticate any WordPress user by username, email, or a combined login flag and receive a signed JWT immediately. Pipe it directly into curl, store it in a variable, or forward it to other tools.
Full docs →# Authenticate by username $ wp jwt login --username=admin --password=secret eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... $ # JSON output — parse with jq $ wp jwt login --username=admin --password=secret --format=json {"jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."} $ # Capture and use immediately with curl $ TOKEN=$(wp jwt login --username=admin --password=secret) $ curl -H "Authorization: Bearer $TOKEN" https://example.com/wp-json/wp/v2/posts
Built for real workflows
The CLI is designed for the scenarios where speed and scriptability matter most.
CI / CD pipelines
Generate a short-lived JWT inside your pipeline to seed test data, run authenticated smoke tests, or hit protected API endpoints — no browser, no cookies.
TOKEN=$(wp jwt login --username=admin --password="$WP_ADMIN_PASSWORD")
curl -s -X POST https://my-site.com/wp-json/wp/v2/posts \
-H "Authorization: Bearer $TOKEN" \
-d '{"title":"Smoke test post","status":"publish"}'Staging → production migrations
Export the full plugin config from staging with one command, preview the diff on production in dry-run mode, then apply — fully non-interactive.
# Export from staging
wp jwt config export --file=jwt-staging.json
# Preview changes (dry-run)
wp jwt config import jwt-staging.json --dry-run --url=https://example.com
# Apply without prompts
wp jwt config import jwt-staging.json --yes --url=https://example.comAutomated health checks
Add a cron job or monitoring script that logs in, validates the token, and alerts your team when JWT authentication breaks.
TOKEN=$(wp jwt login --username=healthcheck --password="$HC_PASSWORD")
STATUS=$(wp jwt validate "$TOKEN" --format=json | jq -r '.valid')
[ "$STATUS" = "true" ] && echo "JWT OK" || { echo "JWT FAILED"; exit 1; }Get started in 60 seconds
Requirements
- WordPress4.4+
- PHP5.5+
- Simple JWT Loginactive
- WP-CLIany recent stable
Go to Plugins → Add New, search for Simple JWT Login CLI, and click Install Now.
The add-on registers its commands automatically once activated. Simple JWT Login must be active on the same site.
$ wp jwt --help usage: wp jwt <command> [<args>]
Complete command reference
All 8 commands at a glance.
wp jwt loginAuthenticate a user and return a JWT tokenwp jwt decodeDecode a JWT payload (signature not verified)wp jwt validateVerify signature and expiry of a tokenwp jwt revokePermanently revoke a tokenwp jwt config getRead a single plugin settingwp jwt config setUpdate a plugin settingwp jwt config listList all settings as key/value pairswp jwt config exportExport full config as JSON to stdout or filewp jwt config importImport config from a JSON fileReady to automate your JWT workflow?
Install the add-on in minutes and bring the full power of Simple JWT Login to your terminal.