Hi,
This is not a big deal but I noticed that when I run npx jwt-cli --version in a docker container not attached to a terminal, the option is ignored and jwt-cli tries to read a JWT from STDIN instead.
$ docker run --rm node npx --yes jwt-cli --version
/root/.npm/_npx/0badcb491528d04f/node_modules/fast-jwt/src/decoder.js:18
throw new TokenError(TokenError.codes.malformed, 'The token is malformed.')
^
TokenError: The token is malformed.
at decode (/root/.npm/_npx/0badcb491528d04f/node_modules/fast-jwt/src/decoder.js:18:11)
at decodeToken (/root/.npm/_npx/0badcb491528d04f/node_modules/jwt-cli/src/jwt.js:10:22)
at /root/.npm/_npx/0badcb491528d04f/node_modules/jwt-cli/index.js:23:24
at process.processTicksAndRejections (node:internal/process/task_queues:103:5) {
code: 'FAST_JWT_MALFORMED'
}
Node.js v25.1.0
It works if I add -it to the docker run command:
$ docker run --rm -it node npx --yes jwt-cli@2.0.0 --version
2.0.0
It also works with version 1.3.3:
$ docker run --rm node npx --yes jwt-cli@1.3.3 --version
jwt-cli - JSON Web Token parser [version 1.3.3]
Usage: jwt <encoded token> --secret=<signing secret>
ℹ Documentation: https://www.npmjs.com/package/jwt-cli
⚠ Issue tracker: https://github.com/troyharvey/jwt-cli/issues
I noticed because when I run my CI/CD pipeline in debug mode, I am printing the version of all the tools that I use. I'll just skip jwt-cli for now but I thought I'd let you know.
Cheers,
Tom
Hi,
This is not a big deal but I noticed that when I run
npx jwt-cli --versionin a docker container not attached to a terminal, the option is ignored andjwt-clitries to read a JWT from STDIN instead.$ docker run --rm node npx --yes jwt-cli --version /root/.npm/_npx/0badcb491528d04f/node_modules/fast-jwt/src/decoder.js:18 throw new TokenError(TokenError.codes.malformed, 'The token is malformed.') ^ TokenError: The token is malformed. at decode (/root/.npm/_npx/0badcb491528d04f/node_modules/fast-jwt/src/decoder.js:18:11) at decodeToken (/root/.npm/_npx/0badcb491528d04f/node_modules/jwt-cli/src/jwt.js:10:22) at /root/.npm/_npx/0badcb491528d04f/node_modules/jwt-cli/index.js:23:24 at process.processTicksAndRejections (node:internal/process/task_queues:103:5) { code: 'FAST_JWT_MALFORMED' } Node.js v25.1.0It works if I add
-itto thedocker runcommand:It also works with version 1.3.3:
I noticed because when I run my CI/CD pipeline in debug mode, I am printing the version of all the tools that I use. I'll just skip
jwt-clifor now but I thought I'd let you know.Cheers,
Tom