ec9848b169
- bash/daedalus_common.sh (new): the shared interface for bash scripts (SPEC item 6.10) - a script sources its sibling helper, defines help() (usage) and main(), and ends with daedalus_bash_dispatch "$@" which routes help/-h/--help to help() and everything else to main() unchanged (clear fallback errors when a script forgets either) - completion for bash scripts (SPEC item 3.13.5.2): after a completed script name daedalus offers --help, -h, help, prefix-filtered, written itself on the fd-8 argcomplete protocol - no script runs on TAB; scripts without the interface get the shell default - bash/hello_bash.sh (new, category test): sample script through the interface, the bash twin of hello, with tests; registry entry, README row, CHANGELOG bullet - tests: bash/tests/test_bash_interface.py (helper behavior, bash -n, enforcement of the interface for every registered .sh), test_hello_bash.py (direct and daedalus runs, help routing, SPEC 3.1 pass-through, completion probes including the user's daedalus hello_bash<TAB><TAB> case), completions units + e2e harness - README/INSTALL/SPEC updated (6.10, 3.13.5.2, tree, boilerplate with shellcheck directive); autotest green (212 tests) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
56 lines
2.0 KiB
Markdown
56 lines
2.0 KiB
Markdown
# daedalus (template)
|
|
|
|
Starter repository for daedalus:
|
|
one CLI, many small scripts, each with tests.
|
|
|
|
```bash
|
|
daedalus <name> [args...] # run a script
|
|
daedalus <category> [category...] # list scripts in the categories (AND)
|
|
daedalus --list # list everything
|
|
```
|
|
|
|
**[Install, usage, and development](./INSTALL.md)** ·
|
|
[SPEC](./SPEC.md) (how the repo is maintained) ·
|
|
[CHANGELOG](./CHANGELOG.md)
|
|
|
|
## Available scripts
|
|
|
|
| Script | Type | Categories | What it does |
|
|
| --- | --- | --- | --- |
|
|
| `hello` | Python | test | Prints a hello line and the daedalus version |
|
|
| `hello_bash` | Bash | test | Sample bash script through the shared help() interface |
|
|
|
|
Run the sample script:
|
|
|
|
```bash
|
|
daedalus hello # hello from daedalus 0.4.0
|
|
daedalus hello_bash me # hello, me (from daedalus bash)
|
|
daedalus hello_bash -h # usage from hello_bash's help()
|
|
daedalus test hello # same, through the category prefix
|
|
daedalus test # list the scripts in the 'test' category
|
|
```
|
|
|
|
`daedalus --list` prints the version, a `script` / `type` / `categories`
|
|
table, and each description wrapped under each row.
|
|
|
|
## Shell completion
|
|
|
|
Bash (and other shells argcomplete supports) completes script names and
|
|
category labels: `daedalus hel` + TAB completes `hello`, `daedalus test h` +
|
|
TAB completes `hello` inside the category, and options complete after `-`.
|
|
See [INSTALL](./INSTALL.md#tab-completion).
|
|
|
|
## Getting started
|
|
|
|
1. Clone or copy this template and name the Git remote for your team.
|
|
2. Add a script under `python/src/`, `bash/`, `powershell/`, or `batch/`
|
|
(see [SPEC layout](./SPEC.md#2-layout)); bash scripts implement the
|
|
shared `help()` interface (SPEC item 6.10).
|
|
3. Register it in `daedalus/registry.py`, add a row to the table above,
|
|
write tests, bump `version` in `pyproject.toml`, and run
|
|
`python autotest.py`.
|
|
|
|
`hello` is the sample script: copy its file, registry entry, README row,
|
|
and tests to add your own. Unknown names exit with code 2 and suggest
|
|
close matches.
|