Syntic
← All skills
Developer ExperienceFreeCommunityv1.0.0

Cli Developer

Use when building robust CLI tools using Commander.js, yargs, clap with polished interfaces and shell completion.

About this skill

Use when building robust CLI tools using Commander.js, yargs, clap with polished interfaces and shell completion.

SKILL.md

cli-developer.SKILL.md

Place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review the contents and run it in a controlled environment first.

SKILL.md
---
name: Cli Developer
description: Use when building robust CLI tools using Commander.js, yargs, clap with polished interfaces and shell completion.
category: Developer Experience
version: 1.0.0
tools: []
---

# CLI Development

Designs and builds command-line interfaces that feel intuitive and professional.

## Key Steps

1. Gather requirements: target audience, runtime environment, expected command surface, whether interactive prompts or scripted automation is primary.
2. Select framework: based on language ecosystem (Node.js: Commander.js, yargs, oclif, Ink; Rust: clap, dialoguer; Python: Click, Typer, argparse; Go: cobra, urfave/cli), plugin extensibility needs, subcommand nesting requirements.
3. Design command hierarchy: consistent naming conventions, GNU-style long options with short aliases for common operations.
4. Implement argument parsing: strict validation, custom type coercion, mutually exclusive option groups where semantically required.
5. Build help text: include usage examples not just flag descriptions; ensure `--help` output fits within 80-column terminals.
6. Add output formatting: support for `--json`, `--quiet`, and `--no-color` flags as standard across all commands.
7. Implement configuration precedence: CLI flags override environment variables override config file override defaults.
8. Add shell completion: bash, zsh, fish, and PowerShell where framework supports generation.
9. Write integration tests: invoke the binary as subprocess and assert on stdout, stderr, and exit codes.
10. Package correctly: proper shebang lines, bin field in package.json or Cargo.toml binary targets, verify global install works cleanly.

## Standards

- Exit codes: 0 for success, 1 for general errors, 2 for usage errors (POSIX conventions).
- Output: stderr for diagnostics and progress, stdout for machine-parseable output only.
- Environment: respect NO_COLOR environment variable per https://no-color.org specification.
- Versioning: semantic versioning, display with `--version` flag.
- Signals: handle SIGINT and SIGTERM gracefully with cleanup routines.
- Piping: support stdin piping for commands accepting file input.
- Interactivity: never prompt when stdin is not a TTY.
- Progress: long-running operations display progress indicators with estimated time remaining.

Install

Syntic App

  1. 1Create a dedicated folder for this skill in your local skills library.
  2. 2Place SKILL.md into that folder.
  3. 3Restart Syntic and invoke this skill on matching tasks.

Syntic Code (CLI)

  1. 1Save SKILL.md in your local Syntic Code skills directory.
  2. 2Keep related files in the same skill folder.
  3. 3Run in a safe environment and validate outputs.