Workflow for setting up CLI tools and ensuring they are automatically available in new GitHub Codespaces sessions.
- GitHub Codespaces environment
- zsh shell (default in Codespaces)
curl -fsSL https://bun.sh/install | bashAdd this configuration to automatically detect common CLI tool installation directories:
cat >> ~/.zshrc << 'ZSHCONFIG'
# ============================================
# Universal CLI Tools PATH Configuration
# Automatically includes common installation directories
# ============================================
# Bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# Common user-local binary directories
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
# Language-specific package managers
export PATH="$HOME/.cargo/bin:$PATH" # Rust/Cargo
export PATH="$HOME/go/bin:$PATH" # Go
export PATH="$HOME/.deno/bin:$PATH" # Deno
export PATH="$HOME/.npm-global/bin:$PATH" # npm global (if configured)
# Cloud CLIs
export PATH="$HOME/.local/bin:$PATH" # pip/pipx installs (AWS CLI, etc.)
# Auto-source any tool-specific configs if they exist
[[ -f "$HOME/.cargo/env" ]] && source "$HOME/.cargo/env"
[[ -f "$HOME/.ghcup/env" ]] && source "$HOME/.ghcup/env" # Haskell
# Function to add a directory to PATH if it exists
add_to_path() {
[[ -d "$1" ]] && export PATH="$1:$PATH"
}
# Scan for common tool installation patterns
add_to_path "$HOME/.yarn/bin"
add_to_path "$HOME/.config/yarn/global/node_modules/.bin"
add_to_path "$HOME/.pnpm-global/bin"
add_to_path "$HOME/.volta/bin"
add_to_path "$HOME/.fnm"
add_to_path "$HOME/.asdf/bin"
add_to_path "$HOME/.sdkman/candidates/java/current/bin"
add_to_path "$HOME/.pyenv/bin"
add_to_path "$HOME/.rbenv/bin"
ZSHCONFIGsource ~/.zshrcbun installcurl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip && sudo ./aws/install
rm -rf awscliv2.zip aws/curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.zshrc# Install via apt or download from golang.org
sudo apt-get update && sudo apt-get install -y golang-gocurl -fsSL https://deno.land/install.sh | sh
source ~/.zshrctype -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt install gh -yThe PATH configuration automatically detects tools installed in:
| Tool Category | Installation Path |
|---|---|
| Bun | ~/.bun/bin |
| Rust/Cargo | ~/.cargo/bin |
| Go | ~/go/bin |
| Deno | ~/.deno/bin |
| AWS CLI (pip) | ~/.local/bin |
| npm global | ~/.npm-global/bin |
| Yarn | ~/.yarn/bin |
| pnpm | ~/.pnpm-global/bin |
| Volta | ~/.volta/bin |
| fnm | ~/.fnm |
| asdf | ~/.asdf/bin |
| SDKMAN (Java) | ~/.sdkman/candidates/java/current/bin |
| pyenv | ~/.pyenv/bin |
| rbenv | ~/.rbenv/bin |
After setup, verify tools are available:
bun --version
node --version
# Add other tools as needed
aws --versionKilo Code executes commands via /bin/sh, which doesn't source shell configuration files like ~/.zshrc or ~/.bashrc. To make CLI tools available to Kilo Code, create symlinks in /usr/local/bin:
sudo ln -sf ~/.bun/bin/bun /usr/local/bin/bun
sudo ln -sf ~/.bun/bin/bunx /usr/local/bin/bunxsudo ln -sf ~/.deno/bin/deno /usr/local/bin/deno# Example for a cargo-installed tool like 'ripgrep'
sudo ln -sf ~/.cargo/bin/rg /usr/local/bin/rg# For any tool installed in a user directory:
sudo ln -sf /home/codespace/.tool/bin/toolname /usr/local/bin/toolnameAfter creating symlinks, verify Kilo Code can access the tools by running:
which bun && bun --versionThis should work in any shell, including /bin/sh.
- New terminal sessions will automatically have all configured paths
- Tools installed to standard locations will be auto-detected
- For tools with custom install locations, add them using
add_to_path "/custom/path" - The devcontainer.json in the project can also pre-install tools for team consistency
- For Kilo Code access: Always create symlinks in
/usr/local/binfor tools installed in user directories