hermes-piandClaude Sonnet 5.5 06ee65757a feat(sshtools): tunnel start warns when the target redirects away from the tunnel (0.51.1)
The check reads the answer's head; a 301/302/303/307/308 with an absolute
Location for another host or port warns, and suggests the https:// target.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-06 12:43:30 +01:00

name, version
name version
readme 0.27.2

daedalus (template)

Starter repository for daedalus: one CLI, many small scripts, each with tests.

daedalus NAME ARGS...              # run a script
daedalus CATEGORY ...              # list scripts in the categories (AND)
daedalus --list                  # list everything

Install, usage, and development · SPEC (how the repo is maintained) · CHANGELOG

Available scripts

Script Type Version Categories What it does
gittools Python 1.1.0 git Git helper subcommands: dir-status - repository status table over a directory, recursive and read-only (local refs only): branch, upstream sync, staged/modified/untracked counts; default target ~/repositories, falls back to the current directory, prints no repo found when neither holds a repository; --fetch syncs every repo first; ported from repos.sh
gpgtools Python 3.2.6 gpg GnuPG helpers, no YubiKey needed: install-gnupg, send-key, add-local-key
linter Python 1.3.2 dev, lint Lint markdown (pymarkdown MD* rules plus dead links MDL001/MDL002), frontmatter (FML*), Python (ruff plus custom PYC* rules), JSON (JSN*) files, Python and shell fences in markdown (fences), HTML and JavaScript files (htmljs), and shell scripts (shellcheck); --fix, --json, --settings, --exclude, -q, --no-color, -n
sshtools Python 1.7.1 ssh SSH key and host helpers without a YubiKey: send-key, add-local-key, add-host, list-hosts, add-vnc-launcher, tunnel
yubikeytools Python 1.7.1 yubikey, gpg Helpers for a key on your YubiKey: status, gpg (prepare, send-key, add-local-key, add-host), fido2 (check, create-key, create-non-resident-key, list-keys, load-keys, setup-server), and android (setup, check; Termux)

Run a few of the builtins:

daedalus --init                # register tab completion in bash or PowerShell (once)
daedalus gittools dir-status  # repository status over a directory
daedalus linter markdown docs/ # lint the markdown under docs/
daedalus dev                   # list the scripts in the 'dev' category

daedalus --list prints the version and a script / type / categories table. Each description is hidden by default to keep the listing clean; add -d/--desc (daedalus --desc --list, daedalus --desc <category>) to see each description wrapped under its row.

gittools

Git helper subcommands, category git; the first is dir-status: one row per git repository found under a directory — recursive, but a found repository is not descended into — with the branch, the upstream sync (N ahead, N behind, up to date, no upstream), and the working-tree counts (N staged, N modified, N untracked, or clean). Every probe reads local refs; nothing touches the network or changes the repositories.

daedalus gittools                      # overview of the subcommands
daedalus gittools dir-status           # scan ~/repositories (default)
daedalus gittools dir-status ~/src      # scan that directory instead
daedalus gittools dir-status --fetch   # git fetch in every repo first
daedalus git                             # list the scripts in 'git'

dir-status with no DIRECTORY: the default target is ~/repositories; when that folder is missing or holds no repository, the current working directory is checked (a notice line goes to stderr); when neither holds one, the script prints no repo found and exits 1. A given DIRECTORY that does not exist is a usage error (exit 2), and an unknown subcommand is an argparse error (exit 2). --fetch runs git fetch in every discovered repository before the probes — sync counts then include this run's fetch (this is the only flag that touches the network); a repo with no remote or a failed fetch is silently probed as without it.

When color is enabled (NO_COLOR unset/empty and FORCE_COLOR or a terminal — the same gate as daedalus --list), yellow highlights what wants attention: a branch other than main/master, a sync other than up to date, and a working tree other than clean. Repo names and headers stay plain; padding is applied before coloring, so a redirected run is byte-identical to the no-color output.

