Skip to main content

⚡️ Installation

Quick setup

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

Alternatively - update and verify sha256 checksum for a file: lib/zsh/init.zsh:

~/.zshrc
local chsm_ok='7fab1ecb8d2ffbdb4aa98dd1e51cebaeaa4d8137e1de11938f3e0df24af262bb'local chsm="$(command curl -fsL 'https://git.io/zi-loader' | sha256sum | awk '{print $1}')"if [[ ${chsm_ok} == ${chsm} ]]; then  source <(curl -sL https://git.io/zi-loader); zzinitelse  print "Houston, we have a problem"; exit 1fi

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

Automated setup

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

Minimal configuration

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

Only update / install repository

sh -c "$(curl -fsSL https://git.io/get-zi)" -- -i skip

Minimal configuration + annexes

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

Minimal configuration + annexes + zdharma/zunit

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

Minimal configuration with loader

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

The installer will download the loader and add the snippet below to the .zshrc file.

if [[ -r "${XDG_CONFIG_HOME:-${HOME}/.config}/zi/init.zsh" ]]; then  source "${XDG_CONFIG_HOME:-${HOME}/.config}/zi/init.zsh" && zzinitfi
tip

The loader can be manually fetched from available links to any location on the system, and sourced from .zshrc or as shown in the quick-setup.

Then reload shell with: exec zsh. All done!

Manual Setup

Setup directory

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

Clone repository

Setting the current user as the owner of directories, then removing group/others write permissions:

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]"

Enable Zi

Source zi.zsh in your .zshrc from the previously created directory:

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

Enable completions

info

The next two lines must be below the above two:

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 your configuration: z-shell/playground

sh -c "$(curl -fsSL https://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:

  • installs plugins without waiting for the prompt (i.e. it's script friendly),
  • installs 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'

Build Zi Module

Without Zi

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

With Zi

info

Zi has to be installed to build the module. Module repository: z-shell/zpmod

zi module build

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