Run artifact

workspace/targets/Quakes/blueprint/FEATURE-CliFoundation.md

FEATURE: CLI Foundation

FieldValue
Version20261025 V1
DescriptionPublishes the cli package, its main entry point, the cli_runner test helper, and the executable quakes launcher.
Depends OnARCHITECTURE.md
Providescli.main, cli.testing.cli_runner, ./quakes

Purpose

This foundation stands up the command-line entry point everything else registers into. It delivers the cli package, main(argv=None) -> int, the in-process cli_runner helper, and an executable file named quakes at the application root.

Interface

Dispatch is a skeleton in this story; later stories register commands and argument parsing.

Programmatic Acceptance

=== AC clifound-main-returns-int ===
Intent: main accepts an argv list and returns an integer exit code.

from cli import main

code = main([]) assert isinstance(code, int) === END AC clifound-main-returns-int ===

=== AC clifound-runner-shape ===
Intent: cli_runner returns an exit code, stdout text, and stderr text, and agrees with main.

from cli import main from cli.testing import cli_runner

args = ["no-such-command-xyz"] code, out, err = cli_runner(*args) assert isinstance(code, int) assert isinstance(out, str) assert isinstance(err, str) assert code == main(list(args)) === END AC clifound-runner-shape ===

=== AC clifound-registry ===
Intent: The command registry is a dict that main consults for dispatch.

import cli

assert isinstance(cli.COMMANDS, dict) === END AC clifound-registry ===

=== AC clifound-launcher ===
Intent: The quakes launcher at the application root is executable and exits with the same code main returns.

import os import subprocess import sys

from cli import main

assert os.path.isfile("quakes") assert os.access("quakes", os.X_OK) argv = [] result = subprocess.run(["./quakes", *argv], capture_output=True, text=True) print(result.stdout) print(result.stderr, file=sys.stderr) assert result.returncode == main(list(argv)) === END AC clifound-launcher ===

User Acceptance

Guardrails