Argument Default Meaning
dir-status DIRECTORY ~/repositories, else the current directory Directory to scan recursively for git repositories
--fetch off git fetch in every repository before the status probes

gpgtools

GnuPG helpers that need no YubiKey.

daedalus gpgtools                          # overview
daedalus gpgtools install-gnupg            # install gnupg when missing
daedalus gpgtools send-key --fingerprint FP you@server
daedalus gpgtools add-local-key --url https://keys.openpgp.org/vks/v1/by-fingerprint/FP
Argument Default Meaning
--url URL / --fingerprint FP one required Where the GPG public key comes from
--no-verify off Send without proof of possession
--dry-run off Show what would happen

yubikeytools

For a key on your plugged YubiKey. The gpg group uses the card's GPG key through gpg-agent and only reads the card. The fido2 group uses resident FIDO2 SSH keys; only create-key and setup-server write to the YubiKey. The android group (Termux only) sets up the card's GPG key through the apps OpenKeychain and OkcAgent, because gpg cannot reach the card there.

daedalus yubikeytools gpg prepare                      # set up this machine
daedalus yubikeytools gpg send-key you@server          # PIN prompt, then sent
daedalus yubikeytools gpg add-local-key                # on the machine to be accessed
daedalus yubikeytools gpg add-host --alias web --user you
daedalus yubikeytools fido2 check
daedalus yubikeytools fido2 setup-server --alias web you@server
daedalus yubikeytools fido2 load-keys                  # on another machine
daedalus yubikeytools android setup                    # Termux: through OpenKeychain
daedalus yubikeytools android check                    # Termux: what is still missing
Argument Default Meaning
--name N key1 FIDO2 key name; needed when the YubiKey has several
--new-key off Make an additional key named --name
--overwrite off Replace the key named --name; always asks [y/N]
--alias A none setup-server also writes the ssh config host A

FIDO2 keys need PIN and touch, OpenSSH 8.4 or newer on the server, and (not verified here) YubiKey firmware 5.2.3 or newer.

sshtools

For plain SSH keys, without a YubiKey.

daedalus sshtools send-key --file ~/.ssh/id_ed25519.pub you@server
daedalus sshtools add-local-key --file /media/usb/key.pub
daedalus sshtools add-host --alias web --identity-file ~/.ssh/id_ed25519
daedalus sshtools list-hosts
daedalus sshtools add-vnc-launcher --name raspi --via web   # Linux only
daedalus sshtools tunnel start --via raspi 192.168.178.200:80
daedalus sshtools tunnel start --via raspi http://192.168.178.200   # port 80
daedalus sshtools tunnel start --daemon --no-browser --via raspi :8080
daedalus sshtools tunnel list
daedalus sshtools tunnel stop            # or: stop NAME | stop PORT | stop --all
Argument Default Meaning
--file PATH / --pubkey LINE one required Where the public key comes from
--identity-file FILE required for add-host The host's IdentityFile
--authorized-keys FILE ~/.ssh/authorized_keys Target of add-local-key
--no-verify off Send without proof of possession
--dry-run off Show what would happen
--via HOST required for add-vnc-launcher and tunnel start An ssh config alias or [USER@]HOST
TARGET required for tunnel start HOST[:PORT] (port 80 when absent), http(s)://HOST[:PORT][/PATH], [IPv6][:PORT], or :PORT / PORT (a port of the --via host itself)
--daemon off tunnel start runs in the background and returns
--name N <via>-<local port> Name of the tunnel
--local-port N the target's port from 1024, else the first free of 8080 to 8180 Port on 127.0.0.1
--no-browser off tunnel start does not open the browser
--scheme, --path from a URL TARGET, else http (https for 443 and 8443), / Shape of the URL
--timeout S 10 Seconds to wait for ssh to listen
--json off tunnel list prints JSON

