Skip to content

frankywahl/jwt-cli

Repository files navigation

JWT-CLI

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.

Getting Started

Using Homebrew

brew install frankywahl/tap/jwt

Using a Binary

  1. Go grab the latest binary from the Releases page for your platform / operating system.
  2. Extract the archive.
  3. Run ./jwt encode -d '{"hello":"world"}'

Using Docker

docker pull frankywahl/jwt
docker run frankywahl/jwt encode -d '{"hello":"world"}'

Usage examples

echo '{"Hello":"world"}' | jwt encode --secret secret # eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJIZWxsbyI6IndvcmxkIiwiZXhwIjoxNTUzNzI1NTIwfQ.ghG6wlutmLvifu29pGQRFJPe9-GkPvU3Rw3EDaeSzNU
echo 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJIZWxsbyI6IndvcmxkIiwiZXhwIjoxNTUzNzI1NTIwfQ.ghG6wlutmLvifu29pGQRFJPe9-GkPvU3Rw3EDaeSzNU' | jwt decode

Development

Prerequisites

  • golang (if installing from source)

Procedure

make install

Help

You can get help on the command line to see supported commands:

jwt --help

Then for a specific operation example

jwt encode --help

Code Status

Copyright

Copyright (c) 2020 Franky W.