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.
Synopsis
Section titled “Synopsis”apkg add-to-pathThe command takes no arguments or flags.
What it does
Section titled “What it does”- Creates
~/.apkg/bin/if it does not already exist. - Symlinks the current
apkgbinary into~/.apkg/bin/apkg. On Windows, the binary is copied instead. - Appends a PATH entry to your shell configuration file so that
~/.apkg/binis included in future sessions.
The line added to your shell config looks like this:
# Added by apkgexport PATH="$HOME/.apkg/bin:$PATH"For Fish shell, it uses fish_add_path instead:
# Added by apkgfish_add_path $HOME/.apkg/binShell detection
Section titled “Shell detection”The command reads the $SHELL environment variable to determine which shell you use and which configuration file to update.
| Shell | RC file | Fallback |
|---|---|---|
| Zsh | ~/.zshrc | Default on macOS if $SHELL is not set |
| Bash | ~/.bashrc | Falls 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.
Examples
Section titled “Examples”Run the command after installing apkg:
apkg add-to-pathThen activate the change in your current session:
source ~/.zshrc # or ~/.bashrc, depending on your shellOr simply open a new terminal window.
Related commands
Section titled “Related commands”| Command | Description |
|---|---|
config | Manage CLI configuration |
completions | Generate shell completion scripts for bash, zsh, or fish |