> For the complete documentation index, see [llms.txt](https://docs.monarchlinux.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.monarchlinux.com/basics/shell-aliases.md).

# Shell aliases and functions

Monarch provides shared aliases and functions for Bash and Zsh. They shorten common commands and expose useful workflows in the terminal.

## Choose a topic

* [Navigation and Git](https://docs.monarchlinux.com/basics/shell-aliases/navigation-and-git.md): files, directories, Git and the clipboard.
* [Conversions and encodings](https://docs.monarchlinux.com/basics/shell-aliases/conversions-and-encodings.md): Base64, URL components, hex, UTF-16 and NT hashes.
* [Python and uv](https://docs.monarchlinux.com/basics/shell-aliases/python-and-uv.md): virtual environments and script execution.
* [Network and pentest](https://docs.monarchlinux.com/basics/shell-aliases/network-and-pentest.md): listening ports, HTTP helpers and ffuf results.
* [Docker](https://docs.monarchlinux.com/basics/shell-aliases/docker.md): container selection, execution and cleanup precautions.

## Discover commands

Press **Alt+M** in your terminal to open the command picker. Search by name or description, then select an entry to insert it at the cursor. Selection does not execute the command: inspect or complete it before pressing Enter.

The picker includes Monarch commands, shipped shell helpers and your loaded aliases and functions. Your own helpers remain visible even without a packaged description. Use `monarch commands` to browse Monarch's CLI commands separately.

To inspect a definition, run `alias <name>` for an alias or `typeset -f <name>` for a function. Both are callable by name in your shell. Some helpers load only when their backing tool is available, so definitions can differ between systems. These pages explain workflows, not an exhaustive catalog of every shortcut.

## Add your own aliases and functions

Put personal definitions **after** the Monarch defaults in `~/.zshrc` or `~/.bashrc`. Do not modify packaged files under `/usr/share/monarch`: package updates replace them.

```bash
alias my-status='git status --short --branch'

my-project() {
  builtin cd "$HOME/Work/my-project"
}
```

For a separate personal file, create it first, then source it near the end of your shell startup file:

```bash
source "$HOME/.config/monarch/shell/personal.sh"
```

Open a new terminal to load changes. When replacing an alias with a function, remove the alias before defining the function:

```bash
unalias my-status 2>/dev/null || true
my-status() {
  git status --short --branch "$@"
}
```

Your loaded helpers are available through Alt+M. Monarch's short shipped descriptions remain maintained alongside its source code.
