feat: daedalus init - register argcomplete tab completion (v0.10.0)
- new script python/src/init/init.py: locates the register-python-argcomplete that belongs to the running interpreter (venv bin, NOT the resolve()d symlink target - proven by a live pipx run), appends the managed hook block to ~/.bashrc between # BEGIN/END daedalus init markers, idempotent; --bashrc, --dry-run; Windows notice; zsh warning - per-script spec python/src/init/spec.md (SPEC 6.11/6.12), tests python/tests/test_init_script.py (13; the plain test_init.py name is taken by daedalus/tests) - registry entry, README row + section, pyproject packaging (daedalus.init), CHANGELOG 0.10.0, version pins Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -20,6 +20,7 @@ daedalus --list # list everything
|
||||
| `gpgtools` | Python | gpg | YubiKey GPG/SSH helpers: initialize (gnupg readiness check + install), initialize_yubikey (fresh machine, steps 1-4), send_pubkey (resolve key, verify possession, append to a server), store_publickey (install the key from the machine being granted access), configure_ssh (marker-managed per-host ssh block) |
|
||||
| `hello` | Python | test | Prints a hello line and the daedalus version |
|
||||
| `hello_bash` | Bash | test | Sample bash script through the shared help() interface |
|
||||
| `init` | Python | setup | Enable tab completion for daedalus: register argcomplete in bash (appends the managed hook block to ~/.bashrc), idempotent |
|
||||
|
||||
Run the sample script:
|
||||
|
||||
@@ -163,7 +164,32 @@ config (move it into the managed markers or rename the alias).
|
||||
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).
|
||||
Run `daedalus init` once to register the hook in `~/.bashrc` (below); see
|
||||
also [INSTALL](./INSTALL.md#tab-completion).
|
||||
|
||||
### init
|
||||
|
||||
`init` is the one-time shell-side setup: it finds the
|
||||
`register-python-argcomplete` that belongs to this exact daedalus
|
||||
interpreter (so a pipx install wires its own venv, not some other
|
||||
python), appends the hook to `~/.bashrc` between managed markers, and
|
||||
tells you how to activate it now. Installing daedalus never touches your
|
||||
shell — this command does. It is idempotent: re-running on an already
|
||||
registered `~/.bashrc` writes nothing.
|
||||
|
||||
```bash
|
||||
daedalus init # register completion in ~/.bashrc
|
||||
daedalus init --dry-run # print the block and the target, change nothing
|
||||
daedalus init --bashrc FILE # a different bashrc
|
||||
```
|
||||
|
||||
| Argument | Default | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `--bashrc FILE` | `~/.bashrc` | Target file for the managed hook block |
|
||||
| `--dry-run` | off | Print the block and the target, change nothing |
|
||||
|
||||
Exit code: `3` when `register-python-argcomplete` is nowhere to be
|
||||
found (reinstall daedalus — argcomplete is a declared dependency).
|
||||
|
||||
## Getting started
|
||||
|
||||
|
||||
Reference in New Issue
Block a user