# `jan alias`
Emit shell aliases for executable `run` leaves (assumes `jan use` is already configured).
```bash
jan alias
jan alias --shell zsh -o ~/.config/jan/scripts/aliases.zsh
```
| `--jan-bin` | Program name on the RHS (default: `jan`) |
| `--shell` | Header dialect: `sh`, `bash`, or `zsh` (default: `zsh`) |
| `-o` | Write to a file instead of stdout |
Example line:
```bash
alias sum='jan scripts misc sum run'
```
Alias generation rejects names outside `[A-Za-z_][A-Za-z0-9_-]*` and shell-quotes every generated command argument independently (including `--jan-bin` and each chain segment).
Declare extra aliases on any command node with `aliases:`:
```yaml
# Extra jan names (same chain as this node's `run` or leaf exec)
last_branch:
aliases: [lb]
commands:
run:
exec:
bash: |
git branch --sort=committerdate
# Traditional shell aliases
git:
aliases:
g: git
gs: git status
lb: # empty RHS = extra jan name (if this node is a jan target)
```
`jan alias` prints jan command aliases first, then a `# shell aliases from spec` section. If a shell alias name is already a jan command alias, it is skipped with a comment. Unsafe names fail at spec load (`jan validate`).
Subcommand help (`jan scripts android --help`) lists aliases declared on that node. Children that only define `aliases:` still appear in the subcommand list (open them for their aliases). Extra jan names are shown as `same as \`jan … run\``.
## Relation to `jan config`
Keep `aliases:` and `config:` separate:
| Interactive shortcuts | `aliases:` + `jan alias` |
| Sourced env / setopt / PATH | `config.shell` + `jan config emit` |
| Files under `$HOME` | `config.link` + `jan config link` |
| Imperative tool settings | `config.apply` + `jan config apply` |
| Host tool checklist | `config.deps` + `jan config deps` |
Both hang on command nodes and both can emit a file for install to `source`, but they mean different things. See [`config.md`](config.md).