Skip to content

Introduction

clif is a tiny, zero-dependency CLI framework for Node.js. It replaces the need for commander, chalk, inquirer, ora, and cli-table3 — all in a single, composable package under 15 KB gzipped.

Building CLI tools in Node.js typically means pulling in a constellation of packages:

  • commander or yargs for argument parsing
  • chalk or kleur for colors
  • inquirer or prompts for interactive input
  • ora for spinners
  • cli-progress for progress bars
  • cli-table3 for tables

Each comes with its own API patterns, version constraints, and transitive dependencies. clif unifies all of this into one package with zero dependencies.

  • Zero dependencies — nothing in node_modules except clif itself
  • Composable — every function is standalone, pure where possible, and returns strings
  • Tree-shakeable — import only what you need via clif or clif/prompts
  • Fast — no startup overhead, no config parsing, no plugin system
  • Type-safe — full TypeScript with strict types throughout
  • Testable — output components return strings, making unit testing trivial
  • Respectful — honors NO_COLOR, FORCE_COLOR, pipe detection, and terminal width
ModuleReplacesDescription
Colorschalk, kleurFull ANSI palette, 256-color, truecolor, hex, compose
Argscommander, yargsFlag parsing, types, aliases, choices, defaults
CommandscommanderNested subcommands, setup hooks, auto-help
BoxboxenBordered boxes with 5 styles, titles, alignment
Tablecli-table3Column-aligned tables with headers and borders
List / TreeOrdered/unordered lists, recursive tree rendering
SpinneroraAnimated spinner with succeed/fail/warn states
Progresscli-progressProgress bar with customizable format
Promptsinquirer, promptstext, password, confirm, select, multiselect, number