Skip to content
Back to skills

Command Line Tool Development

ASecurity

Use when designing or implementing a command-line program, subcommand, or shell-facing interface to specify arguments, input sources, output streams, exit codes, configuration precedence, and destructive-action safeguards before expanding functionality. Trigger for CLI creation, command changes, scripting interfaces, or terminal automation.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 10, 2026
toolsshell

Works with

  • terminal
  • cli

Security analysis

A100/100

Scanned October 10, 2026

npx -y skills add Manoj-11-Dahal/try-Skills --skill command-line-tool-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Command Line Tool Development?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Command Line Tool Development
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/manoj-11-dahal-command-line-tool-development/badge)](https://www.skillsdirectory.com/skills/manoj-11-dahal-command-line-tool-development)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: command-line-tool-development
description: "Use when designing or implementing a command-line program, subcommand, or shell-facing interface to specify arguments, input sources, output streams, exit codes, configuration precedence, and destructive-action safeguards before expanding functionality. Trigger for CLI creation, command changes, scripting interfaces, or terminal automation."
---

# Command-Line Tool Development

## Overview

This skill applies when designing or implementing a command-line program, subcommand, or shell-facing interface. Its intended outcome is to specify arguments, input sources, output streams, exit codes, configuration precedence, and destructive-action safeguards before expanding functionality.

## When to Use

### Preserved source section: When to Use

Use when people or scripts invoke a program through a terminal. Treat command names, flags, output, and exit status as a public interface that automation may depend on.

## Inputs

**Required:** See the preserved source input guidance below.

**Optional:** Not specified in source skill.

**Prerequisites:** Not specified in source skill.

### Preserved source section: Inputs

- Intended users, common tasks, operating systems, and shell environments.
- Commands, arguments, configuration sources, expected output, and error cases.
- Whether commands can overwrite, delete, publish, or otherwise change external state.

## Instructions

### Preserved source section: Procedure

1. **Define the interface.** Specify command grammar, required and optional arguments, defaults, environment/config precedence, and help text. Keep safe defaults and make ambiguous inputs fail clearly.
2. **Separate parsing from effects.** Parse and validate arguments before opening files, making network calls, or changing state. Expose core behavior as testable functions where practical.
3. **Make automation predictable.** Use stable exit codes, machine-readable output when requested, stdout for results, stderr for diagnostics, and no progress noise in quiet or JSON modes.
4. **Protect side effects.** Preview changes or require an explicit destructive flag for irreversible operations. Confirm destination paths and avoid following unexpected symlinks or glob expansions.
5. **Handle interruption and errors.** Clean up temporary files, preserve partial data deliberately, respond to signals, and return actionable messages without leaking secrets.
6. **Test at two levels.** Unit-test parsing and behavior; run subprocess tests for quoting, exit codes, streams, environment variables, working directories, and failure conditions.
7. **Document compatibility.** Keep help, examples, completion scripts, and migration notes aligned with the actual interface.

## Decision Rules

The following source conditional guidance is preserved verbatim; no unstated action is inferred.

### Source conditional guidance from: Inputs

- Whether commands can overwrite, delete, publish, or otherwise change external state.

### Source conditional guidance from: Procedure

3. **Make automation predictable.** Use stable exit codes, machine-readable output when requested, stdout for results, stderr for diagnostics, and no progress noise in quiet or JSON modes.

### Source conditional guidance from: Output and Acceptance

Report the command contract, defaults, exit behavior, side-effect gates, supported environments, and tested invocations. Accept when a human can discover the interface and a script can reliably distinguish success, expected failure, and unexpected failure.

## Output Format

### Preserved source section: Output and Acceptance

Report the command contract, defaults, exit behavior, side-effect gates, supported environments, and tested invocations. Accept when a human can discover the interface and a script can reliably distinguish success, expected failure, and unexpected failure.

## Validation Checklist

- [ ] Verify the source-defined success criteria above.

## Edge Cases and Recovery

### Source edge/failure guidance from: Inputs

- Commands, arguments, configuration sources, expected output, and error cases.

### Source edge/failure guidance from: Procedure

1. **Define the interface.** Specify command grammar, required and optional arguments, defaults, environment/config precedence, and help text. Keep safe defaults and make ambiguous inputs fail clearly.
5. **Handle interruption and errors.** Clean up temporary files, preserve partial data deliberately, respond to signals, and return actionable messages without leaking secrets.
6. **Test at two levels.** Unit-test parsing and behavior; run subprocess tests for quoting, exit codes, streams, environment variables, working directories, and failure conditions.

### Source edge/failure guidance from: Output and Acceptance

Report the command contract, defaults, exit behavior, side-effect gates, supported environments, and tested invocations. Accept when a human can discover the interface and a script can reliably distinguish success, expected failure, and unexpected failure.

## Examples

Not specified in source skill. The original provided no input/output example, and none has been invented.

## Success Criteria

### Acceptance criteria from source: Output and Acceptance

Report the command contract, defaults, exit behavior, side-effect gates, supported environments, and tested invocations. Accept when a human can discover the interface and a script can reliably distinguish success, expected failure, and unexpected failure.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…