You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a top-level `aliases` map to devbox.json that lets users define
shell
aliases declaratively instead of hand-writing them in the init_hook.
```json
{
"shell": {
"init_hook": "echo welcome"
},
"aliases": {
"ll": "ls -la",
"gs": "git status"
}
}
```
**In the interactive shell** (`devbox shell`), aliases are injected
after the
init hook is sourced, so they can rely on anything the hook sets up.
They use
the shell's builtin `alias` command, which is compatible across bash,
zsh, and
fish. Values are single-quoted and escaped per-shell so they are passed
verbatim.
**Via `devbox run`**, `devbox run <alias>` expands the alias to its
command and
runs it (with any extra args passed through), mirroring how a shell
expands an
alias in command position. This means aliases work without an
interactive shell
— i.e. even when the init hook hasn't defined them.
Aliases merge across included plugins and the parent config, with the
parent
overriding plugin-defined aliases (same precedence as `env`/`scripts`).
- configfile: add top-level `aliases` field + validation (no
empty/whitespace names, no empty commands)
- config: add merged `Aliases()` accessor (root overrides included)
- shell: render alias lines (sorted, escaped) into the shellrc after the
init hook
- devbox run: expand `devbox run <alias>` to the alias command
- shellrc.tmpl / shellrc_fish.tmpl: emit aliases after hooks are sourced
- schema: document the top-level `aliases` key
- examples/plugins/local: plugin defines aliases, parent overrides one
- tests: parsing, merging, plugin override (via the local example),
rendering, escaping, validation, and `devbox run <alias>`
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments