Skip to content
bsreeram08Public

About

A fast, lightweight CLI tool to decode and inspect JWT tokens. Built with Bun.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

jwt-cli

A fast, lightweight CLI tool to decode and inspect JWT tokens. Built with Bun.

Installation

Quick Install (Linux/macOS)

curl -fsSL https://raw.githubusercontent.com/bsreeram08/jwt-cli/master/install.sh | bash

Manual Installation

Download the appropriate binary for your platform from the releases page and place it in your PATH.

Platform Binary
macOS (Apple Silicon) jwt-darwin-arm64
macOS (Intel) jwt-darwin-x64
Linux (x64) jwt-linux-x64
Linux (ARM64) jwt-linux-arm64
Windows (x64) jwt-windows-x64.exe

Using Bun (Development)

git clone https://github.com/bsreeram08/jwt-cli.git
cd jwt-cli
bun link

Usage

# Decode a JWT token
jwt <token>

# Show help
jwt --help

# Show version
jwt --version

# Check for updates
jwt --update

Example

jwt eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Output:

━━━ Header ━━━
{
  "alg": "HS256",
  "typ": "JWT"
}

━━━ Payload ━━━
{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022
}

━━━ Timestamps ━━━
Issued At (iat): Thu, Jan 18, 2018 at 07:30:22 AM GMT+5:30 (7 years ago)

━━━ Status ━━━
✓ Token is valid (time-based)

━━━ Signature ━━━
Algorithm: HS256
Signature: SflKxwRJSMeKKF2QT4fwpMeJf36POk6y...
⚠ Signature verification requires the secret/key

Features

  • Decodes JWT header and payload with syntax highlighting
  • Converts timestamps (iat, exp, nbf) to human-readable format with relative time
  • Shows token validity status (expired, not yet valid)
  • Displays time remaining until expiration
  • Shows signature algorithm and truncated signature
  • Cross-platform support (macOS, Linux, Windows)
  • Zero dependencies - single binary

Building from Source

Requires Bun v1.0+

# Build for current platform
bun build jwt.ts --compile --outfile jwt

# Build for all platforms
./build.sh

License

MIT

About

A fast, lightweight CLI tool to decode and inspect JWT tokens. Built with Bun.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages