Skip to content

mine shell

Shell integration and enhancements including completions and aliases.

The easiest way to activate shell helpers (p, pp, menv) is to run mine init — it detects your shell, shows the eval line, and offers to write it to your RC file automatically.

For manual setup or subsequent machines, add this to your shell config:

Terminal window
eval "$(mine shell init)"
Terminal window
mine shell completions # auto-detect shell
mine shell completions zsh
mine shell completions bash
mine shell completions fish

Follow the printed instructions to source them in your shell config.

Terminal window
mine shell aliases

Outputs:

Terminal window
alias m='mine'
alias mt='mine todo'
alias mta='mine todo add'
alias mtd='mine todo done'
alias md='mine dig'
alias mc='mine craft'
alias ms='mine stash'
alias mx='mine tmux'
alias mg='mine git'

Add these to your ~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish.

The following git helper functions are included in mine shell init:

FunctionDescription
gc <msg>git commit -m shorthand
gca <msg>git commit --amend -m shorthand
gpgit push with upstream tracking
gplgit pull --rebase
gsw <branch>git switch shorthand

The following SSH helper functions are included in mine shell init:

FunctionDescription
sc <alias>Quick connect: ssh <alias>
scp2 <src> <dest>Resumable copy: rsync -avzP --partial over SSH
stun <alias> <L:R>Quick tunnel shorthand
skey [file]Copy default public key to clipboard

All functions include --help for usage documentation and work in bash, zsh, and fish.

The following env helper function is included in mine shell init:

FunctionDescription
menvLoad the active mine env profile into your current shell session

Implementation details:

  • Bash/Zsh: evaluates mine env export output
  • Fish: evaluates mine env export --shell fish output
  • All variants return a non-zero exit code if export fails

Example:

Terminal window
eval "$(mine shell init)"
mine env switch staging
menv
echo "$API_URL"

The following project helper functions are included in mine shell init:

FunctionDescription
p [name]Quick project switch. With no args, opens picker.
ppSwitch to the previously active project

These wrappers call mine proj / mine proj open --print-path and perform the cd in your shell process.

Terminal window
# Generate completions for zsh
mine shell completions zsh
# View recommended aliases
mine shell aliases
# Load active env profile into current shell
eval "$(mine shell init)"
menv