SkillAgentSearch skills...

Zpm

Zpm— Zsh Plugin Manager

Install / Use

/learn @zpm-zsh/Zpm

README

<p align="center"> <img alt="Logo" src="images/logo.svg" height="180" /> <h1 align="center">ZPM - Zsh Plugin Manager</h1> <p align="center"> Fastest, configurable and extensible zsh plugin manager </p> <p align="center"> <a href="/LICENSE"> <img alt="Software License" src="https://img.shields.io/github/license/zpm-zsh/zpm?style=flat-square"> </a> <img alt="Travis" src="https://img.shields.io/github/languages/code-size/zpm-zsh/zpm?style=flat-square"> <img alt="Go Report Card" src="https://img.shields.io/github/last-commit/zpm-zsh/zpm?logo=github&style=flat-square"> </p> </p>

Zpm is a plugin manager for ZSH who combines the imperative and declarative approach. At first run, zpm will do complex logic and generate cache, after that will be used cache only, so it makes this framework to be very fast.

<p align="center"> <img src="images/demo.gif" width="100%"> </p>

Features

  • Speed. Fastest plugin manager (Really, after the first run, zpm will not be used at all)
  • Compatibility. Zpm plugins are compatible with oh-my-zsh
  • Portability. Zpm runs on Linux, Android, OpenWrt, FreeBSD and macOS
  • Support for async loading
  • Dependencies between packages
  • Hooks
  • Function autoloading
  • Extensible
  • Possibility to use github/gitlab/bitbucket mirrors (useful for China)

Table of Contents

Stats

<details> <summary>Test on Intel I7-8750H, SanDisk SD7SN6S, 16GB RAM</summary> <p>
zsh -i -c exit  0.00s user 0.00s system 102% cpu 0.006 total
zsh -i -c exit  0.01s user 0.00s system 101% cpu 0.006 total
zsh -i -c exit  0.00s user 0.01s system 99% cpu 0.006 total
zsh -i -c exit  0.01s user 0.00s system 102% cpu 0.007 total
zsh -i -c exit  0.00s user 0.00s system 100% cpu 0.007 total
zsh -i -c exit  0.01s user 0.00s system 100% cpu 0.007 total
zsh -i -c exit  0.00s user 0.00s system 101% cpu 0.007 total
zsh -i -c exit  0.00s user 0.00s system 100% cpu 0.006 total
zsh -i -c exit  0.00s user 0.00s system 101% cpu 0.007 total
zsh -i -c exit  0.00s user 0.00s system 100% cpu 0.008 total
</p> </details> <details> <summary>Test on Raspberry Pi Zero W, Raspbian 10, 1GHz Broadcom BCM2835 ARMv6, 512MB RAM</summary> <p>
zsh -i -c exit  0.14s user 0.05s system 85% cpu 0.219 total
zsh -i -c exit  0.14s user 0.05s system 43% cpu 0.436 total
zsh -i -c exit  0.14s user 0.05s system 58% cpu 0.325 total
zsh -i -c exit  0.12s user 0.07s system 90% cpu 0.206 total
zsh -i -c exit  0.15s user 0.05s system 84% cpu 0.231 total
zsh -i -c exit  0.15s user 0.04s system 46% cpu 0.407 total
zsh -i -c exit  0.13s user 0.06s system 62% cpu 0.306 total
zsh -i -c exit  0.11s user 0.08s system 83% cpu 0.227 total
zsh -i -c exit  0.14s user 0.05s system 47% cpu 0.403 total
zsh -i -c exit  0.11s user 0.08s system 62% cpu 0.307 total
</p> </details> <details> <summary>Test on MikroTik RouterBOARD 951Ui-2HnD, OpenWrt 19.07.7, 600MHz Atheros AR9344 MIPS, 128MB RAM</summary> <p>
zsh -i -c exit  0.09s user 0.03s system 83% cpu 0.144 total
zsh -i -c exit  0.10s user 0.02s system 29% cpu 0.412 total
zsh -i -c exit  0.10s user 0.02s system 69% cpu 0.173 total
zsh -i -c exit  0.10s user 0.03s system 73% cpu 0.165 total
zsh -i -c exit  0.10s user 0.02s system 81% cpu 0.150 total
zsh -i -c exit  0.10s user 0.02s system 71% cpu 0.170 total
zsh -i -c exit  0.10s user 0.02s system 85% cpu 0.141 total
zsh -i -c exit  0.10s user 0.02s system 42% cpu 0.283 total
zsh -i -c exit  0.11s user 0.02s system 68% cpu 0.176 total
zsh -i -c exit  0.10s user 0.02s system 75% cpu 0.161 total
</p> </details> <details> <summary>With this set of plugins. 51 total</summary> <p>
zpm-zsh/helpers
zpm-zsh/colors
zpm-zsh/tmux
zpm-zsh/vte
zpm-zsh/core-config
zpm-zsh/ignored-users
zpm-zsh/check-deps
zpm-zsh/minimal-theme
zpm-zsh/material-colors
zpm-zsh/pr-is-root
zpm-zsh/pr-user
zpm-zsh/pr-return
zpm-zsh/pr-exec-time
zpm-zsh/pretty-time-zsh
zpm-zsh/pr-git
zpm-zsh/pr-cwd
zpm-zsh/pr-php
zpm-zsh/pr-rust
zpm-zsh/pr-node
zpm-zsh/pr-2
zpm-zsh/pr-eol
zpm-zsh/pr-zcalc
zpm-zsh/pr-correct
zpm-zsh/ls
zpm-zsh/colorize
zpm-zsh/ssh
zpm-zsh/dot
zpm-zsh/undollar
zpm-zsh/dropbox
lukechilds/zsh-better-npm-completion
zpm-zsh/clipboard
zpm-zsh/mysql-colorize
zpm-zsh/zshmarks
voronkovich/gitignore.plugin.zsh
zpm-zsh/autoenv
mdumitru/fancy-ctrl-z
zsh-users/zsh-history-substring-search
zdharma/fast-syntax-highlighting
zsh-users/zsh-autosuggestions
psprint/history-search-multi-word
zpm-zsh/zpm-readme
zpm-zsh/zpm-info
zpm-zsh/zpm-telemetry
zpm-zsh/zpm-link
@omz/extract
@omz/command-not-found
@omz/pip
@empty/npm
@empty/rustup
zpm-zsh/create-zsh-plugin
</p> </details>

