Skip to main content

⚡️ Installation

Quick setup

Add the following snippet in the .zshrc file:

~/.zshrc
source <(curl -sL git.io/zi-loader); zzinit

Reload shell with exec zsh and run zi -h for usage information.

Automated setup

tip
  • Verify the sha256 checksum for file: lib/sh/install.sh
  • If required append -b <tag> or -b <branch> e.g:
sh -c "$(curl -fsSL git.io/get-zi)" -- -i skip -b main

Install and include minimal configuration to the .zshrc:

sh -c "$(curl -fsSL git.io/get-zi)" --

Manual Setup

Set up install location and create a directory:

typeset -Ag ZI
typeset -gx ZI[HOME_DIR]="${HOME}/.zi" ZI[BIN_DIR]="${ZI[HOME_DIR]}/bin"
command mkdir -p "$ZI[BIN_DIR]"

For security reasons run function compaudit to check if the completion system would use files owned by root or by the current user, or files in directories that are world or group-writable.

If failed, then set the current user as the owner of directories, then remove group/others write permissions, and clone the repository:

compaudit | xargs chown -R "$(whoami)" "$ZI[HOME_DIR]"
compaudit | xargs chmod -R go-w "$ZI[HOME_DIR]"
command git clone https://github.com/z-shell/zi.git "$ZI[BIN_DIR]"

To enable Zi, source the zi.zsh from the previously set up directory placing the following snippet in the .zshrc file:

~/.zshrc
typeset -A ZI
ZI[BIN_DIR]="${HOME}/.zi/bin"
source "${ZI[BIN_DIR]}/zi.zsh"
caution

The two lines below must be placed after the lines above, i.e. after enabling Zi.

Enable Zi completions:

~/.zshrc
autoload -Uz _zi
(( ${+_comps} )) && _comps[zi]=_zi

Post-install

After a fresh install, recommended to reload the shell with exec zsh and compile Zi with zi self-update. Run zi -h to see all available commands. Increase Zi functionality, and performance, or get started by exploring the wiki.

If you have any issue or need help 🤦‍♂️, lets discuss it or open an issue in any language.

It helps us to improve and make Zi better. Don't forget to help the project: share, contribute, or translate 🌐 🥰 🤓.

Let's glue everything together to create a toolchain that works for us 🚀.

Have ideas?

 Suggest or request at playground

sh -c "$(curl -fsSL git.io/get-zi)" -- -a ???

 Need warm-up?

 Docker Alpine

docker run --rm -it ghcr.io/z-shell/zd:latest

Turbo Zi in Docker

If you create a Docker image that uses Zi, install Turbo-loaded plugins before the shell starts interactively, with the @zi-scheduler function in such a way, that it:

  • Install plugins without waiting for the prompt (i.e. it's script friendly).
  • Install all plugins instantly, without respecting the wait argument.

To accomplish this, use burst argument and call the @zi-scheduler function:

RUN zsh -i -c -- '@zi-scheduler burst || true'

Zi Module: zpmod

info

Usage:

zi module {build|info|help} [options]
zi module build [--clean]
zi module info [--link]
  • To start using the Zi Zsh module run: zi module build. Append --clean to run make distclean.
  • To display the instructions on loading the module, run: zi module info.
  • To enable debug messages from the module set:
typeset -g ZI_MOD_DEBUG=1

Status page

Installer

ServiceURL
Redirecthttps://get.zshell.dev
IPFShttps://ipfs.zshell.dev/sh/install.sh
Directhttps://raw.githubusercontent.com/z-shell/zi-src/main/lib/sh/install.sh

Loader

ServiceURL
Redirecthttps://init.zshell.dev
IPFShttps://ipfs.zshell.dev/zsh/init.zsh
Directhttps://raw.githubusercontent.com/z-shell/zi-src/main/lib/zsh/init.zsh