oct.cli module#

Purpose#

Provide the main command-line interface for the OCT (Option C Tools) ecosystem.

Responsibilities#

  • Define top-level commands: oct lint, oct format, oct new, oct scaffold, oct docs, oct test, oct export-source, oct clean, oct health.

  • Delegate work to the appropriate OCT modules.

  • Scaffold new Option C projects with a correct oc_diagnostics/debug_config.json pre-configured for use with oc_diagnostics.

  • Set up Sphinx documentation templates in docs/.

  • Ensure consistent behavior across all projects.

Diagnostics#

Domain: OCT-CLI Levels:

L2 — lifecycle L3 — semantic details L4 — deep tracing

Contracts#

  • Must be installed as the console entry point for the OCT package.

  • Must not contain business logic; only dispatching.

  • Scaffolded debug_config.json must be a valid oc_diagnostics configuration.

Dependencies#

  • oct (package version)

  • oct.core.project_root (project root detection)

  • oct.linter.oct_lint (linter command implementation)

  • oct.formatter.oct_format (formatter command implementation)

  • oct.health.oct_health (health dashboard command)

  • oct.generator.new_python_file (new file scaffolding)

  • oct.diag.oct_diag (diagnostics config commands)

  • oct.deps.oct_deps (dependency graph command)

  • oct.hooks.oct_hooks (pre-commit hooks generator)

  • oct.typecheck.oct_typecheck (type-checking wrapper)

  • click (CLI framework)

class oct.cli.OctGroup(name: str | None = None, commands: MutableMapping[str, Command] | Sequence[Command] | None = None, invoke_without_command: bool = False, no_args_is_help: bool | None = None, subcommand_metavar: str | None = None, chain: bool = False, result_callback: Callable[[...], Any] | None = None, **kwargs: Any)[source]#

Bases: Group

Custom group that shows per-command flags in the main –help output.

format_help(ctx, formatter)[source]#

Writes the help into the formatter if it exists.

This is a low-level method called by get_help().

This calls the following methods:

  • format_usage()

  • format_help_text()

  • format_options()

  • format_epilog()