Shell aliases
Short commands for interactive shells – git (gitp, gitcm "…"), systemd and logs, files, Docker and iac. Override or switch them off in /etc/iac/aliases.local.conf, or share your own list across guests with aliases_url. List: aliases
Add to a guest
In the guest as root – container and VM alike:
update --add-modules aliasesRuns a normal update and installs the module on the way.
From the Proxmox node, without logging in:
pct exec <ID> -- update --add-modules aliases # container
ssh root@<IP> update --add-modules aliasesChoose when creating a guest
Without a dialog, on the Proxmox node:
IAC_NONINTERACTIVE=1 var_modules=auto-update,aliases \
bash -c "$(curl -fsSL https://haypack.dev/<app>/ct.sh)"var_modules replaces the app's preselection – keep auto-update in the list if you want it. Interactive: choose “advanced” in the dialog, or tick the module in the generator on the app page.
Remove
update --remove-modules aliasesRemoves the module's packages, services, firewall rules and configuration again. Data stays.
Details
Short commands for interactive shells – SSH, tmux, the terminals of a web app. iac brings a set for Git, systemd, files, Docker and iac; you override them, switch them off or add your own, per guest or for all guests at once. Scripts and coding agents do not see them.
The aliases of iac
| Alias | Command | Alias | Command |
|---|---|---|---|
gits | git status | sst | systemctl status |
gitp | git push | sre | systemctl restart |
gitpl | git pull | sfa | systemctl --failed |
gita | git add | jf | journalctl -f -u |
gitcm | git commit -m | jl | journalctl -n 100 --no-pager -u |
gitca | git commit --amend | ll | ls -lah |
gitd | git diff | la | ls -A |
gitl | git log --oneline --graph -20 | .. / ... | cd .. / cd ../.. |
gitco | git checkout | df | df -h |
gitb | git branch | du1 | du -h -d1 |
dps | docker ps -a | up | update |
dlog | docker logs -f | smoke | the smoke test of the guest |
dex | docker exec -it |
Arguments go after the alias: gitcm "Fix the login", jf nginx.
Your own aliases
/etc/iac/aliases.local.conf is yours – iac creates it once and never changes it. One alias per
line:
gitp = git push --follow-tags # overrides the alias of iac
k = kubectl # a new one
up = # switches an alias of iac off
It applies in the next shell; update is not needed. aliases lists every active alias with the
file it comes from, aliases --check the lines that are skipped.
The same aliases on every guest
Put your list (same format) in a file anyone with the link may read, e.g. a Git repository, and
set its address – then run update:
aliases_url=https://git.example.org/me/dotfiles/raw/branch/main/aliases.conf
Every update fetches it again; when it is not reachable, the last fetched list stays. Order:
the aliases of iac, then the list of aliases_url, then aliases.local.conf – the last one
wins.
Safety
The files are read line by line as name = command, never run as a script, so a broken line
does nothing at login. But an alias decides what a command does when you type it: whoever can
change the file of aliases_url can make ll run anything as root. Use a URL only from a
repository you control, over HTTPS (iac fetches nothing else).
Removing the module
update --remove-modules aliases removes the aliases of iac, the fetched list and the line in
/etc/bash.bashrc; /etc/iac/aliases.local.conf stays.
Kurzbefehle für interaktive Shells – SSH, tmux, die Terminals einer Web-App. iac bringt einen Satz für Git, systemd, Dateien, Docker und iac mit; sie lassen sich überschreiben, abschalten oder ergänzen, pro Gast oder für alle Gäste auf einmal. Skripte und Coding-Agenten sehen sie nicht.
Die Aliasse von iac
| Alias | Befehl | Alias | Befehl |
|---|---|---|---|
gits | git status | sst | systemctl status |
gitp | git push | sre | systemctl restart |
gitpl | git pull | sfa | systemctl --failed |
gita | git add | jf | journalctl -f -u |
gitcm | git commit -m | jl | journalctl -n 100 --no-pager -u |
gitca | git commit --amend | ll | ls -lah |
gitd | git diff | la | ls -A |
gitl | git log --oneline --graph -20 | .. / ... | cd .. / cd ../.. |
gitco | git checkout | df | df -h |
gitb | git branch | du1 | du -h -d1 |
dps | docker ps -a | up | update |
dlog | docker logs -f | smoke | der Smoke-Test des Gasts |
dex | docker exec -it |
Argumente folgen dem Alias: gitcm "Fix the login", jf nginx.
Eigene Aliasse
/etc/iac/aliases.local.conf gehört dem Admin – iac legt die Datei einmal an und ändert sie nie.
Ein Alias pro Zeile:
gitp = git push --follow-tags # überschreibt den Alias von iac
k = kubectl # ein neuer
up = # schaltet einen Alias von iac ab
Das gilt in der nächsten Shell; update ist nicht nötig. aliases listet jeden aktiven Alias
mit der Datei, aus der er stammt, aliases --check die Zeilen, die übersprungen werden.
Dieselben Aliasse auf jedem Gast
Die eigene Liste (gleiches Format) in eine Datei legen, die jeder mit dem Link lesen darf, etwa in
einem Git-Repository, und ihre Adresse setzen – danach update:
aliases_url=https://git.example.org/me/dotfiles/raw/branch/main/aliases.conf
Jedes update holt sie neu; ist sie nicht erreichbar, bleibt die zuletzt geholte Liste.
Reihenfolge: die Aliasse von iac, dann die Liste von aliases_url, dann aliases.local.conf –
die letzte gewinnt.
Sicherheit
Die Dateien werden Zeile für Zeile als name = befehl gelesen, nie als Skript ausgeführt – eine
kaputte Zeile richtet beim Anmelden nichts an. Ein Alias bestimmt aber, was ein eingetippter
Befehl tut: Wer die Datei hinter aliases_url ändern kann, kann ll als root beliebiges ausführen
lassen. Nur eine URL aus einem selbst kontrollierten Repository verwenden, über HTTPS (iac holt
nichts anderes).
Modul entfernen
update --remove-modules aliases entfernt die Aliasse von iac, die geholte Liste und die Zeile in
/etc/bash.bashrc; /etc/iac/aliases.local.conf bleibt.