Shell Integration
The shell hook is optional. Without it, aisw use still writes live tool credential files and updates ~/.aisw/config.json. The hook adds one capability: applying the emitted environment variable exports (CLAUDE_CONFIG_DIR, CODEX_HOME) into the current shell session.
Install
Section titled “Install”Add to ~/.zshrc:
eval "$(aisw shell-hook zsh)"Then reload:
source ~/.zshrcAdd to ~/.bashrc (interactive shells) or ~/.bash_profile:
eval "$(aisw shell-hook bash)"Then reload:
source ~/.bashrcAdd to ~/.config/fish/config.fish:
aisw shell-hook fish | sourceOr as a standalone file:
aisw shell-hook fish > ~/.config/fish/conf.d/aisw.fishVerify
Section titled “Verify”echo "$AISW_SHELL_HOOK"# Expected: 1What the hook does
Section titled “What the hook does”The hook wraps the aisw function in your shell. When you run aisw use ..., the hook:
- Runs
aisw use ... --emit-envto write the credential files and printexport VAR=valuelines to stdout. - Evals those exports in the current shell, so
CLAUDE_CONFIG_DIRandCODEX_HOMEare set immediately. - Passes all other
aiswsubcommands through to the binary unchanged.
Without the hook, you can achieve the same effect manually:
eval "$(aisw use claude work --emit-env)"Remove
Section titled “Remove”Remove the eval line from your shell config and open a new shell.
To remove hook blocks that aisw init or aisw shell-hook added:
aisw uninstall --dry-run # previewaisw uninstall --yes # applyShell completions
Section titled “Shell completions”aisw ships completion scripts for bash, zsh, and fish. They are installed automatically by the Homebrew formula and shell installer.
Installed locations
Section titled “Installed locations”| Shell | Path |
|---|---|
| bash | ~/.local/share/bash-completion/completions/aisw |
| zsh | Writable fpath entry, or ~/.zsh/completions/_aisw |
| fish | ~/.config/fish/completions/aisw.fish |
Manual install from source
Section titled “Manual install from source”cargo build --release
install -Dm644 completions/aisw.bash \ ~/.local/share/bash-completion/completions/aisw
install -Dm644 completions/_aisw \ ~/.zsh/completions/_aisw
install -Dm644 completions/aisw.fish \ ~/.config/fish/completions/aisw.fishFor zsh, ensure the completion directory is in your fpath:
fpath=(~/.zsh/completions $fpath)autoload -U compinit && compinit