Back to Skills

python-cli-engineering

verified

Engineer production-grade Python CLI tools with UV for package management, Ruff for linting, Pyright for strict typing, Typer for commands, and Rich for polished output. Addresses fail-fast patterns, pydantic-settings configuration, modular code organization, and professional UX conventions. Apply when creating admin utilities, data processors, or developer tooling.

View on GitHub

Marketplace

aeo-skill-marketplace

AeyeOps/aeo-skill-marketplace

Plugin

aeo-python

development

Repository

AeyeOps/aeo-skill-marketplace

aeo-python/skills/python-cli-engineering/SKILL.md

Last Verified

January 25, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/AeyeOps/aeo-skill-marketplace/blob/main/aeo-python/skills/python-cli-engineering/SKILL.md -a claude-code --skill python-cli-engineering

Installation paths:

Claude
.claude/skills/python-cli-engineering/
Powered by add-skill CLI

Instructions

# Python CLI Engineering

Modern patterns for building production-grade Python command-line applications.

## When to Use This Skill

Use when building:
- Command-line tools and utilities
- Data processing applications
- Admin/operations tooling
- Developer utilities
- ETL/sync scripts with user interaction
- Analysis tools with formatted output
- Database management CLIs

---

## Technology Stack Overview

### Core Tools
- **UV** - Package manager (10-100x faster than pip/poetry)
- **Ruff** - Linting + formatting (Rust-based, replaces 6+ tools)
- **Pyright** - Type checking in strict mode (3-5x faster than mypy)
- **Typer** - CLI framework with type hints + auto-help
- **Rich** - Console output with colors, tables, progress bars

**Installation:**
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh  # Install UV
uv init my-cli          # Initialize project
uv add typer rich       # Add dependencies
```

**For complete tool guides, configuration examples, and advanced patterns:**
See [references/tech-stack.md](references/tech-stack.md)

---

## Fail-Fast Discipline

### Core Principles

1. **No default values** (except in explicit config files)
2. **No try/catch swallowing** (let exceptions propagate)
3. **No fallback mechanisms** (fail immediately on errors)
4. **Explicit configuration** (missing config = app stops)
5. **Type everything** (strict Pyright mode)

### Exception Handling Pattern

```python
# Custom exceptions (core/exceptions.py)
class AppError(Exception):
    """Base exception - let it bubble up."""
    pass

# CLI main entry (cli/main.py)
def main() -> None:
    """Main entry point - ONLY catch at top level."""
    try:
        app()
    except AppError as e:
        console.print(f"[red]ERROR: {e}[/red]")
        raise typer.Exit(code=1) from e
```

**Key Rules:**
- ❌ **Never**: `except Exception: pass` or `except: return None`
- ✅ **Always**: Let exceptions bubble to main entry point
- ✅ **Always**: Use specific exception types for different fa

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
9278 chars