</>PackageGraphPackageGraph

cac

npmv7.0.0

Simple yet powerful framework for building command-line apps.

Safe to adopt

Yes — cac scores well across adoption, maintenance, weight, supply chain, and licensing. 44M downloads per week and 9 known dependents. Last published 194 days ago. 2 releases in the last 2 years.

  • AAdoption: grade A, Excellent.

    44M downloads per week and 9 known dependents.

  • BMaintenance: grade B, Good.

    Last published 194 days ago. 2 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 40 KB installed.

  • ASupply chain: grade A, Excellent.

    No install scripts, 2 maintainers, and a contained dependency surface.

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding cac to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

40 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
node >=20.19.0
Module format
ESM only
TypeScript
No bundled types
Install scripts
None

Quick start

A usage example from the cac README.

// examples/basic-usage.js
import cac from 'cac'
const cli = cac()

cli.option('--type <type>', 'Choose a project type', {
  default: 'node',
})

const parsed = cli.parse()

console.log(JSON.stringify(parsed, null, 2))

Dependencies

Declared by cac v7.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (19)

@sxzz/eslint-config ^7.8.2@sxzz/prettier-config ^2.3.1@types/bun ^1.3.9@types/deno ^2.5.0@types/node ^25.3.2@typescript/native-preview 7.0.0-dev.20260227.1@vitest/coverage-v8 ^4.0.18bumpp ^10.4.1eslint ^10.0.2lint-staged ^16.2.7mri ^1.2.0prettier ^3.8.1simple-git-hooks ^2.13.1tinyexec ^1.0.2tsdown ^0.21.0-beta.2tsdown-preset-sxzz ^0.4.0typedoc ^0.28.17typescript ^5.9.3vitest ^4.0.18

Used by

Popular packages that depend on cac.

Relationship graph

Dependencies (left) and dependents (right) of cac.

Frequently installed together

Release history

2 releases in the last two years, typically about 2 days apart.

Recent versions of cac
VersionPublishedSizeLicense
7.0.0latest6 months ago40 KBMIT
7.0.0-beta.16 months ago39 KBMIT
6.7.144 years ago80 KBMIT
6.7.134 years ago80 KBMIT
6.7.124 years ago80 KBMIT
6.7.114 years ago80 KBMIT
6.7.104 years ago80 KBMIT
6.7.94 years ago80 KBMIT
6.7.84 years ago80 KBMIT
6.7.74 years ago79 KBMIT
6.7.64 years ago79 KBMIT
6.7.54 years ago79 KBMIT
6.7.44 years ago79 KBMIT
6.7.35 years ago79 KBMIT
6.7.25 years ago79 KBMIT

Overview

cac is an npm package that simple yet powerful framework for building command-line apps. It is extremely widely used, with about 44M downloads per week and 9 known dependents in the graph. The latest version is 7.0.0, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need simple yet powerful framework for building command-line apps and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (44M weekly downloads).
  • Clear open-source license (MIT).

Cons

  • Large dependency tree (19 direct dependencies) increases install size and audit surface.
  • No bundled TypeScript types (may require a separate @types package).

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Frequently asked questions

Should I use cac?

Yes — cac scores well across adoption, maintenance, weight, supply chain, and licensing. 44M downloads per week and 9 known dependents. Last published 194 days ago. 2 releases in the last 2 years.

How do I install cac?

Run `npm install cac` to add cac to your npm project.

What license is cac released under?

cac is distributed under the MIT license.

How popular is cac?

cac has approximately 43,976,442 downloads per week and 9 known dependent packages.

Is cac still maintained?

The most recent release of cac (v7.0.0) was published 6 months ago.

Does cac run install scripts?

No. cac does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.