CLI Reference

The cyclopts package includes a command-line interface for various development tasks.

--install-completion

Register shell-completion for the cyclopts CLI itself.

Usage:

Usage: cyclopts --install-completion [OPTIONS]

Options:

--shell

Shell type for completion. If not specified, attempts to auto-detect current shell. [Choices: zsh, bash, fish]

--output, -o

Output path for the completion script. If not specified, uses shell-specific default.

generate-docs

Generate documentation for a Cyclopts application.

Usage:

Usage: cyclopts generate-docs [OPTIONS] SCRIPT [ARGS]

Arguments:

SCRIPT, --script

Python script path, optionally with ':app_object' notation to specify the App object. If not specified, will search for App objects in the script's global namespace. [Required]

Options:

OUTPUT, --output, -o

Output file path. If not specified, prints to stdout.

--format, -f

Output format for documentation. If not specified, inferred from output file extension. [Choices: markdown, md, html, htm, rst, rest, restructuredtext]

--include-hidden

Include hidden commands in documentation. [Default: False]

--heading-level

Starting heading level for markdown format. [Default: 1]

run

Run a Cyclopts application from a Python script with dynamic shell completion.

All arguments after the script path are passed to the loaded application.

Shell completion is available. Run once to install (persistent): cyclopts --install-completion

Usage:

Usage: cyclopts run SCRIPT [ARGS...]

Arguments:

SCRIPT

Python script path with optional ':app_object' notation. [Required]

ARGS

Arguments to pass to the loaded application.