cli-expert

Architect npm-based CLIs with root detection, argument parsing, and interactive prompts.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/hvngroup/directus_b2b_crm --skill cli-expert-hvngroup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-expert
Source: https://github.com/hvngroup/directus_b2b_crm/tree/main/.agent/skills/cli-expert
Command: npx skills add https://github.com/hvngroup/directus_b2b_crm --skill cli-expert-hvngroup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CLI development for npm packages is error-prone due to inconsistent argument parsing, environment detection, and cross-platform UX; this Skill provides a research-backed playbook to build reliable, composable CLIs that follow Unix philosophy and best practices.

Core Features & Use Cases

  • Automatic project root detection across projects
  • Flexible argument parsing with Commander.js/Yargs, including interactive and non-interactive modes
  • Unix-style tool design with composable, single-purpose commands and multi-binary support
  • Monorepo and workspace awareness for scalable toolchains
  • Robust UX guidelines, CI-ready prompts, and auto-generated help

Quick Start

Describe your CLI goal and let this expert guide you through scaffolding, argument design, and cross-platform UX.

Frequently Asked Questions about cli-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to build an npm CLI that follows the Unix philosophy?

The best way to build a Unix-philosophy npm CLI is to design composable, single-purpose commands with library-based argument parsing, automatic project root detection, and robust help text. This approach ensures reliable, cross-platform command-line behavior in both interactive and non-interactive environments.

How do I handle argument parsing and interactive prompts in a Node.js CLI?

To handle argument parsing and interactive prompts in a Node.js CLI, use libraries like Commander.js or Yargs for parsing, and implement interactive prompts with safe fallbacks for non-interactive CI environments. This ensures flexible UX and reliable command execution across different terminal contexts.

Does this CLI development approach work inside a monorepo?

Yes, this CLI development approach works inside a monorepo by providing automatic project root detection and workspace awareness. It handles platform-appropriate path handling to ensure consistent toolchain behavior across multiple packages within a single repository structure.

How do I structure a CLI with multi-binary support for an npm package?

To structure a CLI with multi-binary support for an npm package, architect composable, single-purpose commands that adhere to Unix philosophy. This involves configuring your package to expose multiple executable binaries while maintaining consistent argument parsing and auto-generated help text across each tool.

Why does my npm CLI fail to detect the project root in different environments?

An npm CLI fails to detect the project root across environments due to inconsistent path handling and lack of workspace awareness. Implementing robust automatic root-detection logic ensures your command-line tool reliably locates the project directory regardless of where it is executed.