One config for every shell shortcut.
Generate aliases and functions for bash, zsh, fish, and PowerShell from a single YAML or JSONC config.
Managing shell shortcuts across multiple shells (bash, zsh, fish, PowerShell) becomes fragmented and hard to maintain. Aliases defined in .zshrc don't apply to bash, project-specific commands scatter across different files, and keeping them in sync is tedious.
shaka solves this by letting you define all your shortcuts once in a single YAML or JSONC file and generate the appropriate shell-specific output. Benefits include:
- Single source of truth for all commands
- Automatic generation for bash, zsh, fish, and PowerShell
- Project-level overrides for repository-specific commands
- Built-in PowerShell compatibility (no manual alias conflict resolution)
The example below uses zsh, but the same workflow applies to the other supported shells.
- Create a global config file at
~/.config/shaka.yaml:
dc: docker compose
gs: git status- Ask
shakato generate shell code for your shell:
shaka zshExample output:
alias dc='docker compose'
alias gs='git status'- Evaluate that output in your shell so the aliases become available in the current session:
eval "$(shaka zsh)"- Use the alias:
gsExample behavior:
$ gs
git status
On branch main
nothing to commit, working tree cleanTo make this automatic every time you open a shell, add the same eval "$(shaka zsh)" line to your shell profile.
Install the latest GitHub release with the platform installer script:
-
Linux/macOS:
curl -fsSL https://github.com/NazmusSayad/shaka/raw/main/install.sh | sh -
Windows (PowerShell):
(Invoke-WebRequest -UseBasicParsing https://github.com/NazmusSayad/shaka/raw/main/install.ps1).Content | Invoke-Expression
The installers detect OS/architecture, download the latest release archive, verify checksums, replace previous installed versions, and handle PATH guidance.
Install from the current source checkout:
cargo install --path .If shaka is published on crates.io, install it as a package:
cargo install shakaBuild and run locally during development:
cargo run -- zshshaka prints shell code to standard output:
shaka <bash|fish|pwsh|pwsh-conflict|zsh>Typical usage:
-
basheval "$(shaka bash)"
-
zsheval "$(shaka zsh)"
-
fishshaka fish | source
-
pwshInvoke-Expression (& shaka pwsh | Out-String)
If the shell argument is missing or unsupported, shaka exits with an error and prints the expected usage string.
bashfishpwshzsh
shaka loads configuration files in the following order. Later files override earlier files.
User-level configuration:
~/.config/shaka.yaml~/.config/shaka.json~/.shaka.yaml~/.shaka.json
Project-level configuration from the current directory. These files have higher priority than global configuration:
./.shaka.yaml./.shaka.json
shaka accepts either YAML or JSONC.
Map form:
dc: docker compose
gs: git statusPair-list form:
- [dc, docker compose]
- [gs, git status]JSONC form:
shaka loads global configuration first and then applies project-level configuration on top of it. In practice, this means your personal defaults can live in your home directory, while a repository can override or add commands locally without changing your global setup.
For example, you might keep this in your global config:
# ~/.config/shaka.yaml
dc: docker compose
ls: ezaThen, inside a specific project, you might define:
# ./.shaka.yaml
dc: docker compose -f dev.yml
test: cargo testWhen shaka merges these files, the project value for dc replaces the global one, while the other commands remain available. The final result behaves as if you had written:
ls: eza
dc: docker compose -f dev.yml
test: cargo testshaka outputs shell code that you evaluate in your shell profile or startup script.
For the config:
dc: docker composebash, zsh, and fish render aliases:
alias dc='docker compose'PowerShell renders functions:
Remove-Alias -Name dc -Force -ErrorAction SilentlyContinue
function dc { docker compose @args }By default, shaka pwsh removes an existing alias with the same name before defining the function. This avoids conflicts with built-in aliases.
If you want to keep built-in aliases and only emit functions, use:
Invoke-Expression (& shaka pwsh-conflict | Out-String)That renders:
function dc { docker compose @args }shaka uses Remove-Alias for cleanup in PowerShell mode.
In pwsh output mode, shaka expands environment variables inside command values before rendering functions. This is useful when your shortcuts depend on machine-specific locations such as your home directory or application install paths.
- Supported forms:
$NAMEand$env:NAME - Missing variables are left unchanged
- Expansion is only applied for
pwsh;bash,fish, andzshoutputs are unchanged
Example use case:
You want a shortcut that opens your projects directory in your editor without hardcoding your user-specific home path.
Example config:
n: $HOME/.local/bin/nodeGenerated PowerShell function:
function n { C:/User/.local/bin/node @args }This keeps the config portable while still producing a concrete command at render time. It is helpful when the command should stay the same logically, but the underlying absolute path differs from one machine to another.
{ // comments are allowed "dc": "docker compose", "gs": "git status", }