Reference consumer and learning application for the base-cli Python framework.
This repository contains Northstar, a small offline operational CLI. It is designed to show how an application embeds Base-CLI while keeping its own command tree, domain policy, and local data model.
Northstar does not require Base, Docker, cloud credentials, or network access after its dependencies are installed.
From a fresh checkout:
$ python3 -m venv .venv
. .venv/bin/activate
$ python -m pip install .
$ northstar --help
$ northstar --quiet statusThe default environment is dev. Select another fixture environment with the
framework lifecycle option:
$ northstar --quiet --environment staging status
$ northstar --quiet --environment dev status --format json
$ northstar --quiet --environment dev release plan --version 2.5.0
$ northstar --quiet --environment dev --dry-run release reconcile --version 2.5.0 --format jsonBase-CLI also provides the optional versioned lifecycle envelope:
$ northstar --quiet --environment dev --json status --format jsonFor a guided five-minute walkthrough with expected output and the framework boundary explained beside each scenario, see the scenario-driven learning path.
northstar statusreads consumer-owned, deterministic service fixtures.northstar release planis a nested command that produces a machine-readable release plan.northstar release reconcileuses the Base-CLI dry-run lifecycle boundary and explicitly reports that the demo performs no external changes.--environment,--quiet,--debug,--config,--keep-temp, and--log-fileare lifecycle options supplied by Base-CLI.--formatis a consumer-owned option that delegates rendering to the public Base-CLI output API.- The
--jsonoption wraps command output in Base-CLI's versioned success or error envelope. - The lifecycle safety guide shows dry-run safety, structured errors, redacted diagnostics, temporary paths, and cleanup.
- The released-package compatibility guide explains the supported Base-CLI range and the installed-wheel CI gate.
- The optional integration scenarios show Typer, Rich, and OpenTelemetry without making them core dependencies.
- The release process covers reproducible wheel and source-distribution validation separately from Base-CLI versioning.
The application uses only the public import base_cli facade. Base-CLI owns the
invocation lifecycle, context, logging, runtime paths, cleanup, and structured
output. Northstar owns the Click command tree, service fixture schema, release
planning policy, and domain-facing messages.
The generic consumer profile is explicit in src/base_cli_demo/cli.py. The demo
does not inherit Base-specific manifest, project, history, or cache conventions.
Northstar keeps the generic Base-CLI profile and opts into one small consumer-owned policy: an explicit JSON config can filter services by owner and set the default release target. The default path has no config file and uses the generic profile defaults; the configured path is an application adapter, not a Base repository convention.
Try the default policy and then the checked-in commerce policy:
$ northstar --quiet config show --format json
$ northstar --quiet --config examples/northstar-commerce.json status --format json
$ northstar --quiet --config examples/northstar-commerce.json release plan --format jsonThe config show command reports each normalized value and whether it came
from the consumer default or the explicit file. Invalid JSON or unsupported
values produce a safe configuration error with exit status 2. See
docs/configuration.md for the schema and the
profile boundary.
Install the development extra and run the focused suite:
python -m pip install ".[dev]"
python -m pytest
./tests/validate.shThe package requires Python 3.10 or newer and pins the supported Base-CLI line
to >=0.4.3,<0.5. This checkout targets demo release v0.1.0; demo release
versioning remains separate from framework versioning.
src/base_cli_demo/cli.pycontains the consumer-owned Click tree and the Base-CLI attachment boundary.src/base_cli_demo/fixtures/services.jsoncontains deterministic local data.tests/test_cli.pyexercises the installed lifecycle through the public testing helper.pyproject.tomldefines the installablenorthstarconsole script.- The generated Base repository files provide the project workflow and release contract; the demo itself does not require Base at runtime.
This repository is managed by Base.
Common commands:
basectl setup base-cli-demo
basectl check base-cli-demo
basectl doctor base-cli-demo
basectl test base-cli-demo