clap-patterns

Community

Patterns for effective Clap v4+ CLI design.

Authorgeoffjay
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Common patterns and idioms for using Clap v4+ effectively in Rust CLI applications.

Core Features & Use Cases

  • Derive API vs Builder API: When to use derive vs builder.
  • Global Options with Subcommands: Structuring CLI with shared options and subcommands.
  • Argument Groups for Mutual Exclusivity: Enforce exclusive options.
  • Custom Value Parsers: Validate and convert CLI values.
  • Environment Variable Fallbacks: Integrate environment variables for CLI inputs.
  • Flattening Shared Options: Reuse common option groups.
  • Multiple Values: Support repeated arguments and lists.

Quick Start

Use Clap patterns to choose between derive and builder approaches and implement common CLI layouts for a project.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: clap-patterns
Download link: https://github.com/geoffjay/claude-plugins/archive/main.zip#clap-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository