jwk-cli-tool
v1.0.1
Published
Interactive CLI for generating PEM and JWK files
Downloads
49
Readme
JWK CLI Tool
Simple interactive CLI to generate:
- PEM key pairs (
.private.pem,.public.pem) - JWK JSON files (
.private.jwk.json,.public.jwk.json)
Quick Start (No Install)
Run directly with npx:
npx jwk-cli-toolFor npx mode:
- CLI asks where to save generated files
- Default base folder is
./jwk - Files are saved in
<base>/keysand<base>/outputs
Requirements
- Node.js 18 or newer
- npm
Run Locally (Download Version)
If you want to run from cloned source:
npm install
npm run devOr build + start:
npm run build
npm startHow to use
When the CLI starts, choose one option:
Generate new PEM key pairGenerate JWK JSON filesExit
1) Generate new PEM key pair
You will be asked:
- key name
- key type (
ECorRSA) - algorithm (based on selected type)
Files created in keys/:
keys/<name>.private.pemkeys/<name>.public.pem
2) Generate JWK JSON files
You will be asked:
- PEM source:
- generate new PEM key pair, or
- use existing PEM files from
keys/
use(sigorenc)kid(defaults to key name)- algorithm only when needed (for existing RSA PEM)
Files created in outputs/:
outputs/<name>.private.jwk.jsonoutputs/<name>.public.jwk.json
The CLI also prints a public JWK preview in the terminal.
Supported algorithms
- EC:
ES256,ES384,ES512 - RSA:
RS256,RS384,RS512
Notes
keys/andoutputs/are auto-created if missing.- If a key name already exists, CLI asks whether to overwrite.
