A collection of shell aliases and helpers for Git, Docker, Docker Compose, Vagrant, and Kubernetes. Source the bundle or individual files in your shell config (e.g. ~/.bashrc or ~/.zshrc).
- Bash or Zsh
- Git, Docker, Vagrant, kubectl as needed for the aliases you use
- macOS for
dkreboot(usesosascript/open);countdownis assumed to exist for that helper jqfordkstate
Load everything:
source /path/to/aliases/allLoad only specific sets:
source /path/to/aliases/.git_aliases
source /path/to/aliases/.docker_aliases
source /path/to/aliases/.vagrant
source /path/to/aliases/.kubectl
source /path/to/aliases/.generalTo load automatically, add the source line to ~/.bashrc or ~/.zshrc.
Optional private/non-committed files are also supported. The bundled all
script already auto-sources .tmp if present, so you can keep machine-local or
secret helpers outside git.
| File | Description |
|---|---|
| .git_aliases | Git: commit, push, branch, prune |
| .docker_aliases | Docker & Docker Compose |
| .vagrant | Vagrant up/ssh/halt |
| .kubectl | kubectl shortcuts |
| .general | General utilities (e.g. kill by port) |
| all | Sources all of the above |
All commit aliases support multi-line messages: pass multiple arguments and each becomes a paragraph, e.g.
gacp "feat: add login" "Implement OAuth." "Closes #123"
| Alias | Description |
|---|---|
gfc [message...] |
Stage all, commit (multi-line ok), skip hooks (--no-verify) |
gac [message...] |
Stage all and commit (multi-line ok) |
gacfile <file> |
Stage all and commit using message from file (git commit -F) |
gacfilep <file> |
Stage, commit from file, then push |
gacp [message...] |
Stage, commit, then push |
gacpb [message...] |
Stage, commit, push to origin and set upstream |
gfcpb [message...] |
Same as gacpb but with --no-verify |
gfcp [message...] |
gfc + push (no-verify) |
gp |
Pull current branch |
gfp |
Push current branch, skip hooks |
gfpb |
Push to origin, set upstream, skip hooks |
gb <branch> |
Create branch and switch to it |
gch <branch> |
Checkout branch or ref |
gchm |
Checkout default branch (master or main) |
gfpr |
Fetch all remotes and prune deleted remote-tracking branches |
gprune-local |
Fetch origin (prune), then delete every local branch that has no matching branch on origin (current branch is never deleted) |
| Alias | Description |
|---|---|
dk |
docker |
dki |
docker images |
dks |
docker service |
dkps |
docker ps with custom format (ID ~ Names ~ Status ~ Image) |
dkt |
docker stats (table: Name, CPU, Mem, NetIO) |
dkrm |
docker rm |
dkl |
docker logs |
dklf |
docker logs -f |
dkflush |
Remove all containers |
dkflush2 |
Remove dangling images |
dkln <name> |
Follow logs of container matching name (grep) |
dke <container> |
docker exec -it with /bin/sh |
dkexe <container> <cmd> |
docker exec -it with custom command |
dkreboot |
Quit and reopen Docker app (macOS), then wait ~2 min |
dkstate <container> |
Container state (requires jq) |
| Alias | Description |
|---|---|
dcu |
docker compose up |
dcud |
docker compose up -d |
dcd |
docker compose down |
dcr |
docker compose run |
dcst |
docker compose stop |
dce |
docker compose exec |
dcs |
docker compose ps --services |
dcrm |
docker compose rm |
dcre |
docker compose restart |
dcps |
docker compose ps |
dcl |
docker compose logs |
dclf |
docker compose logs -f |
dcrefresh <service> |
Stop, rm -f, up --build, then logs -f for service |
dcip <container> |
Container IP (inspect) |
dcss <service> |
Shell into service (bash if available, else sh as root) |
| Alias | Description |
|---|---|
vg |
vagrant |
vguss <name> |
vagrant up then vagrant ssh |
vgss <name> |
vagrant ssh |
vgh <name> |
vagrant halt |
| Alias | Description |
|---|---|
k |
kubectl |
kg |
kubectl get |
kgpod |
kubectl get pod |
kgall |
kubectl get --all-namespaces all |
kdp |
kubectl describe pod |
kap |
kubectl apply |
krm |
kubectl delete |
krmf |
kubectl delete -f |
kgsvc |
kubectl get service |
kgdep |
kubectl get deployments |
kl |
kubectl logs |
kei |
kubectl exec -it |
| Command | Description |
|---|---|
killport <port> |
Kill processes listening on TCP port (SIGTERM then SIGKILL; uses sudo if needed) |
Single entry script that sources (in order): .general, .vagrant, .git_aliases, .kubectl, .docker_aliases.
Use this to load the full alias set.
It also loads optional private files when they exist:
.tmpfor local non-committed aliases, exports, or experiments
That pattern is useful for machine-specific values or helper commands that should not be versioned.