jellycell.cli.commands.cache

jellycell cache — list, clear, rebuild-index, prune.

Module Contents

Classes

CacheListReport

JSON schema for jellycell cache list --json. §10.1 contract.

CacheClearReport

JSON schema for jellycell cache clear --json.

CacheRebuildReport

JSON schema for jellycell cache rebuild-index --json.

CachePruneEntry

One pruned manifest, for the cache prune JSON report.

CachePruneReport

JSON schema for jellycell cache prune --json.

Functions

list_cache

List cached cells ordered by most recent first.

clear_cache

Wipe the cache directory. Pass --yes to skip interactive confirmation.

prune_cache

Prune old cache entries.

rebuild_index

Rebuild the SQLite catalogue index from the manifest files on disk.

Data

API

jellycell.cli.commands.cache.cache_app

‘Typer(…)’

class jellycell.cli.commands.cache.CacheListReport(/, **data: Any)

Bases: pydantic.BaseModel

JSON schema for jellycell cache list --json. §10.1 contract.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

schema_version: int

1

project: str

None

entries: list[dict[str, Any]]

‘Field(…)’

class jellycell.cli.commands.cache.CacheClearReport(/, **data: Any)

Bases: pydantic.BaseModel

JSON schema for jellycell cache clear --json.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

schema_version: int

1

project: str

None

removed_manifests: int

None

removed_blobs: bool

None

class jellycell.cli.commands.cache.CacheRebuildReport(/, **data: Any)

Bases: pydantic.BaseModel

JSON schema for jellycell cache rebuild-index --json.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

schema_version: int

1

project: str

None

indexed: int

None

class jellycell.cli.commands.cache.CachePruneEntry(/, **data: Any)

Bases: pydantic.BaseModel

One pruned manifest, for the cache prune JSON report.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

cache_key: str

None

notebook: str

None

cell_id: str

None

executed_at: str

None

class jellycell.cli.commands.cache.CachePruneReport(/, **data: Any)

Bases: pydantic.BaseModel

JSON schema for jellycell cache prune --json.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

schema_version: int

1

project: str

None

dry_run: bool

None

removed: list[jellycell.cli.commands.cache.CachePruneEntry]

‘Field(…)’

kept: int

0

jellycell.cli.commands.cache.list_cache(ctx: typer.Context, project: pathlib.Path | None = typer.Argument(None, help='Project root.')) None

List cached cells ordered by most recent first.

jellycell.cli.commands.cache.clear_cache(ctx: typer.Context, project: pathlib.Path | None = typer.Argument(None, help='Project root.'), yes: bool = typer.Option(False, '--yes', '-y', help='Skip confirmation.')) None

Wipe the cache directory. Pass --yes to skip interactive confirmation.

jellycell.cli.commands.cache.prune_cache(ctx: typer.Context, project: pathlib.Path | None = typer.Argument(None, help='Project root.'), older_than: str | None = typer.Option(None, '--older-than', help="Remove entries executed more than this duration ago (e.g. '30d', '12h')."), keep_last: int | None = typer.Option(None, '--keep-last', help='Keep only the N most recent entries per notebook; drop the rest.'), dry_run: bool = typer.Option(False, '--dry-run', help="List what would be removed; don't delete.")) None

Prune old cache entries.

In this release, prune operates on manifests only. Blobs are left in place (diskcache dedupes content-addressed storage anyway; a proper ref-counted blob GC lands in a follow-up). Use cache clear for a full wipe if you need to reclaim disk.

jellycell.cli.commands.cache.rebuild_index(ctx: typer.Context, project: pathlib.Path | None = typer.Argument(None, help='Project root.')) None

Rebuild the SQLite catalogue index from the manifest files on disk.