python-cli-ops skill
scriptsImplements modern command line interface patterns using Typer and Rich for structured commands and terminal UI formatting.
- GitHub stars
- 81
- Files
- 6
- Last commit
- Nov 7, 2026
- License
- MIT
- Allowed tools
- 3
What does the python-cli-ops skill do?
python-cli-ops implements modern command line interface patterns using Typer and Rich for structured commands and terminal UI formatting.
Summary generated from the skill's SKILL.md.
About the python-cli-ops skill
Building structured command line interfaces for Python applications is what this skill enables. Developers use it to implement modern terminal patterns by combining Typer for command logic and Rich for visual formatting. An agent should load this skill when tasked with writing Python scripts that require complex argument parsing, nested command groups, or sophisticated terminal user interfaces.
The skill provides patterns for creating required arguments, optional flags, and enum choices using Typer syntax. It also includes methods for generating visual terminal elements like tables, progress bars, panels, and color-coded error messages through the Rich library. It relies on Python 3.10 or higher and requires the typer and rich packages to function. The provided patterns allow for organized command structures, such as grouping user management tasks under a single sub-command prefix.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the python-cli-ops skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the python-cli-ops skill in Plugin
/plugin marketplace add 0xDarkMatter/claude-mods /plugin install claude-mods@claude-mods
Install the python-cli-ops skill in Claude Code
~/.claude/skills/python-cli-ops/SKILL.md
$ npx degit 0xDarkMatter/claude-mods/skills/python-cli-ops ~/.claude/skills/python-cli-opsInstall the python-cli-ops skill in Claude Code (project)
.claude/skills/python-cli-ops/SKILL.md
$ npx degit 0xDarkMatter/claude-mods/skills/python-cli-ops .claude/skills/python-cli-opsInstall the python-cli-ops skill in Codex
~/.agents/skills/python-cli-ops/SKILL.md
$ npx degit 0xDarkMatter/claude-mods/skills/python-cli-ops ~/.agents/skills/python-cli-opsInstall the python-cli-ops skill in Gemini CLI
~/.gemini/skills/python-cli-ops/SKILL.md
$ npx degit 0xDarkMatter/claude-mods/skills/python-cli-ops ~/.gemini/skills/python-cli-opsInstall the python-cli-ops skill in Claude.ai
npx degit 0xDarkMatter/claude-mods/skills/python-cli-ops python-cli-ops && zip -r python-cli-ops.zip python-cli-ops # claude.ai → Customize → Skills → + → Create skill → Upload a skill → python-cli-ops.zip
Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A skill needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachable0xdarkmatter/claude-mods/skills/python-cli-ops is public and reachablegithub.com/0xdarkmatter/claude-mods/tree/HEAD/skills/python- ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-07github.com/0xdarkmatter/claude-mods/commits ↗Pass
- No download-and-run or credential theft in scripts1 script read; no download-and-run, remote eval, base64 execution or credential uploadPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/0xdarkmatter/claude-mods/blob/HEAD/skills/python- ↗Pass
- Pre-approved tools are scopedBash lets the agent run any shell command without askinggithub.com/0xdarkmatter/claude-mods/blob/HEAD/skills/python- ↗Finding
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 174 linesgithub.com/0xdarkmatter/claude-mods/blob/HEAD/skills/python- ↗Pass
SKILL.md
View on GitHubPython CLI Patterns
Modern CLI development with Typer and Rich.
Basic Typer App
import typer
app = typer.Typer(
name="myapp",
help="My awesome CLI application",
add_completion=True,
)
@app.command()
def hello(
name: str = typer.Argument(..., help="Name to greet"),
count: int = typer.Option(1, "--count", "-c", help="Times to greet"),
loud: bool = typer.Option(False, "--loud", "-l", help="Uppercase"),
):
"""Say hello to someone."""
message = f"Hello, {name}!"
if loud:
message = message.upper()
for _ in range(count):
typer.echo(message)
if __name__ == "__main__":
app()
Command Groups
import typer
app = typer.Typer()
users_app = typer.Typer(help="User management commands")
app.add_typer(users_app, name="users")
@users_app.command("list")
def list_users():
"""List all users."""
typer.echo("Listing users...")
@users_app.command("create")
def create_user(name: str, email: str):
"""Create a new user."""
typer.echo(f"Creating user: {name} <{email}>")
@app.command()
def version():
"""Show version."""
typer.echo("1.0.0")
# Usage: myapp users list
# myapp users create "John" "john@example.com"
# myapp version
Rich Output
from rich.console import Console
from rich.table import Table
from rich.progress import track
from rich.panel import Panel
import typer
console = Console()
@app.command()
def show_users():
"""Display users in a table."""
table = Table(title="Users")
table.add_column("ID", style="cyan")
table.add_column("Name", style="green")
table.add_column("Email")
users = [
(1, "Alice", "alice@example.com"),
(2, "Bob", "bob@example.com"),
]
for id, name, email in users:
table.add_row(str(id), name, email)
console.print(table)
@app.command()
def process():
"""Process items with progress bar."""
items = list(range(100))
for item in track(items, description="Processing..."):
do_something(item)
console.print("[green]Done![/green]")
Error Handling
import typer
from rich.console import Console
console = Console()
def error(message: str, code: int = 1):
"""Print error and exit."""
console.print(f"[red]Error:[/red] {message}")
raise typer.Exit(code)
@app.command()
def process(file: str):
"""Process a file."""
if not os.path.exists(file):
error(f"File not found: {file}")
try:
result = process_file(file)
console.print(f"[green]Success:[/green] {result}")
except ValueError as e:
error(str(e))
Quick Reference
| Feature | Typer Syntax |
|---|---|
| Required arg | name: str |
| Optional arg | name: str = "default" |
| Option | typer.Option(default, "--flag", "-f") |
| Argument | typer.Argument(..., help="...") |
| Boolean flag | verbose: bool = False |
| Enum choice | color: Color = Color.red |
| Rich Feature | Usage |
|---|---|
| Table | Table() + add_column/row |
| Progress | track(items) |
| Colors | [red]text[/red] |
| Panel | Panel("content", title="Title") |
Additional Resources
./references/typer-patterns.md- Advanced Typer patterns./references/rich-output.md- Rich tables, progress, formatting./references/configuration.md- Config files, environment variables
Assets
./assets/cli-template.py- Full CLI application template
See Also
Related Skills:
python-typing-ops- Type hints for CLI argumentspython-observability-ops- Logging for CLI applications
Complementary Skills:
python-env- Package CLI for distribution
Files in this skill
6python-cli-ops skill questions
How do I install the python-cli-ops skill in Claude Code?
Run npx degit 0xDarkMatter/claude-mods/skills/python-cli-ops ~/.claude/skills/python-cli-ops. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the python-cli-ops skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What libraries are required for modern CLI development with this skill?
Modern CLI development requires Python 3.10 or higher, along with the typer and rich libraries.
How can I create command groups in a Typer application?
You can create command groups by initializing a new Typer instance and adding it to your main app using the add_typer method.
How do I display a progress bar in the terminal?
You can use the track function from the Rich library to wrap an iterable and display a progress bar.