cli-expert

Design cross-platform CLI tools for npm packages with modular commands.

Updated Apr 9, 2024
One-click install
npx skills add https://github.com/nhonvo/Powershell --skill cli-expert-nhonvo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-expert
Source: https://github.com/nhonvo/Powershell/tree/main/antigrafity-config/.agent/skills/cli-expert
Command: npx skills add https://github.com/nhonvo/Powershell --skill cli-expert-nhonvo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides the design and implementation of robust, cross-platform CLI tools for npm packages, aligning with Unix philosophy and best practices for argument parsing, UX, and distribution.

Core Features & Use Cases

  • Comprehensive CLI architecture patterns for npm tools, including modular command design, workspace awareness, and cross-platform compatibility.
  • Guidance on selecting parsing libraries (Commander.js, Yargs, parseArgs) and implementing reliable error handling, auto-generated help, and testability.
  • Use Case: When building an npm package CLI, you can apply these patterns to create a focused, maintainable tool that works on Windows, macOS, and Linux.

Quick Start

Provide a minimal, production-ready CLI scaffold for an npm tool that follows Unix principles and includes a sample directory layout and a single core command.

Frequently Asked Questions about cli-expert

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

FAQPage Schema
How do I build a cross-platform CLI tool for an npm package?

Building a cross-platform CLI for an npm package requires modular command architecture, reliable argument parsing via libraries like Commander.js or Yargs, and structured error handling to ensure consistent execution across Windows, macOS, and Linux.

What's the best way to parse command-line arguments in Node.js?

Parsing command-line arguments in Node.js is best handled by dedicated libraries like Commander.js, Yargs, or parseArgs, which provide structured argument parsing, auto-generated help text, and reliable error handling for scalable CLI architectures.

Does Commander.js work for scalable command architectures in npm CLIs?

Commander.js supports scalable command architectures in npm CLIs by enabling modular command structures, auto-generated help, and reliable argument parsing, allowing you to build maintainable tools that follow Unix philosophy across different platforms.

How do I add interactive prompts and auto-generated help to a Node.js CLI?

Adding interactive prompts and auto-generated help to a Node.js CLI involves using parsing libraries like Yargs or Commander.js, which natively generate help text and support interactive prompt integrations for improved command-line UX.

How do I structure CI-ready tests for an npm command-line tool?

Structuring CI-ready tests for an npm command-line tool requires modular command structures and workspace awareness, enabling isolated testing of argument parsing and command logic to ensure reliable cross-platform configuration patterns across Windows, macOS, and Linux.

Why does my npm CLI tool fail on Windows but work on macOS and Linux?

An npm CLI tool failing on Windows but working on macOS and Linux usually indicates a lack of cross-platform configuration patterns, which can be fixed by implementing structured error handling and workspace-aware modular command design for reliable execution across all operating systems.