Hako
How-to Guides

How to Set Up Shell Integration

Enable hako cd and hako env apply in your shell.

Shell integration enables hako cd and hako env apply, which modify your current shell session (change directory, export environment variables).

Assumptions

You have hako installed and want to use commands that affect your current shell.

Setup

Add one of the following to your shell configuration file.

Bash (~/.bashrc):

eval "$(hako init bash)"

Zsh (~/.zshrc):

eval "$(hako init zsh)"

Fish (~/.config/fish/config.fish):

hako init fish | source

Or auto-install (detects shell from $SHELL, idempotent):

hako init --install

Commands That Require Integration

After setup, you can use:

# Change directory to a worktree
hako cd feature-auth

# Change directory and load .env.hako variables
hako cd feature-auth --env

# Export .env.hako variables into current shell
hako env apply feature-auth

Without shell integration, these commands print a hint and exit with an error.

All commands that accept [branch] can infer it from your current directory if you are inside a worktree.

For the full list of CLI commands, see the CLI reference.

ops.origin: Masakiro Corp.

On this page