Skip to content

Add basectl run <project> <command> for manifest-declared commands #324

@codeforester

Description

@codeforester

Problem

basectl test <project> delegates to a manifest-declared test command, giving every project in the workspace a consistent test entrypoint. But test is the only such command. A project also needs to run its dev server, linter, formatter, and other recurring commands — and today each of those requires knowing the project's own tooling and working directory.

The vision: any project in the workspace is operable through one consistent control surface:

basectl run bankbuddy dev
basectl run bankbuddy lint
basectl run bankbuddy format

Proposed Manifest Shape

Extend base_manifest.yaml with a commands section:

project:
  name: bankbuddy

test:
  command: pytest tests/

commands:
  dev: uvicorn app:app --reload
  lint: ruff check .
  format: ruff format .

Proposed CLI

basectl run <project> <command> [-- extra args...]
basectl run <project> --list
basectl run --list                # list commands for the nearest project

Design Constraints

  • commands must remain declarative strings, not scripts or shell blocks. This is not a Makefile.
  • Commands run from the project root with the project venv on PATH — the same environment contract as basectl test.
  • -- extra args are appended to the declared command string (same pattern as the basectl test args-passthrough issue basectl test should support passing extra arguments to the test command #255).
  • basectl doctor <project> should validate that declared commands are non-empty strings; it should NOT validate that the binary exists (that is the adapter's job).
  • basectl run <project> --list provides discoverability without needing to inspect the manifest manually.
  • This does not replace mise run or just — projects using those tools should declare commands.test: mise run test rather than reimplementing task logic in Base.

Relationship To basectl test

test stays as a first-class manifest field with its own dedicated command (basectl test) for clarity and discoverability. commands is the general slot for everything else. basectl run <project> test should delegate to the test contract rather than a commands.test entry to avoid duplication.

Precondition

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions