poetry.plugin.zsh
1269 bytes
1alias pad='poetry add'
2alias pbld='poetry build'
3alias pch='poetry check'
4alias pcmd='poetry list'
5alias pconf='poetry config --list'
6alias pexp='poetry export --without-hashes > requirements.txt'
7alias pin='poetry init'
8alias pinst='poetry install'
9alias plck='poetry lock'
10alias pnew='poetry new'
11alias ppath='poetry env info --path'
12alias pplug='poetry self show plugins'
13alias ppub='poetry publish'
14alias prm='poetry remove'
15alias prun='poetry run'
16alias psad='poetry self add'
17alias psh='poetry shell'
18alias pshw='poetry show'
19alias pslt='poetry show --latest'
20alias psup='poetry self update'
21alias psync='poetry install --sync'
22alias ptree='poetry show --tree'
23alias pup='poetry update'
24alias pvinf='poetry env info'
25alias pvoff='poetry config virtualenvs.create false'
26alias pvrm='poetry env remove'
27alias pvu='poetry env use'
28
29# Return immediately if poetry is not found
30if (( ! $+commands[poetry] )); then
31 return
32fi
33
34# If the completion file doesn't exist yet, we need to autoload it and
35# bind it to `poetry`. Otherwise, compinit will have already done that.
36if [[ ! -f "$ZSH_CACHE_DIR/completions/_poetry" ]]; then
37 typeset -g -A _comps
38 autoload -Uz _poetry
39 _comps[poetry]=_poetry
40fi
41
42poetry completions zsh >| "$ZSH_CACHE_DIR/completions/_poetry" &|