tkt, pronounced toolkit, is an opinionated toolkit for building Node.js applications. Comes with good IntelliSense support thanks to TypeScript.


Most Node.js applications have a CLI entry point. The CLI API allows you to quickly create a CLI application.

Behind the scenes, it is powered by yargs with a reduced API surface and sensible defaults.


  • Strict by default. Unknown commands and arguments are rejected.

  • Supports --help generation.

  • Async errors result in failure exit code by default.

    'Default command',
      x: { type: 'number', desc: 'X coordinate', demand: true },
      y: { type: 'number', desc: 'Y coordinate', demand: true },
    async args => {
      console.log([args.x, args.y])
    'greet <name>',
    'Displays a greeting',
      name: { type: 'string' },
    async args => {
      console.log(`Hello, ${}`)

To learn more, see the cli() function documentation.

Structured logging

Powered by Pino.

  • Structured logging (JSON log output).

  • When connected to TTY, log output is prettified.

To learn more, see the logger() function documentation.


See invariant npm package.

To learn more, see the invariant() function documentation.