Shell
Shell environment variables and utility functions sourced by .zshrc.
Location
| File | Symlinked to | Description |
|---|---|---|
config/shell/env.sh | ~/.config/dotfiles/env.sh | Environment variables |
config/shell/functions.sh | ~/.config/dotfiles/functions.sh | Utility functions |
env.sh
Defines environment variables for optional integrations. Machine-specific values go in ~/.config/dotfiles/env.local.sh, which is not tracked by git.
| Variable | Set when | Purpose |
|---|---|---|
OPENCODE_CONFIG | ~/.config/opencode/opencode.local.json exists | Loads the untracked OpenCode provider override on top of the placeholder opencode.json |
WARNING
Do not export API keys or tokens from env.local.sh: every process started from the shell inherits them, AI agents included, which bypasses their file-level secret rules. Give each secret only to the tool that needs it (for example, VS Code prompts for the Context7 key, see VS Code).
functions.sh
Color constants and utility functions available in every interactive shell session.
Color constants
| Variable | Color |
|---|---|
COLOR_OFF | Reset |
COLOR_BLUE | Blue |
COLOR_RED | Red |
COLOR_GREEN | Green |
COLOR_YELLOW | Yellow |
Functions
lsfn
List all available utility functions with their help text.
lsfnb64d
Decode a base64 string.
b64d <string>b64e
Encode a string to base64.
b64e <string>browser
Launch the browsh terminal web browser via Docker.
browser # open browser
browser -- <url> # open on a specific URLcheat_glow
Render a cheat sheet through glow for better readability.
cheat_glow <sheet>
# Aliased as: cs <sheet>check_cert
Print TLS certificate details for a domain.
check_cert <url>dks
Decode all values of a Kubernetes secret (base64 → plaintext).
dks <secret-name> [namespace]kbp
Kill the process listening on a given port.
kbp <port>randompass
Generate a random password containing uppercase, lowercase, digits, and special characters.
randompass [length] # default length: 24timestampd
Convert a Unix timestamp to a human-readable date.
timestampd <timestamp>timestampe
Convert a human-readable date to a Unix timestamp.
timestampe <date> # format: YYYY-mm-ddTHH:MM:ss or YYYY-mm-ddvpn
Manage WireGuard VPN tunnels through wg-quick. Shortcut aliases vup, vdown and vpns map to the up, down and status subcommands.
vpn up <tunnel> # bring a tunnel up (sudo wg-quick up)
vpn down <tunnel> # bring a tunnel down (sudo wg-quick down)
vpn status [tunnel] # show active tunnels (sudo wg show)
vpn list # list available tunnel configs