Fork of https://github.com/mike-engel/jwt-cli
Output json when not in a TTY
a4c3ccc6 — dependabot-preview[bot] 1 year, 1 month ago
chore(deps): bump serde from 1.0.116 to 1.0.117 (#98)
629b40e5 — dependabot-preview[bot] 1 year, 1 month ago
chore(deps): bump serde_json from 1.0.58 to 1.0.59 (#97)


browse  log 



You can also use your local clone with git send-email.


Dependabot Status

A super fast CLI tool to decode and encode JWTs built in Rust.

Build Status Build status GitHub release

jwt-cli is a command line tool to help you work with JSON Web Tokens (JWTs). Like most JWT command line tools out there, you can decode almost any JWT header and claims body. Unlike any that I've found, however, jwt-cli allows you to encode a new JWT with nearly any piece of data you can think of. Custom header values (some), custom claim bodies (as long as it's JSON, it's game), and using any secret you need.

On top of all that, it's written in Rust so it's fast and extremely portable (windows, macOS, and linux supported right now).


Currently, installation is supported via Homebrew (macOS), Cargo (cross-platform), and FreshPorts (FreeBSD). If you intend to use one of these methods, skip ahead.

You may also install the binary from the release page, if you're unable to use Homebrew or Cargo install methods below.

Only 64bit linux, macOS, and Windows targets are pre-built. Sorry if you're not on one of those! You'll need to build it from the source. See the contributing section on how to install and build the project.

As to where you should install it, it should optimally go somewhere in your PATH. For Linux and macOS, a good place is generally /usr/local/bin. For Windows, there really isn't a good place by default :(.


For those with Homebrew, you'll need to brew tap mike-engel/jwt-cli repo in order to install it.

# Tap and install jwt-cli
brew tap mike-engel/jwt-cli
brew install jwt-cli

# Ensure it worked ok by running the help command
jwt help


If your system supports it, you can install via Cargo. Make sure you have Rust and Cargo installed, following these instructions before proceeding.

cargo install jwt-cli

The binary will be installed in your Cargo bin path (~/.cargo/bin). Make sure this path is included in your PATH environment variable.


If you're on FreeBSD, you can use the pkg tool to install jwt-cli on your system.

pkg install jwt-cli

Big thanks to Sergey Osokin, the FreeBSD contributor who added jwt-cli to the FreeBSD ports tree!


jwt-cli is also avaible on Windows, MacOSX and Linux using GoFish. See gofi.sh for instructions for getting GoFish.

After installing GoFish, getting jwt-cli is just running:

gofish install jwt-cli


For usage info, use the help command.

# top level help
jwt help

# command specific help
jwt help encode


I welcome all issues and pull requests! This is my first project in rust, so this project almost certainly could be better written. All I ask is that you follow the code of conduct and use rustfmt to have a consistent project code style.

To get started you'll need rustc and cargo on your system. If they aren't already installed, I recommend rustup to get both!

#Running and building the project

Once you have both installed you'll want to install the dependencies.

# install dependencies via cargo
cargo update

After that, I recommend running the tests and doing a debug build to make sure all is well from the start.

# run the tests
cargo test

# run a debug build
cargo build

# or, if you want, a release build
cargo build --release

If it built successfully, you should be able to run the command via cargo.

cargo run -- help

#Code of conduct



#Contributors ✨

Thanks goes to these wonderful people (emoji key):

Mike EngelMike Engel💻 💬 📖 🤔 🚧 👀 ⚠️ 🐛 Kyle BurtonKyle Burton💻 Aaron SchaefAaron Schaef💻 hughsimpsonhughsimpson💻 ⚠️ Mat KellyMat Kelly💻 🐛 JasonJason🐛 Ben BerryBen Berry🐛
Kevin LanniKevin Lanni📖 Kosta KrauthKosta Krauth💻 ⚠️ 📖

This project follows the all-contributors specification. Contributions of any kind welcome!