httk.core.project.cli

The core-owned httk project command.

httk project owns the anchor: init creates one (like git init), show describes it, export creates a signed redistribution, verify-export checks one, and import-v1 migrates a legacy project.

Attributes

Functions

describe_project([root])

Describe one project's anchor.

project_repair([project_root, apply, adopt])

Repair a project's anchor and every member, or report only under dry run.

build_parser(program)

Build the core-owned project command tree.

command(argv, context)

Handle the registered top-level project command.

Module Contents

httk.core.project.cli.Handler
httk.core.project.cli.describe_project(root=None)

Describe one project’s anchor.

Parameters:

root (str | pathlib.Path | None) – Project root, or None to discover the nearest project.

Returns:

JSON-ready description of project metadata and trust keys.

Raises:

ValueError – If no project exists or its metadata is invalid.

Return type:

dict[str, object]

httk.core.project.cli.project_repair(project_root=None, *, apply=True, adopt=True)

Repair a project’s anchor and every member, or report only under dry run.

Core owns the anchor checks — the key pin and the manifest — and each member handler contributes its own findings, concatenated after them. Repairs are applied by default; apply=False is a dry run that mutates nothing. Member adoption is driven through each kind’s project-scope scan, gated by adopt.

Parameters:
  • project_root (str | pathlib.Path | None) – Project root, or None to discover the nearest project.

  • apply (bool) – Whether to apply repairs; False reports only.

  • adopt (bool) – Whether the kind-scope scan should adopt members on this machine.

Returns:

JSON-compatible repair report.

Return type:

dict[str, object]

httk.core.project.cli.build_parser(program)

Build the core-owned project command tree.

Parameters:

program (str) – Program name used by the parser in help and errors.

Returns:

Configured project command parser.

Return type:

argparse.ArgumentParser

httk.core.project.cli.command(argv, context)

Handle the registered top-level project command.

Parameters:
Returns:

Command exit status.

Return type:

int