vipvot
Zero-dependency TypeScript port of cobra
- Language
- TypeScript
- Version
- 0.4.0
- License
- MIT
- Category
- Ecosystem
A Bun-native CLI framework that mirrors Go's cobra/pflag exactly — command groups, flag-group constraints, persistent flags, the five-stage hook chain, and 33 pflag flag types. Differential-tested against a real cobra binary so a CLI written in vipvot translates back to Go cobra by mechanical rewrite. Powers the TypeScript agent-* CLIs in this collection.
Features
Cobra parity — command tree, persistent flags, flag-group constraints, five-stage hook chain
33 pflag flag types — scalars, slices (incl. IPSlice, IPNetSlice, UintSlice), maps, IP/CIDR, hex/base64, durations
POSIX/GNU parser — short combining (-vvv, -xVALUE), --no-foo negation, -- terminator
Differential-tested byte-for-byte against the cobra/pflag oracle
Doc generators — markdown, YAML, reST, man pages (vipvot/doc subpath)
Shell completion — bash, zsh, fish, PowerShell with dynamic value completers
Zero runtime dependencies — ~30 KB minified, ~8.5 KB gzipped
Bun-native build for `bun build --compile` single-binary CLIs; published ESM runs on Node 20+ too
Install
Bun
$ bun add vipvot npm
$ npm install vipvot Build from Source
$ git clone https://github.com/shhac/vipvot.git && cd vipvot && bun install && bun run build Usage
$ Command({ use: 'app', short: '...', run: (cmd, args) => {...} }) $ cmd.persistentFlags().stringP('config', 'c', '', 'config file') $ cmd.markFlagsMutuallyExclusive('json', 'yaml') $ import { genMarkdownTree } from 'vipvot/doc'; genMarkdownTree(rootCmd, './docs') $ import { genZshCompletion } from 'vipvot/completion'; genZshCompletion(rootCmd, process.stdout)