ComeOnOliver/skillshub / skills/aiskillstore/marketplace/0xdarkmatter/python-cli-patterns
python-cli-patterns
VerifiedCLI application patterns for Python. Triggers on: cli, command line, typer, click, argparse, terminal, rich, console, terminal ui.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.0 KB |
| assets/cli-template.py | script | 6.4 KB |
| references/configuration.md | markdown | 7.2 KB |
| references/rich-output.md | markdown | 5.9 KB |
| references/typer-patterns.md | markdown | 6.6 KB |
| skill-report.json | config | 9.5 KB |
skill-report.json
View on GitHub{
"schema_version": "2.0",
"meta": {
"generated_at": "2026-01-16T14:00:06.799Z",
"slug": "0xdarkmatter-python-cli-patterns",
"source_url": "https://github.com/0xDarkMatter/claude-mods/tree/main/skills/python-cli-patterns",
"source_ref": "main",
"model": "claude",
"analysis_version": "3.0.0",
"source_type": "community",
"content_hash": "90f2f7659899b02494f25b5329f63a6f0c5e9bca3e99ef5866f70f5491f113c4",
"tree_hash": "bef6e9f5935302f68ab637b51894ff0c67908b497227451f46b2c13591a36f2b"
},
"skill": {
"name": "python-cli-patterns",
"description": "CLI application patterns for Python. Triggers on: cli, command line, typer, click, argparse, terminal, rich, console, terminal ui.",
"summary": "CLI application patterns for Python. Triggers on: cli, command line, typer, click, argparse, termina...",
"icon": "💻",
"version": "1.0.0",
"author": "0xDarkMatter",
"license": "MIT",
"category": "coding",
"tags": [
"python",
"cli",
"typer",
"terminal"
],
"supported_tools": [
"claude",
"codex",
"claude-code"
],
"risk_factors": [
"env_access",
"filesystem"
]
},
"security_audit": {
"risk_level": "low",
"is_blocked": false,
"safe_to_publish": true,
"summary": "Educational documentation skill providing CLI development patterns. Contains legitimate environment variable access for configuration (typer.Option envvar parameters), filesystem access for config file handling (Path.home, XDG directories), and Rich library progress tracking. All patterns are standard CLI development practices aligned with the stated purpose. The 159 static findings are false positives: markdown code examples (backticks for formatting, not execution), standard configuration patterns, and misidentified progress bar code as weak crypto.",
"risk_factor_evidence": [
{
"factor": "env_access",
"evidence": [
{
"file": "references/configuration.md",
"line_start": 16,
"line_end": 31
},
{
"file": "references/typer-patterns.md",
"line_start": 169,
"line_end": 169
}
]
},
{
"factor": "filesystem",
"evidence": [
{
"file": "assets/cli-template.py",
"line_start": 51,
"line_end": 52
},
{
"file": "assets/cli-template.py",
"line_start": 123,
"line_end": 129
},
{
"file": "references/configuration.md",
"line_start": 56,
"line_end": 63
}
]
}
],
"critical_findings": [],
"high_findings": [],
"medium_findings": [],
"low_findings": [],
"dangerous_patterns": [],
"files_scanned": 6,
"total_lines": 1576,
"audit_model": "claude",
"audited_at": "2026-01-16T14:00:06.799Z"
},
"content": {
"user_title": "Build Python CLI Applications",
"value_statement": "Creating command-line interfaces in Python requires understanding argument parsing, output formatting, and configuration management. This skill provides ready-to-use patterns for building professional CLI tools with Typer and Rich libraries.",
"seo_keywords": [
"Python CLI",
"Typer",
"Rich",
"command line",
"terminal",
"argparse",
"CLI patterns",
"Claude",
"Codex",
"Claude Code"
],
"actual_capabilities": [
"Create CLI applications with Typer decorators and argument parsing",
"Build command groups with subcommands for organized commands",
"Format terminal output with Rich tables, panels, and progress bars",
"Handle configuration files and environment variables",
"Implement interactive prompts and user confirmations",
"Test CLI applications using Typer CliRunner"
],
"limitations": [
"Does not execute external commands or system operations",
"Does not make network requests or API calls",
"Focuses on patterns rather than complete applications",
"Python 3.10+ required for all patterns"
],
"use_cases": [
{
"target_user": "Python developers",
"title": "Build Dev Tools",
"description": "Create internal developer tools and automation scripts with professional CLI interfaces"
},
{
"target_user": "DevOps engineers",
"title": "Configure Infrastructure",
"description": "Build configuration management CLIs with layered config files and environment variable support"
},
{
"target_user": "Data engineers",
"title": "Create Data Pipelines",
"description": "Develop data processing CLIs with progress tracking and rich output formatting"
}
],
"prompt_templates": [
{
"title": "Basic CLI Structure",
"scenario": "Starting a new CLI project",
"prompt": "Create a basic Typer CLI application with a main command and one subcommand"
},
{
"title": "Add Rich Output",
"scenario": "Enhancing CLI appearance",
"prompt": "Add a Rich table to display results and a progress bar for long-running operations"
},
{
"title": "Configuration Handling",
"scenario": "Managing app settings",
"prompt": "Implement configuration file loading from ~/.config/myapp/ and environment variable support"
},
{
"title": "Production Template",
"scenario": "Building complete CLI",
"prompt": "Create a production-ready CLI template with state management, error handling, and config subcommands"
}
],
"output_examples": [
{
"input": "Create a CLI command that shows user status in a table",
"output": [
"User table displayed with ID, Name, Email, and Status columns",
"Status column shows green checkmark for active users",
"Header styled with bold magenta text",
"Table includes title and proper column alignment"
]
},
{
"input": "Build a CLI with config subcommands for init, show, and path",
"output": [
"Config init command creates ~/.config/myapp/config.toml",
"Config show command displays current configuration in a panel",
"Config path command prints config file location",
"All commands use typer.confirm for safety"
]
},
{
"input": "Create a file processing CLI with progress bar",
"output": [
"Progress bar tracks file processing status",
"Files are validated for existence and readability",
"Output can be written to file or printed to console",
"Verbose mode logs processing details"
]
}
],
"best_practices": [
"Use type annotations for arguments to enable automatic validation and help text generation",
"Group related commands into subapps for better organization and discoverability",
"Implement --verbose and --config options at the callback level for consistent access across commands"
],
"anti_patterns": [
"Avoid using os.system() or subprocess calls for core functionality - use Typer commands instead",
"Do not hardcode configuration values - use environment variables and config files",
"Avoid mixing business logic with output formatting - separate concerns for testability"
],
"faq": [
{
"question": "What Python version is required?",
"answer": "Python 3.10 or higher is required. Typer uses modern type annotation features."
},
{
"question": "What libraries are needed?",
"answer": "Install typer and rich. Use: pip install typer rich. For complete CLI support, add pydantic-settings."
},
{
"question": "How to handle environment variables?",
"answer": "Use typer.Option(envvar='VAR_NAME') to read environment variables with automatic fallback to defaults."
},
{
"question": "Is user data safe?",
"answer": "This skill provides patterns only. Actual data handling depends on how you implement the CLI."
},
{
"question": "How to test CLI commands?",
"answer": "Use Typer's CliRunner from typer.testing. Invoke commands with argument lists and assert exit codes and output."
},
{
"question": "How does this compare to Click or argparse?",
"answer": "Typer builds on Click with Pythonic syntax. It is more concise than argparse while offering Rich integration for beautiful output."
}
]
},
"file_structure": [
{
"name": "assets",
"type": "dir",
"path": "assets",
"children": [
{
"name": "cli-template.py",
"type": "file",
"path": "assets/cli-template.py",
"lines": 257
}
]
},
{
"name": "references",
"type": "dir",
"path": "references",
"children": [
{
"name": "configuration.md",
"type": "file",
"path": "references/configuration.md",
"lines": 295
},
{
"name": "rich-output.md",
"type": "file",
"path": "references/rich-output.md",
"lines": 294
},
{
"name": "typer-patterns.md",
"type": "file",
"path": "references/typer-patterns.md",
"lines": 304
}
]
},
{
"name": "SKILL.md",
"type": "file",
"path": "SKILL.md",
"lines": 172
}
]
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |