Agent skill

click

Command Line Interface Creation Kit

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/fixtures-skilldoai-skilldo

SKILL.md

Imports

python
import click
from click import command, option, argument

Core Patterns

Basic Command

Create a simple CLI command with Click.

python
import click

@click.command()
def hello():
    click.echo('Hello World!')

if __name__ == '__main__':
    hello()

Command with Options

Add options to your CLI command.

python
import click

@click.command()
@click.option('--count', default=1, help='Number of greetings.')
@click.option('--name', prompt='Your name', help='The person to greet.')
def hello(count, name):
    for _ in range(count):
        click.echo(f'Hello {name}!')

if __name__ == '__main__':
    hello()

Command with Arguments

Use positional arguments in your CLI.

python
import click

@click.command()
@click.argument('name')
def hello(name):
    click.echo(f'Hello {name}!')

if __name__ == '__main__':
    hello()

Configuration

Click commands are decorated with @click.command() and options with @click.option().

Use click.echo() instead of print() for consistent output across platforms.

Pitfalls

Wrong: Using print() instead of click.echo()

python
@click.command()
def hello():
    print("Hello")  # May have encoding issues

Right: Always use click.echo()

python
@click.command()
def hello():
    click.echo("Hello")  # Handles encoding properly

References

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results