Skip to content

jwt

TypeScriptv0.1.0MIT

A CLI tool for working with JSON Web Tokens. Decode any JWT to inspect its header and payload without needing the secret. Supports token validation and custom payload encoding. Uses base64url decoding for inspection and supports HMAC-SHA256 signing for encoding. Useful for debugging auth flows and testing API authentication.

SecurityAuthJWTCLI

Features

  • Decode any JWT without a secret to inspect header/payload
  • Encode new JWTs with HMAC-SHA256 signing
  • Full token inspection with header, payload, and signature info
  • Input from command line or file

Flags

LongShortDescription
--version-VShow version and license
--decode-dDecode a JWT token
--encode-eEncode a payload JSON into a JWT
--secret-sSecret key for signing/validation
--inspect-iShow header, payload, and signature info

Usage

terminal
$ jwt --decode 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
$
$ jwt --inspect token.jwt
$
$ jwt --encode payload.json --secret mysecret

Dependencies

Bun runtime — uses built-in Buffer and crypto modules

Install
$ curl -LO https://labs.stech-sol.com/downloads/jwt/0.1.0/jwt_linux_amd64
$ chmod +x jwt_linux_amd64
$ # Requires Bun runtime: bun run ./jwt_linux_amd64
About
Language
TypeScript
Versionv0.1.0
LicenseMIT
RepositoryGitHub