jellycell.cli.app

Typer CLI root for jellycell.

Every command supports --json (spec §2.8 / §10.1). Human mode uses rich; JSON mode prints a single pydantic-serialized object to stdout.

Module Contents

Classes

GlobalOptions

Global flags available to every subcommand.

Functions

resolve_notebook_and_project

Resolve a notebook argument against a project root.

global_options

jellycell — reproducible-analysis notebook tool.

Data

app

API

jellycell.cli.app.app

‘Typer(…)’

class jellycell.cli.app.GlobalOptions

Global flags available to every subcommand.

project_override: pathlib.Path | None

None

quiet: bool

None

verbose: bool

None

json_output: bool

None

jellycell.cli.app.resolve_notebook_and_project(notebook: pathlib.Path, project_override: pathlib.Path | None) tuple[pathlib.Path, jellycell.paths.Project]

Resolve a notebook argument against a project root.

Used by every command that takes a <notebook> argument (run, export ipynb|md|tearsheet). Two modes:

  • Walk-up (project_override is None): resolve notebook against CWD, then walk up from it to find jellycell.toml. Matches the long-standing default behavior.

  • Explicit (--project set): use project_override as the root and resolve notebook against it first, falling back to CWD if nothing exists at the project-relative location. Lets callers run jellycell --project showcase-foo run notebooks/01.py from anywhere without needing to prefix the showcase path twice.

Returns the resolved-absolute notebook path and the loaded :class:Project.

Raises: ProjectNotFoundError: If jellycell.toml cannot be found.

jellycell.cli.app.global_options(ctx: typer.Context, project: pathlib.Path | None = typer.Option(None, '--project', '-p', help='Project root. Defaults to discovery from cwd.', file_okay=False, dir_okay=True), quiet: bool = typer.Option(False, '--quiet', '-q', help='Reduce output.'), verbose: bool = typer.Option(False, '--verbose', '-V', help='Increase output.'), json_output: bool = typer.Option(False, '--json', help='Emit JSON instead of rich-formatted output.'), version: bool = typer.Option(False, '--version', callback=_version_callback, is_eager=True, help='Show version and exit.')) None

jellycell — reproducible-analysis notebook tool.