Commander Extra Typings

Strong TypeScript typings for Commander that infer option and action handler types automatically.

Library
npm
v15.0.0
125stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
53/100Fair
Development Activity48
Maintenance32
Community56
Maturity56
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture82
Code Quality84
Innovation80
Learning Curve76

@commander-js/extra-typings is a TypeScript-only companion to the popular Commander CLI framework. It supplies enhanced typings that infer strong, precise types for the parameters of your action handlers, including options, and for the object returned by .opts().

The runtime is still provided by Commander itself; this package changes nothing at runtime and instead layers richer generics on top so the compiler can catch mistakes in your command definitions. You import from @commander-js/extra-typings instead of commander and immediately get type-safe options and arguments across your CLI.

What You Get

  • Inferred types for every parameter of your action handler callbacks
  • Strongly-typed objects returned by .opts()
  • A drop-in import that swaps commander’s types without changing runtime behavior
  • Compatibility versioning aligned to the matching commander major/minor release
  • Full TypeScript 5.0+ support with no runtime dependencies of its own

Common Use Cases

  • Adding compile-time safety to Commander-based CLI tools
  • Catching mismatched option and argument usage before runtime
  • Improving editor autocompletion for command options and handlers
  • Migrating existing Commander projects to fully typed command definitions

Under The Hood

Architecture - The package is almost entirely a declaration file (index.d.ts) that re-exports Commander’s runtime while overlaying generic wrapper types on Command, Option, and Argument. Each builder method (option, argument, requiredOption) is typed to accumulate its result into the Command’s generic parameters, so by the time you reach .action() or .opts() the compiler has assembled a precise type describing every declared value. index.js simply re-exports commander at runtime.

Tech Stack - TypeScript 5.0+ typings with a near-empty JavaScript runtime shim. It declares commander as a peer dependency, uses ESLint for linting, and ships tsconfig and example projects to validate the generics.

Code Quality - The repository includes a tests directory with type-level and behavioral checks, a CHANGELOG, security policy, and CONTRIBUTING guide. As part of the official Commander.js org, it follows the parent project’s conventions and version-alignment discipline.

API Design - Adoption is a single import swap, keeping the familiar Commander fluent API while adding inference. The main cost is more complex generic error messages, which the README documents under limitations; examples help developers understand the trade-offs.

Used by 8 apps in this directory

TypeScript
69%
Other

Budibase

Low Code Platforms · No Code Platforms

28,260

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
91
Repo Health
81
Technical
63
Dependency
Built with
TypeScript69%
Svelte26%
Updated 2 days ago
TypeScript
45%
Other

Convex Backend

Developer Tools · Databases

12,494

Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.

View details
87
Repo Health
82
Technical
68
Dependency
Built with
TypeScript45%
Rust43%
Updated 2 days ago
Svelte
46%
MIT

Cryptgeon

File Storage · Security

1,517

Self-destructing encrypted notes and files that vanish after viewing — the server never sees your keys.

View details
75
Repo Health
80
Technical
74
Dependency
Built with
Svelte46%
TypeScript30%
Rust14%
Updated yesterday
TypeScript
99%
AGPL 3.0

Karakeep

Bookmarks Archiving

28,871

Self-hosted bookmark manager that captures links, notes, images, and PDFs with AI tagging, full-text search, and automatic archiving.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript99%
Updated 1 weeks ago
TypeScript
84%
Apache 2.0

ktx

Data Engineering · Analytics · AI Development

1,577

ktx builds a self-improving context layer over your data warehouse so AI agents like Claude Code and Codex query it with approved metric definitions instead of reinventing SQL logic from scratch.

View details
76
Repo Health
85
Technical
72
Dependency
Built with
TypeScript84%
Updated 4 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

27,743

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
88
Repo Health
73
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
99%
Other

openclaude

AI Agents · AI Code Assistants

32,842

Run Claude Code workflows against any LLM — OpenAI, Gemini, Ollama, and 200+ backends — from a single terminal-first CLI.

View details
85
Repo Health
78
Technical
78
Dependency
Built with
TypeScript99%
Updated yesterday
TypeScript
91%
AGPL 3.0

PeerTube

Social Media

15,316

A federated, ActivityPub-based video hosting platform built by Framasoft — self-hostable instances interconnect into a network with no vendor lock-in, P2P-assisted streaming, and no ads.

View details
95
Repo Health
75
Technical
70
Dependency
Built with
TypeScript91%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search