tunnel start reaches a page that only a host can reach: it opens http://127.0.0.1:8080/ for 192.168.178.200:80 as raspi sees it, and any key stops it. Right after it is up, start sends one request through the tunnel and prints ok: when the target answers, or a warn: when it cannot be reached, has not answered yet, or redirects the browser away from the tunnel. The tunnel listens on 127.0.0.1 only and needs a working ssh key for --via (send-key first). --daemon keeps it running after the terminal closes; tunnel list shows which tunnels are alive and tunnel stop ends them (with one tunnel, no argument). A started tunnel is not reconnected when it drops, and start again reuses an open one. The record is ~/.local/state/daedalus/tunnels.json.

add-vnc-launcher needs tigervnc-viewer and tigervnc-tools; --remove takes the launcher out again.

Sending keys

  • A server that only takes passwords works: ssh asks for the password itself, and daedalus never sees it.
  • Keys are written as # BEGIN daedalus gpgtools: blocks. daedalus changes only what it wrote; remote files are only appended to.
  • A key already on a server is left alone; when daedalus added it, you are asked whether to append it again.
  • After sending, a key-only test login checks that the key works.
  • When possession cannot be proven you are asked [y/N].

Extra exit codes: 17 newer block format, 18 broken block markers, 19 server too old, 20 test login failed, 21 no terminal to ask, 22 to 24 FIDO2 key problems.

Jump hosts

For a server only reachable through other machines, add --jump to any send-key, add-host, or fido2 setup-server:

daedalus yubikeytools fido2 setup-server --jump server1,server2 --alias web you@target

You must already be able to log in to the jump hosts; the key goes only to the final target. --alias and add-host write a ProxyJump line.

FIDO2 passphrase

FIDO2 key files get no passphrase, because they are useless without your YubiKey and its PIN. Add --ask-passphrase to set one.

Status

daedalus yubikeytools status                 # read-only overview
daedalus yubikeytools status --resident      # also the keys on the YubiKey (PIN)
daedalus yubikeytools status --check-hosts   # also reach each ssh config host
daedalus yubikeytools fido2 list-keys        # only your FIDO2 key files

--check-hosts never prompts. Hosts behind a jump host are skipped, and a key that needs a PIN or touch is not tried. --json prints one object; the exit code is 13 when a check fails.

The YubiKey itself

daedalus yubikeytools install-ykman      # install or update Yubico's ykman
daedalus yubikeytools status             # includes the YubiKey section
daedalus yubikeytools status --details   # everything, with the full serial

status only reads: no PIN is asked and nothing on the YubiKey changes. Reading its smart card applications resets gpg's card session, so the next ssh with the GPG key may ask for the PIN again.

Non-resident FIDO2 keys

Nothing is stored on the YubiKey; the file is the only copy, so back it up.

daedalus yubikeytools fido2 create-non-resident-key --name work
daedalus yubikeytools fido2 setup-server \
  --key-file ~/.ssh/id_ed25519_sk_daedalus_yubikey_non_resident_work --alias web you@server

Old gpgtools commands

The commands that moved still work through gpgtools, with a warning, until the next major version.

Key tools on Windows

Use Windows OpenSSH from PowerShell, not WSL, Git Bash, or Cygwin ssh. daedalus yubikeytools gpg prepare installs gnupg with winget, writes gpg-agent.conf, restarts gpg-agent, and checks ssh-add -l. It does not write sshcontrol. FIDO2 on Windows is untested.

Shell completion

Bash (and other shells argcomplete supports) completes script names and category labels: daedalus lin + TAB completes linter, daedalus dev l + TAB completes linter inside the category, and options complete after -. Run daedalus --init once to register the hook in ~/.bashrc, or in the PowerShell profile on Windows (below); see also INSTALL.

--init

daedalus --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 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 startup file writes nothing.

