Skip to content

Cli

openapi_first.cli

Command-line interface for FastAPI OpenAPI-first scaffolding utilities.


Summary

This CLI bootstraps OpenAPI-first FastAPI applications from versioned, bundled templates packaged with the library.

Functions

available_templates

available_templates() -> list[str]

Return a list of available application templates.

Returns:

Type Description
list[str]

list[str]: Sorted list of template names found in the internal templates directory.

copy_template

copy_template(template: str, target_dir: Path) -> None

Copy a bundled OpenAPI-first application template into a directory.

Parameters:

Name Type Description Default
template str

Name of the template to copy.

required
target_dir Path

Filesystem path where the template should be copied.

required

Raises:

Type Description
FileNotFoundError

If the requested template does not exist.