Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/module/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ manager fixtures --help
╰──────────────────────────────────────────────────────────────────────────────────╯
```

### `fixtures load`

```bash
manager fixtures load [CONTEXTS]... [--strategy merge|insert|skip_existing] [--dry-run]
```

`CONTEXTS` defaults to `Context.BASE` when omitted, and can also be set via the `FIXTURES_CONTEXT` environment variable, handy for CI/deploy scripts that shouldn't need an explicit argument per environment:

```bash
FIXTURES_CONTEXT=testing manager fixtures load
```

An explicit CLI argument always takes precedence over the environment variable.

## Custom CLI

You can extend the CLI by providing your own Typer app. The `manager` entry point will merge your app's commands with the built-in ones:
Expand Down
2 changes: 1 addition & 1 deletion src/fastapi_toolsets/cli/commands/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def load(
ctx: typer.Context,
contexts: Annotated[
list[str] | None,
typer.Argument(help="Contexts to load."),
typer.Argument(help="Contexts to load.", envvar="FIXTURES_CONTEXT"),
] = None,
strategy: Annotated[
LoadStrategy,
Expand Down