Command-line-interface (CLI)

cruiseplan.cli package.

This package contains command-line interface modules for cruiseplan:

  • main: Primary CLI entry point and command dispatcher

  • bathymetry: Download bathymetry data

  • enrich: Enrich cruise YAML with computed fields

  • forecast: Generate real-time rolling station plan forecasts

  • list: List activities in a schedule with indices

  • map: Generate cruise track maps

  • pangaea: Export data to Pangaea

  • process: Process cruise YAML into enriched output

  • schedule: Generate cruise schedules

  • stations: Validate and display station definitions

  • validate: Validate cruise configuration files

cruiseplan.cli.handle_cli_errors(command_name: str, verbose: bool = False)[source]

Context manager that catches and formats standard cruiseplan CLI errors.

Parameters:
  • command_name (str) – Name shown in RuntimeError messages (e.g. “map”, “schedule”).

  • verbose (bool) – If True, print a full traceback on unexpected errors.

cruiseplan.cli.main module

cruiseplan CLI - Subcommand dispatcher for oceanographic cruise planning.

Each subcommand is defined in its own module (e.g. cruiseplan/cli/schedule.py) via a build_parser(subparsers) function. This module wires them together and dispatches to the appropriate run(args) function.

cruiseplan.cli.main.main()[source]

Main CLI entry point following git-style subcommand pattern.

cruiseplan.cli.bathymetry module

Bathymetry data download command.

This module implements the ‘cruiseplan bathymetry’ command for downloading bathymetry data assets required for cruise planning.

Thin CLI layer that delegates all business logic to the API layer.

cruiseplan.cli.bathymetry.build_parser(subparsers: _SubParsersAction) ArgumentParser[source]

Add the bathymetry subparser and return it.

cruiseplan.cli.bathymetry.run(args: Namespace) None[source]

Thin CLI wrapper for bathymetry command.

Delegates all business logic to the cruiseplan.bathymetry() API function.

cruiseplan.cli.pangaea module

Unified PANGAEA command.

This module implements the ‘cruiseplan pangaea’ command that can either: 1. Search PANGAEA datasets by query + geographic bounds, then download station data 2. Process an existing DOI list file directly into station data

Thin CLI layer that delegates all business logic to the API layer.

cruiseplan.cli.pangaea.build_parser(subparsers: _SubParsersAction) ArgumentParser[source]

Add the pangaea subparser and return it.

cruiseplan.cli.pangaea.determine_workflow_mode(args: Namespace) str[source]

Determine whether we’re in search mode or DOI file mode.

cruiseplan.cli.pangaea.run(args: Namespace) None[source]

Thin CLI wrapper for pangaea command.

Delegates all business logic to the cruiseplan.pangaea() API function.

cruiseplan.cli.pangaea.validate_lat_lon_bounds(lat_bounds: list[float], lon_bounds: list[float]) tuple[float, float, float, float][source]

Validate and convert latitude/longitude bounds into bounding box tuple.

This is a simple CLI helper that validates the user input format.

cruiseplan.cli.stations module

Interactive station placement command.

Thin CLI wrapper that calls the cruiseplan.stations() API function. This follows the established pattern used by process.py, validate.py, map.py, and schedule.py.

cruiseplan.cli.stations.build_parser(subparsers: _SubParsersAction) ArgumentParser[source]

Add the stations subparser and return it.

cruiseplan.cli.stations.run(args: Namespace) None[source]

Main entry point for interactive station placement.

Thin CLI wrapper that calls the cruiseplan.stations() API function. This follows the established pattern used by process.py, validate.py, map.py, and schedule.py.

Parameters:

args (argparse.Namespace) – Parsed command line arguments

cruiseplan.cli.process module

Unified configuration processing command.

This module implements the ‘cruiseplan process’ command that runs the complete workflow: enrichment -> validation -> map generation.

Thin CLI layer that delegates all business logic to the API layer.

cruiseplan.cli.process.build_parser(subparsers: _SubParsersAction) ArgumentParser[source]

Add the process subparser and return it.

cruiseplan.cli.process.run(args: Namespace) None[source]

Thin CLI wrapper for process command.

Delegates all business logic to the cruiseplan.process() API function.

cruiseplan.cli.schedule module

Cruise schedule generation command.

This module implements the ‘cruiseplan schedule’ command for generating comprehensive cruise schedules from YAML configuration files.

Thin CLI layer that delegates all business logic to the API layer.

cruiseplan.cli.schedule.build_parser(subparsers: _SubParsersAction) ArgumentParser[source]

Add the schedule subparser and return it.

cruiseplan.cli.schedule.run(args: Namespace) None[source]

Thin CLI wrapper for schedule command.

Delegates all business logic to the cruiseplan.schedule() API function.

cruiseplan.cli.enrich module (part of cruiseplan.cli.process)

Configuration enrichment command.

This module implements the ‘cruiseplan enrich’ command for adding missing data to existing YAML configuration files.

Thin CLI layer that delegates all business logic to the API layer.

cruiseplan.cli.enrich.build_parser(subparsers: _SubParsersAction) ArgumentParser[source]

Add the enrich subparser and return it.

cruiseplan.cli.enrich.run(args: Namespace) None[source]

Thin CLI wrapper for enrich command.

Delegates all business logic to the cruiseplan.enrich() API function.

cruiseplan.cli.validate module (part of cruiseplan.cli.process)

Configuration validation command.

This module implements the ‘cruiseplan validate’ command for comprehensive validation of YAML configuration files without modification.

Thin CLI layer that delegates all business logic to the API layer.

cruiseplan.cli.validate.build_parser(subparsers: _SubParsersAction) ArgumentParser[source]

Add the validate subparser and return it.

cruiseplan.cli.validate.run(args: Namespace) None[source]

Thin CLI wrapper for validate command.

Delegates all business logic to the cruiseplan.validate() API function.

cruiseplan.cli.map module (part of cruiseplan.cli.process)

Map generation command.

This module implements the ‘cruiseplan map’ command for generating cruise track visualisations (PNG maps and KML files).

Thin CLI layer that delegates all business logic to the API layer.

cruiseplan.cli.map.build_parser(subparsers: _SubParsersAction) ArgumentParser[source]

Add the map subparser and return it.

cruiseplan.cli.map.run(args: Namespace) None[source]

Thin CLI wrapper for map command.

Delegates all business logic to the cruiseplan.map() API function.