Base dependences

Installation

Add the following text into .zshrc

if [[ ! -f ~/.zpm/zpm.zsh ]]; then
  git clone --recursive https://github.com/zpm-zsh/zpm "${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins/@zpm"
fi
source "${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins/@zpm/zpm.zsh"
# Or source our zshrc
# source "${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins/@zpm/zshrc"

If you don't have .zshrc copy example of .zshrc from zpm

ln -sf ~/.zpm/zshrc ~/.zshrc

How to use

Currently zpm has following commands

  • load - will download and load plugin See
  • if/if-not - conditions for following command See
  • upgrade - will upgrade plugin, without parameters will upgrade all plugins See
  • clean - will clean zpm cache See

The set of commands can be expanded extended using plugins

<details> <summary>Plugins for zpm itself</summary> <p>
  • zpm-readme - Show plugin readme in terminal
  • zpm-info - Show plugin info in terminal
  • zpm-telemetry - Send telemetry data. Keep calm. Data is sent using GitHub and you can see it before sending.
</p> </details>

Load plugin

Important

Be carefully, zpm doesn't guarantee loading order in call. So if you need to load a plugin before antoher, you should do 2 separate zpm load calls. This is very important for oh-my-zsh plugins, because @omz-core should be loaded before

Plugin name must have next form: @plugin-type/user/plugin-name. This plugin can be enabled using

# Add to `~/.zshrc` after zpm initialization:
zpm load @plugin-type/user/plugin-name

Notice: if you change ~/.zshrc, you need to remove zpm cache using: zpm clean

Additionaly they can have some tags. Tags must be separated by commas , without spaces, tag parameters must be separated from tag names or another tag parameters by :

# plugin type
#    |   plugin name
#    |      |     tag
#    |      |      |  tag parameters,
#    |      |      |  divided by `:`    boolean tag
#    |      |      |         |              |
#    ↓      ↓      ↓         ↓              ↓
@type/some/plugin,apply:source:path:fpath,async

Plugin name

If plugin name starts with @word, this word will be used as plugin type. Plugin name will be used to detect plugin origin url.

  • @github/ or @gh/ - plugin will be cloned from GitHub, this is default value, so you don't need to set it

  • @gitlab/ or @gl/ - plugin will be cloned from GitLab

  • @bitbucket/ or @bb/ - plugin will be cloned from Bitbucket

  • @git/ - plugin will be cloned via git. Be careful, zpm can't detect origin for this plugin type, you must specify origin using tag origin:

  • @gist/ - plugin will be downloaded from GitHub Gist

  • @omz/ - zpm will use a plugin from oh-my-zsh, oh-my-zsh will be download if not installed. Important: you shoud load @omz before any other plugin from on-my-zsh: zpm load @omz.

    • @omz/theme/ - will load a theme from omz dir: <omz-dir>/themes/*.zsh-theme

    • @omz/lib/ - will load a lib from omz dir: <omz-dir>/lib/*.zsh

    • <details> <summary> Example: </summary> <p>

      See: https://github.com/zpm-zsh/zpm/issues/24

      # Pull in OMZ (doesn't actually source anything)
      zpm load @omz
      
      # Load any OMZ libraries we want or our OMZ plugins require
      zpm load                \
        @omz/lib/compfix      \
        @omz/lib/completion   \
        @omz/lib/directories  \
        @omz/lib/functions    \
        @omz/lib/git          \
        @omz/lib/grep         \
        @omz/lib/history      \
        @omz/lib/key-bindings \
        @omz/lib/misc         \
        @omz/lib/spectrum     \
        @omz/lib/theme-and-appearance
      
        # Load some OMZ plugins and theme
        zpm load          \
          @omz/virtualenv \
          @omz/git
      
        zpm load @omz/theme/robbyrussell
      
      </p> </details>
  • @dir - special type, zpm will create a symlink to local directory from origin tag

  • @file - special type, z

View on GitHub
GitHub Stars394
CategoryDevelopment
Updated7d ago
Forks26

Languages

Shell

Security Score

100/100

Audited on Mar 26, 2026

No findings