Requirements#
What this project must do, the conditions it works under, and what it deliberately does not do. Each requirement says where it is verified, so a change that breaks one fails a test, not a user.
Purpose#
Let a team build command-line tools whose every prompt is declared once and can be answered by a person at a terminal, by flags in scripts and CI, or by an AI assistant interviewing the user in its own chat, with the same validation and the same safety rules in all three.
Functional requirements#
ID |
Requirement |
Verified by |
|---|---|---|
F1 |
Every question has a flag derived from its key, so every command runs from flags alone. |
|
F2 |
At a terminal, each applicable question its flag did not answer is asked; an invalid answer shows its error and is asked again. |
|
F3 |
When nobody can be asked ( |
|
F4 |
A consent is given only by |
|
F5 |
Questions apply conditionally on earlier answers, options and facts; a flag for a question that does not apply fails the run. |
|
F6 |
|
|
F7 |
A declaration that cannot work is rejected when it is built, naming the question and the problem. |
|
F8 |
One error policy with fixed exit codes: 0 success, 1 failure, 2 usage error, 130 interrupted; |
|
F9 |
Results go to stdout and status lines to stderr; user input in a status line is never read as markup. |
|
Non-functional requirements#
ID |
Requirement |
Verified by |
|---|---|---|
N1 |
Works on macOS, Linux and Windows; Python 3.11 and newer. |
CI matrix (3 OSes × Python 3.11, 3.14) |
N2 |
The declared dependency lower bounds work, not just the locked versions. |
CI |
N3 |
Four runtime dependencies only: pydantic, questionary, prompt-toolkit and rich. Another needs a strong case. |
Review ( |
N4 |
The package builds, renders on PyPI and imports from a clean environment; it is typed ( |
CI |
N5 |
95% or more test coverage; warnings in tests are errors; the README and the example are executed by the tests. |
CI |
N6 |
Source passes strict type checking; workflows pass |
CI |
N7 |
The API reference is generated from the docstrings, builds without warnings, and lists every public name. |
CI |
Environment and constraints#
Terminals: prompts need a terminal prompt_toolkit supports, which includes the usual ones on macOS, Linux and Windows. Without one, the command runs from flags and defaults.
Assistants: any assistant that can run a shell command and read its output can follow
--questions; nothing in the package is specific to one assistant.Repository rules (managed outside this repo): a code owner must approve every pull request, merges are squash-only,
ci-requiredmust pass, and tags matchingv*are protected. Releases are tags onmain, published to PyPI and as a GitHub Release (see CONTRIBUTING.md).
Out of scope#
A replacement for argparse’s parsing itself; shell completion; configuration files or
environment-variable defaults; translations; asynchronous commands; typed answer objects (answers
are a dict keyed by question key). Each can be proposed in an issue.
Verification status#
Every requirement above is covered by the test suite and CI. The prompts are tested through prompt_toolkit’s pipe input, which checks answers and keys but not how a prompt looks; visual changes are checked by hand in a real terminal.