jwt-cli
is a little command line utility for dealing with JWT
web tokens.
This utility allows you to quickly encode/decode tokens from the command line or as part of a bash script.
brew install frankywahl/tap/jwt
- Go grab the latest binary from the Releases page for your platform / operating system.
- Extract the archive.
- Run
./jwt encode -d '{"hello":"world"}'
docker pull frankywahl/jwt
docker run frankywahl/jwt encode -d '{"hello":"world"}'
echo '{"Hello":"world"}' | jwt encode --secret secret # eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJIZWxsbyI6IndvcmxkIiwiZXhwIjoxNTUzNzI1NTIwfQ.ghG6wlutmLvifu29pGQRFJPe9-GkPvU3Rw3EDaeSzNU
echo 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJIZWxsbyI6IndvcmxkIiwiZXhwIjoxNTUzNzI1NTIwfQ.ghG6wlutmLvifu29pGQRFJPe9-GkPvU3Rw3EDaeSzNU' | jwt decode
- golang (if installing from source)
make install
You can get help on the command line to see supported commands:
jwt --help
Then for a specific operation example
jwt encode --help
Copyright (c) 2020 Franky W.