Params API Reference¶
Reference for sayer/params.py.
Option¶
Represents named CLI options (e.g. --region, --verbose).
Key constructor parameters¶
default*param_declshelpenvvarrequireddefault_factoryis_flagexpose_value
Argument¶
Represents positional CLI arguments.
Key constructor parameters¶
default*param_declshelprequireddefault_factoryexpose_value
Env¶
Represents environment-backed parameters.
Key constructor parameters¶
envvardefaultrequireddefault_factoryexpose_value
Param¶
Generic metadata type that can be normalized to Option (Param.as_option()) when option-style behavior is implied.
JsonParam¶
Specialized metadata indicating JSON input that should be decoded and molded into annotated target type.
Usage Example¶
from typing import Annotated
from sayer import Option, Argument, Env, JsonParam
@app.command()
def deploy(
service: Annotated[str, Argument()],
region: Annotated[str, Option("eu-west-1")],
token: Annotated[str, Env("API_TOKEN")],
config: Annotated[dict, JsonParam()],
):
...