API Reference

cac

There're only 4 APIs you need to learn for building simple CLIs: cli.option cli.version cli.help cli.parse.

Official Documentation ↗
CompatibilityThis documentation covers version v7.1.0. Check the official docs for the latest API surface.

Installation

npmnpm install cac
pnpmpnpm add cac
yarnyarn add cac

Methods

Overview

There’re only 4 APIs you need to learn for building simple CLIs: cli.option cli.version cli.help cli.parse.

API reference status

This page lists only entry points that appear verbatim in the official README examples: command, cac, parse, action. Parameter and return types are not given by the official README, so signatures are marked unverified.

Verification notes

API reference evidence

Fetched from official sources on 2026-11-08T18:32:00+08:00 via WebFetch https://raw.githubusercontent.com/egoist/cac/main/README.md(返回空);WebFetch https://cdn.jsdelivr.net/gh/egoist/cac@latest/README.md.

FAQ

What does cac do?
There're only 4 APIs you need to learn for building simple CLIs: cli.option cli.version cli.help cli.parse.
How do I install cac?
Run `npm install cac`.
Where can I verify the API details?
Official repository/documentation: https://github.com/egoist/cac. Checked on 2026-11-04; signatures and return values not stated in the official README are marked unverified.