mine shell
Shell integration and enhancements including completions and aliases.
First-Time Setup
Section titled “First-Time Setup”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:
eval "$(mine shell init)"Generate Completions
Section titled “Generate Completions”mine shell completions # auto-detect shellmine shell completions zshmine shell completions bashmine shell completions fishFollow the printed instructions to source them in your shell config.
Show Recommended Aliases
Section titled “Show Recommended Aliases”mine shell aliasesOutputs:
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.
Git Shell Functions
Section titled “Git Shell Functions”The following git helper functions are included in mine shell init:
| Function | Description |
|---|---|
gc <msg> | git commit -m shorthand |
gca <msg> | git commit --amend -m shorthand |
gp | git push with upstream tracking |
gpl | git pull --rebase |
gsw <branch> | git switch shorthand |
SSH Shell Functions
Section titled “SSH Shell Functions”The following SSH helper functions are included in mine shell init:
| Function | Description |
|---|---|
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.
Env Shell Functions
Section titled “Env Shell Functions”The following env helper function is included in mine shell init:
| Function | Description |
|---|---|
menv | Load the active mine env profile into your current shell session |
Implementation details:
- Bash/Zsh: evaluates
mine env exportoutput - Fish: evaluates
mine env export --shell fishoutput - All variants return a non-zero exit code if export fails
Example:
eval "$(mine shell init)"mine env switch stagingmenvecho "$API_URL"Project Shell Functions
Section titled “Project Shell Functions”The following project helper functions are included in mine shell init:
| Function | Description |
|---|---|
p [name] | Quick project switch. With no args, opens picker. |
pp | Switch to the previously active project |
These wrappers call mine proj / mine proj open --print-path and perform the cd in your shell process.
Examples
Section titled “Examples”# Generate completions for zshmine shell completions zsh
# View recommended aliasesmine shell aliases
# Load active env profile into current shelleval "$(mine shell init)"menv