Skip to content
Back to skills

Reviewing Cli Command

ASecurity

Provides checklist for reviewing Typer CLI command implementations. Covers structure, Annotated syntax, error handling, exit codes, display module usage, destructive action patterns, and help text conventions. Use when user asks to review/check/verify a CLI command, wants feedback on implementation, or asks if a command follows best practices.

  • 67 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 10, 2026
developmentpythongo

Works with

  • cli

Security analysis

A100/100

Scanned November 10, 2026

npx -y skills add ComeOnOliver/skillshub --skill reviewing-cli-command --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Reviewing Cli Command?

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

Security grade badge for Reviewing Cli Command
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/comeonoliver-reviewing-cli-command/badge)](https://www.skillsdirectory.com/skills/comeonoliver-reviewing-cli-command)

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: reviewing-cli-command
description: Provides checklist for reviewing Typer CLI command implementations. Covers structure, Annotated syntax, error handling, exit codes, display module usage, destructive action patterns, and help text conventions. Use when user asks to review/check/verify a CLI command, wants feedback on implementation, or asks if a command follows best practices.
---

# Reviewing CLI Commands

Checklist for reviewing Typer CLI command implementations.

## Review Process

1. Read the command file
2. Check each section below
3. Report findings using output format at bottom

## Structure

- [ ] File in `src/<cli_app>/commands/`
- [ ] Has `app = typer.Typer()` and `@app.command()`
- [ ] Command groups use `@app.command()` for each subcommand
- [ ] Registered in `commands/__init__.py` with `add_typer()`
- [ ] Single commands: `add_typer(app)` without name
- [ ] Command groups: `add_typer(app, name="group")`

## Arguments & Options

- [ ] Uses `Annotated` syntax
- [ ] Arguments for required positional input
- [ ] Options for optional named parameters
- [ ] Short flags where appropriate (`-f`, `-q`)
- [ ] Help text: lowercase, no period, brief

```python
# GOOD:
name: Annotated[str, typer.Argument(help="item name")]
force: Annotated[bool, typer.Option("--force", "-f", help="skip confirmation")] = False

# BAD:
name: str = typer.Argument(..., help="The name of the item.")
```

## Error Handling

- [ ] Validates input before processing
- [ ] Exit codes: 0=success, 1=error, 2=invalid input
- [ ] Errors via `display.error()`
- [ ] Uses `raise typer.Exit(code)` after errors
- [ ] Uses `raise typer.Abort()` for cancellation

```python
# GOOD:
if id < 1:
    display.error("ID must be positive")
    raise typer.Exit(EXIT_INVALID_INPUT)

# BAD:
if id < 1:
    print("Error: ID must be positive")
    return
```

## Output

- [ ] All output through `display` module
- [ ] No `print()`, `typer.echo()`, or `console.print()`

```python
# GOOD:
display.success(f"Added '{task.title}'")

# BAD:
print(f"Added '{task.title}'")
```

## Destructive Actions

- [ ] Has `--force` / `-f` flag
- [ ] `typer.confirm()` with `default=False`
- [ ] Shows "Cancelled" on abort

```python
# GOOD:
if not force:
    confirm = typer.confirm(f"Delete '{task.title}'?", default=False)
    if not confirm:
        display.info("Cancelled")
        raise typer.Abort()

# BAD: defaults to Yes
confirm = typer.confirm(f"Delete?", default=True)
```

## Help Text

- [ ] Docstring exists
- [ ] Imperative mood ("Add a task" not "Adds a task")
- [ ] First line < 60 characters

## Common Mistakes

| Mistake | Fix |
|---------|-----|
| `print()` | `display.success/error/warning/info()` |
| Wrong exit code | 0=success, 1=error, 2=invalid |
| Missing `--force` on delete | Add force option with default False |
| Confirmation defaults Yes | `default=False` in `typer.confirm()` |
| Old Typer syntax | `Annotated[type, typer.Argument()]` |
| Missing `app = typer.Typer()` | Each command file needs its own app |
| Not registered | `add_typer(app)` in `commands/__init__.py` |

## Review Output Format

```
## Review: <command_name>

[OK] Uses Annotated syntax
[OK] Has docstring in imperative mood
[X] Missing --force flag on destructive command
[X] Uses print() instead of display module
[!] Help text could be shorter

### Summary
<brief summary of issues found>

### Suggested Fixes
<code suggestions if needed>
```

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.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.