{"id":17645561,"url":"https://github.com/sgaunet/jwt-cli","last_synced_at":"2025-12-28T02:28:19.870Z","repository":{"id":191262986,"uuid":"655392777","full_name":"sgaunet/jwt-cli","owner":"sgaunet","description":"jwt-cli is a tool to encode/decode JWT token","archived":false,"fork":false,"pushed_at":"2025-03-30T09:51:03.000Z","size":290,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T05:07:29.924Z","etag":null,"topics":["cli","command-line-tool","golang","json-web-token","jsonwebtoken","jwt","jwt-cli","jwt-token","jwt-tokens"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sgaunet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-18T18:53:33.000Z","updated_at":"2025-03-30T09:51:04.000Z","dependencies_parsed_at":"2023-08-29T04:36:10.694Z","dependency_job_id":"12211650-d838-4f76-bc52-340f6cb8bf09","html_url":"https://github.com/sgaunet/jwt-cli","commit_stats":null,"previous_names":["sgaunet/jwt-cli"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/sgaunet/jwt-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fjwt-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fjwt-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fjwt-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fjwt-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgaunet","download_url":"https://codeload.github.com/sgaunet/jwt-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fjwt-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268625011,"owners_count":24280187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line-tool","golang","json-web-token","jsonwebtoken","jwt","jwt-cli","jwt-token","jwt-tokens"],"created_at":"2024-10-23T10:57:16.490Z","updated_at":"2025-12-28T02:28:19.861Z","avatar_url":"https://github.com/sgaunet.png","language":"Go","readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/sgaunet/jwt-cli)](https://goreportcard.com/report/github.com/sgaunet/jwt-cli)\n[![GitHub release](https://img.shields.io/github/release/sgaunet/jwt-cli.svg)](https://github.com/sgaunet/jwt-cli/releases/latest)\n![GitHub Downloads](https://img.shields.io/github/downloads/sgaunet/jwt-cli/total)\n![Coverage](https://raw.githubusercontent.com/wiki/sgaunet/jwt-cli/coverage-badge.svg)\n[![Linter](https://github.com/sgaunet/jwt-cli/actions/workflows/linter.yml/badge.svg)](https://github.com/sgaunet/jwt-cli/actions/workflows/linter.yml)\n[![Coverage](https://github.com/sgaunet/jwt-cli/actions/workflows/coverage.yml/badge.svg)](https://github.com/sgaunet/jwt-cli/actions/workflows/coverage.yml)\n[![Release](https://github.com/sgaunet/jwt-cli/actions/workflows/release.yml/badge.svg)](https://github.com/sgaunet/jwt-cli/actions/workflows/release.yml)\n[![GoDoc](https://godoc.org/github.com/sgaunet/jwt-cli?status.svg)](https://godoc.org/github.com/sgaunet/jwt-cli)\n[![License](https://img.shields.io/github/license/sgaunet/jwt-cli.svg)](LICENSE)\n\n# jwt-cli\n\njwt-cli is a utility to encode/decode JWT token.\n\n```\nTool to encode/decode JWT token\n\nUsage:\n  jwt-cli [command]\n\nAvailable Commands:\n  decode      decode JWT token\n  encode      encode JWT token\n  genkeys     print commands example to generate keys for ES256, ES384, ES512, RS256, RS384, RS512\n  help        Help about any command\n  version     print version of jwt-cli\n\nFlags:\n  -h, --help   help for jwt-cli\n\nUse \"jwt-cli [command] --help\" for more information about a command.\n```\n\nSupported methods are actually:\n\n* HS256\n* HS384\n* HS512\n* ES256\n* ES384\n* ES512\n* RS256\n* RS384\n* RS512\n\n# Demo\n\n![demo](doc/demo.gif)\n\n# Install\n\n## Option 1\n\n* Download the release\n* Install the binary in /usr/local/bin \n\n## Option 2: With brew\n\n```\nbrew tap sgaunet/homebrew-tools\nbrew install sgaunet/tools/jwt-cli\n```\n\n## Option 3: Docker image\n\nPossibility to copy the binary by using the docker image\n\n```\nFROM sgaunet/jwt-cli:latest as jwtcli\n\nFROM ....\nCOPY --from jwtcli /jwt-cli /usr/bin/jwt-cli\n```\n\n# Getting started\n\nQuite easy, this tool will help you to encode/decode JWT tokens.\n\n```\n# encode\n$ jwt-cli encode hs512 --payload '{ \"email\": \"myemail@me.com\" }' --secret \"myAwesomeSecret\"\neyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Im15ZW1haWxAbWUuY29tIn0.SE0u1AWrDTHv67PnUALZl8VQ-7rnSXBNDTCVT_Dj12FStO6hL0ak0i4imcUHpWBEh-c5oSc-H90prGQ0oZx6ng\n# try to decode with a wrong secret\n$ jwt-cli decode hs512 --secret \"wrong secret\" --token \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Im15ZW1haWxAbWUuY29tIn0.SE0u1AWrDTHv67PnUALZl8VQ-7rnSXBNDTCVT_Dj12FStO6hL0ak0i4imcUHpWBEh-c5oSc-H90prGQ0oZx6ng\"\nsignature is invalid\n# decode with the good secret\n$ jwt-cli decode hs512 --secret \"myAwesomeSecret\" --token \"eyJhbGciOiJIUzUxMiIsInR\n5cCI6IkpXVCJ9.eyJlbWFpbCI6Im15ZW1haWxAbWUuY29tIn0.SE0u1AWrDTHv67PnUALZl8VQ-7rnSXBNDTCVT_Dj12FStO6hL0ak0i4imcUHpWBEh-c5oSc-H90prGQ0oZx6ng\"\n{\n  \"email\": \"myemail@me.com\"\n}\n```\n\n# Shell Completion\n\njwt-cli supports shell completion for bash, zsh, fish, and PowerShell. This enables TAB completion for commands, subcommands, and flags.\n\n## Installation\n\n### Bash\n\n**On macOS (using Homebrew):**\n```bash\njwt-cli completion bash \u003e $(brew --prefix)/etc/bash_completion.d/jwt-cli\nsource ~/.bashrc\n```\n\n**On Linux:**\n```bash\nsudo jwt-cli completion bash \u003e /etc/bash_completion.d/jwt-cli\nsource ~/.bashrc\n```\n\n### Zsh\n\n```bash\n# Create completions directory if it doesn't exist\nmkdir -p ~/.zsh/completions\n\n# Generate completion file\njwt-cli completion zsh \u003e ~/.zsh/completions/_jwt-cli\n\n# Add to .zshrc if not already present:\n# fpath=(~/.zsh/completions $fpath)\n# autoload -Uz compinit \u0026\u0026 compinit\n```\n\n### Fish\n\n```bash\njwt-cli completion fish \u003e ~/.config/fish/completions/jwt-cli.fish\n```\n\n### PowerShell\n\n```powershell\n# For current session\njwt-cli completion powershell | Out-String | Invoke-Expression\n\n# For persistent installation, add to your PowerShell profile:\njwt-cli completion powershell \u003e\u003e $PROFILE\n```\n\n## Usage Examples\n\nAfter installation and restarting your shell:\n\n```bash\njwt-cli \u003cTAB\u003e              # Shows: encode, decode, genkeys, version, help\njwt-cli encode \u003cTAB\u003e       # Shows: hs256, hs384, hs512, rs256, rs384, rs512, es256, es384, es512\njwt-cli encode hs256 -\u003cTAB\u003e # Shows available flags\njwt-cli decode rs256 --private-key \u003cTAB\u003e  # Shows .pem and .key files\n```\n\n## Troubleshooting\n\nIf completion doesn't work:\n1. Verify jwt-cli is in your PATH: `which jwt-cli`\n2. Restart your shell or open a new terminal window\n3. For Zsh, ensure fpath includes your completions directory\n4. Check that completion files are in the correct location\n\nFor more information: `jwt-cli completion --help`\n\n# Development\n\nThis project is using :\n\n* golang 1.23+\n* [task for development](https://taskfile.dev/#/)\n* docker\n* [docker buildx](https://github.com/docker/buildx)\n* docker manifest\n* [goreleaser](https://goreleaser.com/)\n\nThe docker image is only created to simplify the copy of jwt-cli in another docker image.\n\n\n# Create keys\n\n## RS256\n\n```\nssh-keygen -t rsa -b 4096 -E SHA256 -m PEM -P \"\" -f RS256-private.pem\nopenssl rsa -in RS256-private.pem -pubout -outform PEM -out RS256-public.pem\n```\n\n## RS384\n\n```\nssh-keygen -t rsa -b 4096 -E SHA384 -m PEM -P \"\" -f RS384-private.pem\nopenssl rsa -in RS384-private.pem -pubout -outform PEM -out RS384-public.pem\n```\n\n## RS512\n\n```\nssh-keygen -t rsa -b 4096 -E SHA512 -m PEM -P \"\" -f RS512-private.pem\nopenssl rsa -in RS512-private.pem -pubout -outform PEM -out RS512-public.pem\n```\n\n## ES256\n\n```\nopenssl ecparam -genkey -name prime256v1  -noout -out ES256-private.pem\nopenssl ec -in ES256-private.pem -pubout -out ES256-public.pem\n```\n\n## ES384\n\n```\nopenssl ecparam -name secp384r1 -genkey -noout -out ES384-private.pem\nopenssl ec -in ES384-private.pem -pubout -out ES384-public.pem\n```\n\n## ES512\n\n```\nopenssl ecparam -genkey -name secp521r1 -noout -out ES512-private.pem\nopenssl ec -in ES512-private.pem -pubout -out ES512-public.pem\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgaunet%2Fjwt-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgaunet%2Fjwt-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgaunet%2Fjwt-cli/lists"}