Skip to content

About

This Yargs helper function lets you define all your commands as individual files and their file names and directory structure defines via implication your nested command structure.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

yargs-file-commands logo


npm package npm downloads coverage discord chat documentation


Yargs File Commands

Define yargs commands as files; your directory tree becomes the CLI.

  • 📁 File-Based Command Tree
  • 🔒 Type-Safe Arguments
  • ⚡ Lazy Group Loading
  • 🧩 Command Overlays
  • ✅ Test-Time Validation

This Yargs helper function lets you define all your commands as individual files, where their file names and directory structure imply your nested command structure. Supports both JavaScript and TypeScript (on Node 24+).

Read the Docs to Learn More.

See the package README for installation and a quick example, and the documentation for guides and options.

Development

pnpm install
pnpm tsc
pnpm lint # oxlint
pnpm lint:fix
pnpm format # oxfmt
pnpm test # vitest
pnpm test:release # checks version selection and release notes without publishing
pnpm audit --audit-level=high
pnpm build:release
pnpm size

Tests cover production TypeScript source, including untested files. Minimum coverage is 95% statements, 85% branches, 95% functions, and 95% lines. The published package's JavaScript (gzipped, excluding peer dependencies) has a 10 kB size budget; adjust it only with a documented reason in the PR. High and critical dependency advisories fail CI. Coverage reports upload as CI artifacts and to Codecov via the CODECOV_TOKEN secret; Codecov upload failures are nonblocking, but the local coverage gate always applies.

Commit history through 09abc19 predates commitlint adoption and is excluded from CI commit linting; all commits after that boundary are checked (see .github/workflows/ci.yml's policy job).

Releases

See RELEASING.md for how releases are published and GitHub Releases for changes. See SECURITY.md for private vulnerability reporting.

Contribution

See Contributing Guide.

License

MIT

Author

Ben Houston, Sponsored by Land of Assets.

About

This Yargs helper function lets you define all your commands as individual files and their file names and directory structure defines via implication your nested command structure.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages