Skip to content

apkg add-to-path

The add-to-path command configures your shell so that apkg is available from any terminal session. It creates a symlink in ~/.apkg/bin/ and appends a PATH export to your shell configuration file. This is useful after a first-time install or when the binary is not yet on your PATH.

The command is idempotent — it is safe to run multiple times. It will skip any step that has already been completed.

Terminal window
apkg add-to-path

The command takes no arguments or flags.

  1. Creates ~/.apkg/bin/ if it does not already exist.
  2. Symlinks the current apkg binary into ~/.apkg/bin/apkg. On Windows, the binary is copied instead.
  3. Appends a PATH entry to your shell configuration file so that ~/.apkg/bin is included in future sessions.

The line added to your shell config looks like this:

Terminal window
# Added by apkg
export PATH="$HOME/.apkg/bin:$PATH"

For Fish shell, it uses fish_add_path instead:

Terminal window
# Added by apkg
fish_add_path $HOME/.apkg/bin

The command reads the $SHELL environment variable to determine which shell you use and which configuration file to update.

ShellRC fileFallback
Zsh~/.zshrcDefault on macOS if $SHELL is not set
Bash~/.bashrcFalls back to ~/.bash_profile, then ~/.profile
Fish~/.config/fish/config.fish

If the $SHELL variable is not set, the command defaults to Zsh on macOS and Bash on Linux.

Run the command after installing apkg:

Terminal window
apkg add-to-path

Then activate the change in your current session:

Terminal window
source ~/.zshrc # or ~/.bashrc, depending on your shell

Or simply open a new terminal window.

CommandDescription
configManage CLI configuration
completionsGenerate shell completion scripts for bash, zsh, or fish