Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 2.06 KB

File metadata and controls

54 lines (40 loc) · 2.06 KB

Dotfiles and Shell Customization

Dotfiles Support

You can optionally mount your dotfiles directory and have them auto-linked into $HOME at container startup:

volumes:
  - ${HOME}/.config/agent-sandbox/dotfiles:/home/dev/.dotfiles:ro

The entrypoint recursively walks /home/dev/.dotfiles and creates symlinks for each file at the corresponding $HOME path. Intermediate directories are created as needed.

For example, if your dotfiles contain:

.dotfiles/
  .zshrc
  .gitconfig
  .claude/
    CLAUDE.md
    settings.json
  .config/
    git/config
    starship.toml

The container will have:

  • ~/.zshrc -> ~/.dotfiles/.zshrc
  • ~/.gitconfig -> ~/.dotfiles/.gitconfig
  • ~/.claude/CLAUDE.md -> ~/.dotfiles/.claude/CLAUDE.md
  • ~/.claude/settings.json -> ~/.dotfiles/.claude/settings.json
  • ~/.config/git/config -> ~/.dotfiles/.config/git/config
  • ~/.config/starship.toml -> ~/.dotfiles/.config/starship.toml

Docker bind mounts (like individually mounted CLAUDE.md) take precedence over dotfile symlinks.

If you mount ~/.gitconfig this way, it augments the base image's system git config in /usr/local/etc/gitconfig rather than replacing it. That preserves built-in settings such as SSH-to-HTTPS rewriting and worktree.useRelativePaths=true.

Shell Customization

You can also optionally mount scripts from ~/.config/agent-sandbox/shell.d/ to customize your shell environment. Any *.sh files are sourced when zsh starts.

mkdir -p ~/.config/agent-sandbox/shell.d

cat > ~/.config/agent-sandbox/shell.d/my-aliases.sh << 'EOF'
alias ll='ls -la'
alias gs='git status'
EOF

agentbox init includes volume mounts for dotfiles and shell customizations as commented-out entries in the generated compose file. Uncomment them to enable, or set AGENTBOX_ENABLE_DOTFILES=true and AGENTBOX_ENABLE_SHELL_CUSTOMIZATIONS=true before running init.

shell.d scripts are sourced from the system-level zshrc (/etc/zsh/zshrc), which runs before ~/.zshrc. This means your dotfiles can include a custom .zshrc without breaking this integration.