Module

cli.commands.sources

CLI commands for managing content sources.

Commands:

bengal sources list     - List configured content sources
bengal sources fetch    - Fetch/refresh content from sources
bengal sources status   - Show cache status
bengal sources clear    - Clear cached content

Functions

_get_site_root
Get site root from CLI context, with CWD fallback for interactive use. For CLI commands, using Pat…
1 Path
def _get_site_root(ctx: click.Context) -> Path

Get site root from CLI context, with CWD fallback for interactive use.

For CLI commands, using Path.cwd() as fallback is intentional and acceptable because the user is explicitly running commands from a directory they chose. This differs from library code where paths must be explicit.

See: plan/implemented/rfc-path-resolution-architecture.md

Parameters 1

Name Type Default Description
ctx click.Context

Click context (may have site_root in obj)

Returns

Path

Absolute path to site root

sources_group
Manage content sources (Content Layer). Content sources can be local directories or remote sources…
0 None
def sources_group() -> None

Manage content sources (Content Layer).

Content sources can be local directories or remote sources like GitHub repositories, Notion databases, or REST APIs.

Use 'bengal sources list' to see configured sources.

list_sources
List all configured content sources.
1 None
def list_sources(ctx: click.Context) -> None

List all configured content sources.

Parameters 1

Name Type Default Description
ctx click.Context
cache_status
Show cache status for content sources.
1 None
def cache_status(ctx: click.Context) -> None

Show cache status for content sources.

Parameters 1

Name Type Default Description
ctx click.Context
fetch_sources
Fetch content from remote sources.
3 None
def fetch_sources(ctx: click.Context, source: str | None, force: bool) -> None

Fetch content from remote sources.

Parameters 3

Name Type Default Description
ctx click.Context
source str | None
force bool
clear_cache
Clear cached content from remote sources.
3 None
def clear_cache(ctx: click.Context, source: str | None, yes: bool) -> None

Clear cached content from remote sources.

Parameters 3

Name Type Default Description
ctx click.Context
source str | None
yes bool
register_commands
Register source commands with CLI.
1 None
def register_commands(cli: click.Group) -> None

Register source commands with CLI.

Parameters 1

Name Type Default Description
cli click.Group