On POSIX the hook goes in ~/.bashrc. On Windows it goes in the PowerShell profile ($PROFILE, the one PowerShell itself reports, so a redirected Documents folder works), and it uses PowerShell's Register-ArgumentCompleter. Run it in PowerShell after uv tool install daedalus-tools; then . $PROFILE or a new window completes daedalus <Tab>.

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 (POSIX)
daedalus --init                        # register completion in the PowerShell profile
daedalus --init --dry-run              # print the block and the target, change nothing
daedalus --init --profile FILE         # a different profile (Windows)
Argument Default Meaning
--bashrc FILE ~/.bashrc Target file for the managed hook block (POSIX only)
--profile FILE $PROFILE Target file for the managed hook block (Windows only)
--dry-run off Print the block and the target, change nothing

Exit codes: 3 when register-python-argcomplete (.exe on Windows) is nowhere to be found (reinstall daedalus — argcomplete is a declared dependency); 4 on Windows when neither pwsh nor powershell answers for $PROFILE (install PowerShell or pass --profile FILE); 2 for a flag of the other platform.

If PowerShell's execution policy is Restricted, the profile will not load and --init prints the command that allows it. It does not change the policy itself.

Releasing daedalus (maintainers)

publish.py at the repository root releases the package itself. It is not a builtin script: end users never see it. Guards first (clean working tree, HEAD exactly tagged v<version>, the version not yet on PyPI, uv and twine available), then a chained uv build, then twine check. Without --upload it stops there and prints the artifacts; with --upload it uploads exactly this version's sdist and wheel. Credentials never touch the script: twine prompts or reads ~/.pypirc.

uv run python publish.py             # build + check, print next step
uv run python publish.py --upload    # ... and upload to PyPI

Exit codes: 2 not run from a checkout, 3 dirty tree, 4 not exactly tagged v<version>, 5 build/twine missing, 6 version already on PyPI (or PyPI unreachable), 7 build failed, 8 twine check failed, 9 upload failed.

Moved to daedalus-scripts

linux-security-audit is no longer a builtin. It ships in the daedalus-scripts source, which you add once and install:

daedalus source add https://gitea.nolivaldeziii.com/nvaldez/daedalus-scripts.git
daedalus install daedalus.linux-security-audit

After the install, daedalus linux-security-audit runs it as before, and daedalus daedalus.linux-security-audit always works. If you had the builtin installed, daedalus linux-security-audit exits 2 with these two commands until you install the new one. The audit's checks, output, and exit codes are unchanged; its reference is spec.md in the daedalus-scripts repository.

linter

Lints files without touching them (unless --fix). The check is all, or one of markdown, frontmatter, ruff, pycustom, json, fences, htmljs, shellcheck.

daedalus builtin.linter all ~/wiki          # every check
daedalus linter markdown notes/             # one check, one folder
daedalus linter json config.json            # one file
daedalus linter fences notes/              # ruff on the Python fences of .md files
daedalus linter htmljs web/                # HTML and JavaScript syntax
daedalus linter shellcheck scripts/        # runs the shellcheck check on the .sh files
daedalus linter ruff . --fix                # apply the ruff fixes, then lint again
daedalus linter all . --json > lint.json    # one JSON document
daedalus linter all . -q                    # failing reports and the verdict only
daedalus linter all . -n                    # for scripts and AI: no progress bars, no color

On a terminal the text report is colored (red for failures, green for passes) and a progress line per running check goes to stderr, so a long run shows it is working. Color follows NO_COLOR and FORCE_COLOR (SPEC item 3.3.6). --no-color turns color off; -n / --non-interactive turns off color and progress, and --json never has either.

