Skip to content

Command API Reference

This page provides auto-generated API documentation for all commands.

Text Utilities

Uppercase

uppercase

Convert text to uppercase.

This module provides a command to convert input text to uppercase.

uppercase(text=typer.Argument(..., help='Text to convert to uppercase'), copy=typer.Option(False, '--copy', '-c', help='Copy result to clipboard'))

Convert text to UPPERCASE.

Parameters:

Name Type Description Default
text str

The text to convert to uppercase

Argument(..., help='Text to convert to uppercase')
copy bool

If True, copy the result to clipboard (uses xclip/xsel/wl-copy on Linux)

Option(False, '--copy', '-c', help='Copy result to clipboard')
Example

$ cli-utils local text-utils uppercase "hello world" HELLO WORLD

$ cli-utils local text-utils uppercase "hello world" --copy HELLO WORLD ✓ Copied to clipboard

Lowercase

lowercase

Convert text to lowercase.

This module provides a command to convert input text to lowercase.

lowercase(text=typer.Argument(..., help='Text to convert to lowercase'), copy=typer.Option(False, '--copy', '-c', help='Copy result to clipboard'))

Convert text to lowercase.

Parameters:

Name Type Description Default
text str

The text to convert to lowercase

Argument(..., help='Text to convert to lowercase')
copy bool

If True, copy the result to clipboard (uses xclip/xsel/wl-copy on Linux)

Option(False, '--copy', '-c', help='Copy result to clipboard')
Example

$ cli-utils local text-utils lowercase "HELLO WORLD" hello world

$ cli-utils local text-utils lowercase "HELLO WORLD" --copy hello world ✓ Copied to clipboard

Titlecase

titlecase

Convert text to title case.

This module provides a command to convert input text to title case.

titlecase(text=typer.Argument(..., help='Text to convert to title case'), copy=typer.Option(False, '--copy', '-c', help='Copy result to clipboard'))

Convert text to Title Case.

Parameters:

Name Type Description Default
text str

The text to convert to title case

Argument(..., help='Text to convert to title case')
copy bool

If True, copy the result to clipboard (uses xclip/xsel/wl-copy on Linux)

Option(False, '--copy', '-c', help='Copy result to clipboard')
Example

$ cli-utils local text-utils titlecase "hello world" Hello World

$ cli-utils local text-utils titlecase "hello world" --copy Hello World ✓ Copied to clipboard

Developer Tools

Code Report

code_report

Analyze Python files in a directory.

This module provides a command to analyze Python source files and generate reports with metrics like line counts, classes, functions, and methods.

code_report(directory=None, recursive=False, format=typer.Option('text', '--format', '-f', help='Output format'), browse=False, output=None)

Analyze Python files in a directory.

This command scans Python files and generates a report with metrics including: - Line counts (excluding blank lines and comments) - Number of classes, functions, and methods - Percentage of total lines per file

Parameters:

Name Type Description Default
directory OptionalDirectoryArg

Directory to analyze (defaults to current directory if not using --browse)

None
recursive RecursiveOption

If True, search subdirectories recursively

False
format Literal['text', 'json', 'markdown']

Output format (text, json, or markdown)

Option('text', '--format', '-f', help='Output format')
browse BrowseOption

If True, launch a file manager (Yazi/MC) to select directory interactively

False
output OutputOption

File path to save output. If set to 'browse', use file manager to select location

None
Example

$ cli-utils local devtools code-report . $ cli-utils local devtools code-report src --recursive $ cli-utils local devtools code-report . --format json $ cli-utils local devtools code-report --browse $ cli-utils local devtools code-report --browse --recursive $ cli-utils local devtools code-report . --output report.txt $ cli-utils local devtools code-report . --format json --output browse

Count Tests

count_tests

Count test functions in Python test files.

This module provides a command to scan test files and count test functions, providing a summary of test coverage across the codebase.

count_tests(directory=None, recursive=False, pattern=typer.Option('test_*.py', '--pattern', '-p', help='File pattern to match test files'), browse=False, verbose=False, format=typer.Option('table', '--format', '-f', help='Output format'), output=None)

Count test functions in Python test files.

This command scans test files and counts: - Total test files - Total test functions (functions starting with test_) - Total test classes (classes starting with Test) - Tests per file

Parameters:

Name Type Description Default
directory OptionalDirectoryArg

Directory to scan (defaults to current directory if not using --browse)

None
recursive RecursiveOption

If True, search subdirectories recursively

False
pattern str

Glob pattern to match test files (default: test_*.py)

Option('test_*.py', '--pattern', '-p', help='File pattern to match test files')
browse BrowseOption

If True, launch a file manager to select directory interactively

False
verbose VerboseOption

If True, show individual test function names

False
format Literal['table', 'summary', 'json']

Output format (table, summary, or json)

Option('table', '--format', '-f', help='Output format')
output OutputOption

File path to save output. If set to 'browse', use file manager to select location

None
Example

$ cli-utils local devtools count-tests . $ cli-utils local devtools count-tests tests --recursive $ cli-utils local devtools count-tests --browse $ cli-utils local devtools count-tests -b -r -v $ cli-utils local devtools count-tests tests -p "*_test.py" $ cli-utils local devtools count-tests . --output test_report.txt $ cli-utils local devtools count-tests . --format json --output browse

API Examples

Weather

weather

Get weather for a specific city.

This module provides an example of a command that fetches weather data from an API.

weather(city=typer.Argument(..., help='City to get weather for'), copy=typer.Option(False, '--copy', '-c', help='Copy result to clipboard'))

Get city weather.

Parameters:

Name Type Description Default
city str

City to get weather for

Argument(..., help='City to get weather for')
copy bool

If True, copy the result to clipboard (uses xclip/xsel/wl-copy on Linux)

Option(False, '--copy', '-c', help='Copy result to clipboard')
Example

$ cli-utils remote api_examples weather "milan" {'latitude': 45.48, 'longitude': 9.199999, 'generationtime_ms': 0.004291534423828125, 'utc_offset_seconds': 0, 'timezone': 'GMT', 'timezone_abbreviation': 'GMT', 'elevation': 128.0}

$ cli-utils remote api_examples weather "milan" --copy {'latitude': 45.48, 'longitude': 9.199999, 'generationtime_ms': 0.004291534423828125, 'utc_offset_seconds': 0, 'timezone': 'GMT', 'timezone_abbreviation': 'GMT', 'elevation': 128.0} ✓ Copied to clipboard