domain-cli

Guide Rust CLI application development with argument parsing and error handling.

51|6|Updated Mar 28, 2019
One-click install
npx skills add https://github.com/Mte90/dotfiles --skill domain-cli-mte90
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-cli
Source: https://github.com/Mte90/dotfiles/tree/main/.config/opencode/skills/domain-cli
Command: npx skills add https://github.com/Mte90/dotfiles --skill domain-cli-mte90

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance and best practices for developing command-line interface (CLI) tools, ensuring they are user-friendly, robust, and scriptable.

Core Features & Use Cases

  • Argument Parsing: Define and parse command-line arguments effectively using libraries like clap.
  • Configuration Management: Handle configuration precedence (CLI > env vars > file).
  • User Feedback: Implement progress bars and colored output for better user experience.
  • Error Handling: Ensure proper exit codes and error reporting to stderr.
  • Use Case: Developing a new CLI tool for code generation that needs to accept various flags, subcommands, and configuration files.

Quick Start

Use the domain-cli skill to generate a basic Rust CLI application structure with clap.

Frequently Asked Questions about domain-cli

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

FAQPage Schema
How do I build a robust CLI application in Rust with proper argument parsing?

To build a robust Rust CLI application, use the `clap` library for argument parsing to define and parse command-line arguments effectively, ensuring ergonomic design and efficient user feedback mechanisms.

What is the best way to handle configuration layering in a command-line tool?

Configuration layering in a command-line tool should follow a strict precedence order: command-line arguments override environment variables, which in turn override configuration file settings, ensuring flexible and predictable user configurations.

How does error handling work for terminal applications to ensure proper exit codes?

Error handling for terminal applications requires reporting errors to stderr and implementing proper exit code management, allowing shell scripts and calling processes to accurately detect command success or failure based on the returned status.

Can I implement progress bars and colored output for better CLI user feedback?

Yes, you can implement progress bars and colored output to provide better user feedback in CLI applications, which enhances the terminal experience by visually indicating long-running task progress and highlighting important information.

Does the domain-cli skill support generating structures for subcommands and flags?

Yes, the domain-cli skill supports generating a basic Rust CLI application structure using `clap`, allowing you to define and parse various flags, subcommands, and configuration files for tools like code generators.