Argument or flag Default Meaning
<check> required all, markdown, frontmatter, ruff, pycustom, json, fences, htmljs, or shellcheck
<path>... . Files or folders to lint
--fix off Apply the fixes the check supports (markdown, ruff, json); then lint again
--json off Print one JSON document and nothing else
--settings FILE lookup Use this settings file instead of the lookup
--exclude GLOB none Skip paths matching the glob (repeatable), relative to the target
-q, --quiet off Print only the verdict line and the reports of failing checks
--no-color off Print the text report without ANSI color
-n, --non-interactive off No progress bars and no color (for scripts and AI agents)

Exit codes: 0 clean, 1 at least one error violation (warnings do not fail), 2 usage error, missing path, unreadable settings, or a tool failure. Settings come from daedalus-lint.json, then fiona-settings.json, searched from the target folder up (SPEC item 13.23.4). The read-only folders personal/ and raw/ are never linted or fixed.

htmljs reads two settings sections: html (extensions, default ["html", "htm"]; ignore_patterns; lint_inline_js, default false, which also checks inline <script> bodies) and javascript (extensions, default ["js", "javascript"]; ignore_patterns). Its findings print as [FAIL], because they carry no rule code. HTML is parsed with html5lib and JavaScript with esprima (pure Python, so the check runs the same on Windows and Linux). fences checks fences tagged python or py with ruff's default rules and not the project's ruff config, and fences tagged bash or sh with shellcheck (--shell set to the tag). shellcheck runs the shellcheck binary from PATH on each .sh file; the binary is not a Python dependency, and a missing one exits 2 with an install hint. Its info and style findings are warnings and do not fail the run.

Sources

Scripts reach daedalus through sources (SPEC section 13). The builtin scripts above are the builtin source. Other people can publish a source, a feed of scripts, and you can install from it:

daedalus source add https://git.acme.example/daedalus-scripts.git   # register a feed
daedalus search backup                    # what the feeds offer
daedalus show acme.backup                 # the feed entry and its installed state
daedalus install acme.backup              # draft, then yes or no
daedalus acme.backup --help               # runs once installed
daedalus outdated                         # installed scripts with a newer offer
daedalus update                           # draft and update, one script at a time
daedalus verify                           # re-hash installed files; exit 1 on a mismatch
daedalus uninstall acme.backup
daedalus source remove acme               # the installed scripts stay

Installing shows a draft: the origin, the commit or sha256, the files, the Python dependencies, and the required commands. The default answer is No.

Every installed script runs by its bare name, daedalus backup, while no other installed script has that name. When two or more do, the bare name exits 2 as ambiguous, and you type the full id instead, for example daedalus acme.backup or daedalus builtin.gittools. The full id always works. The listing shows the id in place of the name for a shared name. External scripts never see daedalus's own environment.

Aliases give a long command a short name, and lockfiles reproduce an installation elsewhere:

daedalus alias bk acme.backup             # daedalus bk ... runs acme.backup
daedalus alias                            # list aliases and their status
daedalus alias --remove bk
daedalus alias --clear                    # delete every alias
daedalus export --output daedalus.lock.json
daedalus import daedalus.lock.json        # on another machine

daedalus --list shows installed scripts only, with their versions. -d adds descriptions. Publishing a source is covered in PUBLISHING.md.

Updating daedalus

daedalus --update upgrades daedalus with the tool that installed it: uv or pipx, from PyPI or Git. --dry-run prints the method and the command. A checkout is updated with git pull, and pip installs print the command to run. It does not update external scripts; daedalus update does that (SPEC item 3.15).

daedalus --update
daedalus --update --dry-run

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); bash scripts implement the shared help() interface (SPEC item 6.10).
  3. Add its entry to daedalus/builtin_feed.json and a manifest <name>.script.json with its version, add a row to the table above, write tests, bump version in pyproject.toml, and run python autotest.py.

gittools is a small example: copy its file, feed entry, manifest, README row, and tests to add your own. Unknown names exit with code 2 and suggest close matches.

S
Description
No description provided
Readme
12 MiB
0 Stars 1 Watchers 0 Forks
Languages
Python 99.5%
Go Template 0.4%