Skip to content

Scripts

Scripts are executable text files placed on your PATH. Unlike managed binaries, they are not downloaded: a shipped script is written out from the binary, and one of yours is symlinked from wherever you keep it.

scripts:
- name: csf
source: builtin
- name: tmux-session
source: builtin
- name: deploy
source: ~/dev/scripts/deploy.sh
Terminal window
loadout bin install # installs declared scripts alongside binaries
loadout bin list # shows both, and where each came from
ScriptWhat it does
csfCreate a new shell script in the current directory, executable and with the interpreter line already there
sshpList the SSH private keys it can find, identifying them by content rather than by filename
tmux-sessionCreate or attach a named tmux session, used by the workspace aliases

Declare them with source: builtin. They are embedded in the binary, so there is nothing to fetch and nothing to keep in sync.

sshp is worth a note, because it is the clearest example of a portability trap this project hit. It originally used find -regex, whose flavour differs between GNU and BSD, and it matched only *rsa and *.pem — which silently skipped every ed25519 key. It is now POSIX sh with a shell loop that identifies a private key by looking at its contents.

scripts:
- name: deploy
source: ~/dev/scripts/deploy.sh

The file stays where it lives. loadout symlinks it into the managed bin directory under the name you gave, so editing the original takes effect immediately with nothing to reinstall, and the script remains in whatever repository already versions it.

The name is what you type; it does not have to match the filename. A source that does not exist is reported by doctor rather than silently producing a dead link.

They look similar — both end up executable on PATH — but they need entirely different handling:

ScriptsBinaries
OriginText you or loadout authoredDownloaded release artefact
PlatformIndependentOne artefact per platform
VersioningIn whatever repository holds itPinned in your configuration
VerificationNot applicableChecksum before install
InstallSymlink or write outFetch, verify, extract, rename

Conflating them is what leads to committed binaries. Keeping them apart is what let this project replace 61MB of executables with a few lines of YAML while still keeping the hand-written helpers.

Same rule as binaries: the managed directory is appended, so a script of yours named git will not shadow the real one. Name things distinctly rather than relying on ordering.