Skip to main content
For developers running Atomic on macOS, Linux, or Windows Subsystem for Linux (WSL), this guide shows how to load Bash or Zsh shell aliases inside Atomic’s bash tool and interactive ! commands. Atomic runs Bash in non-interactive mode (bash -c), which doesn’t expand aliases by default. On native Windows, leave shellCommandPrefix unset and see Run Atomic on Windows.

Before you begin

Before you configure shell aliases, confirm the following:
  • You run Atomic on macOS, Linux, or WSL with Bash available.
  • Your shell aliases live in a startup file such as ~/.zshrc or ~/.bashrc.

Configure shellCommandPrefix

Follow these steps to load your aliases before each Bash command and confirm they expand:
1

Add shellCommandPrefix to settings.json

Open ~/.atomic/agent/settings.json (or a trusted project’s .atomic/settings.json; project settings replace the global value, and Atomic also reads legacy ~/.pi/agent/settings.json) and add shellCommandPrefix:
Replace the following:
  • SHELL_PROFILE_PATH: the shell startup file containing your alias definitions, such as ~/.zshrc or ~/.bashrc.
2

Reload settings

Inside Atomic, run /reload (or restart Atomic) so the updated shellCommandPrefix applies.
3

Confirm that aliases expand

Run !alias inside Atomic and confirm that your aliases appear in the output without errors or extra printed lines.

Scope and caveats

Don’t set shellCommandPrefix on native Windows unless you intentionally disable one shell side (for example, by excluding bash). On native Windows, Atomic prepends shellCommandPrefix to both model bash tool calls (which run in Bash) and interactive ! and !! commands (which run in PowerShell), while the model powershell tool ignores it. Because Bash and PowerShell use incompatible syntax, PowerShell syntax breaks every model bash call and Bash syntax breaks every ! and !! command. Inside WSL, both run in Bash, so Bash syntax works for both.
Keep the following limits in mind when using shellCommandPrefix:
  • Applies to model and interactive shell commands: Atomic prepends shellCommandPrefix followed by a newline (<prefix>\n<command>) to every model bash tool call and every interactive ! and !! command.
  • Keep the prefix silent and error-free: Any syntax error, set -e failure, or exit inside shellCommandPrefix stops every shell command from running. Any text printed to stdout by the prefix appears at the top of every command output returned to the model.
  • grep '^alias ' and Bash syntax limits: grep '^alias ' ~/.zshrc imports only single-line alias definitions starting at column 0. It skips shell functions, exported environment variables, indented or conditional aliases, and Zsh-only syntax such as alias -g or alias -s (which fails in Bash). Because shopt -s expand_aliases is Bash-specific, it also fails if no bash binary exists on a Unix system and Atomic falls back to /bin/sh.
  • Blueprint worktrees: When resuming inside a blueprint worktree that sets $ENVRC, Atomic appends the blueprint environment setup after shellCommandPrefix.

Troubleshooting

Use the following checks if shell commands fail after setting shellCommandPrefix:
  • Every shell command exits immediately with a syntax error: Remove Zsh-only alias flags (alias -g, alias -s) from the lines matched by grep '^alias ', or put Atomic-safe aliases in a dedicated file such as ~/.atomic-aliases and source it directly (shopt -s expand_aliases\nsource ~/.atomic-aliases).
  • Unexpected text appears before every command output: Silence any commands inside shellCommandPrefix by redirecting stdout (>/dev/null).
  • Interactive ! commands fail on native Windows: Remove shellCommandPrefix from settings.json on native Windows.

Next steps

Explore related shell configuration guides: