Getting Started
zline is an ultra-fast, zero-dependency, pure-Zsh replacement for Powerlevel10k and Starship designed for sub-millisecond synchronous rendering and zero subshell forks.
Installation
Using zload (recommended for sub-millisecond warm startup):
Manual Git clone installation:
Core Architecture & Performance Invariants
Strict Zero-Fork Path
Prompt rendering strictly executes 0 subprocesses and 0 subshell forks $(...) on the synchronous path. All string processing relies on native Zsh parameter expansions.
Compile Once, Render Microseconds
When zline init runs, token arrays are compiled into direct function pointers, eliminating zparseopts and argument-parsing overhead at prompt render time.
Async Background Worker
Slow I/O operations (such as deep Git status scans) run asynchronously in a dedicated non-blocking worker over FIFOs/pipes without blocking your prompt.
Base16 Palette First
Standardizes on ANSI colors 0 through 15 so prompt themes automatically adapt to your terminal's color scheme without hardcoded RGB values.
Configuration & Array Syntax
Prompts are declared using native Zsh token arrays. You do not need quotes around lines unless an argument contains spaces:
Universal Segment Flags
Every built-in and custom segment accepts these universal modifiers:
| Flag | Target | Default | Description & Example |
|---|---|---|---|
--icon <glyph> |
Any Segment | Built-in glyph | Overrides the default icon (e.g. --icon " "). |
--icon "" |
Any Segment | — | Suppresses the icon, rendering only text/content. |
--color <col>--fg <col> |
Any Segment | Theme Default | Sets foreground color: Base16 index (0-15), color name (cyan), or hex (#38bdf8). |
--bg <col> |
Any Segment | Theme Default | Sets background block color in Powerline and Rainbow visual styles. |
--prefix <str> |
Any Segment | None | String prepended immediately before the segment content. |
--suffix <str> |
Any Segment | None | String appended immediately after the segment content. |
--format <fn> |
Any Segment | None | Passes raw content to custom Zsh function which mutates $REPLY. |
Global Styling Flags
Passed to zline preset <name> [flags] or zline style <name> [flags]:
| Flag | Default | Description |
|---|---|---|
--transient |
Off | Collapses prompt history into a compact symbol upon executing a command. |
--transient-dir |
Off | Retains current working directory along with symbol in transient prompt history. |
--no-transient |
On | Disables transient prompt behavior (preserves full prompt in terminal scrollback). |
--no-icons / --icons |
Icons On | Toggles icon glyphs globally across all prompt segments. |
--ascii |
NerdFont | Renders ASCII-safe separators (>) for minimal or standard terminal fonts. |
--nerdfont |
NerdFont | Enables high-resolution Nerd Font Powerline glyphs (, , ). |
--frame [full|left|none] |
none | Draws framing line around multi-line prompt layouts. |
--connect |
Off | Draws connecting line between left and right prompt segments. |
--no-osc |
OSC On | Disables OSC 133 semantic prompt annotations and OSC 7 directory tracking. |
Visual Presets & Curated Themes
Layout Presets
| Preset | Visual Style | Command |
|---|---|---|
| Powerline | Classic solid block backgrounds with interlocking arrow glyphs. | zline preset powerline |
| Lean | Minimalist two-line prompt with pure colors and zero background blocks. | zline preset lean |
| Rainbow | Vibrant rounded pill segments with distinct functional color grouping. | zline preset rainbow |
| Pure | Clean, uncluttered, prompt-symbol-first modern aesthetic. | zline preset pure |
Curated Base16 Color Themes
| Theme | Palette Style | Command |
|---|---|---|
| Catppuccin | Soothing pastel dark palette with Mocha accents. | zline preset catppuccin |
| Tokyo Night | Dark, vibrant aesthetic inspired by Tokyo nightlife. | zline preset tokyonight |
| Nord | Arctic, north-bluish clean and muted palette. | zline preset nord |
| Gruvbox | Warm retro groove color scheme with rich contrast. | zline preset gruvbox |
Command Line Interface
Complete reference of zline commands:
| Command | Arguments / Flags | Description |
|---|---|---|
zline preset <name> |
[--transient] [--ascii] [--no-icons] |
Loads layout preset or curated theme with optional styling flags. |
zline preset list |
— | Lists all available presets and curated themes. |
zline preset show <name> |
— | Displays the full Zsh configuration code for a preset. |
zline style <name> |
[styling flags] |
Applies visual frame, separators, or mode overrides without reloading segments. |
zline init |
— | Compiles prompt tokens into wordcode and attaches shell lifecycle hooks. |
zline bench |
[--profile] [iterations] |
Measures render latency against < 1.5 ms budget, with optional per-segment profiling. |
zline compare |
— | Runs comparative microbenchmarks against other prompt architectures. |
zline doctor |
— | Runs health check on Zsh version, UTF-8 locale, cache directory, and segments. |
zline configure |
— | Interactive CLI configuration wizard. |
zline migrate <file> |
~/.p10k.zsh |
Translates Powerlevel10k configurations into native zline syntax. |
zline compile |
— | Compiles all zline modules into wordcode (.zwc) for instant loading. |
zline clean |
— | Removes compiled wordcode bytecode artifacts. |
zline update |
— | Pulls the latest git release and recompiles bytecode. |
zline notify |
[on|off|threshold|status] |
Configures desktop notifications for long-running commands (OSC 777 / OSC 9). |
zline version |
— | Prints current zline version. |
Built-in Segments Directory (58 Segments)
zline ships with 58 built-in segments covering source control, system monitoring, cloud infrastructure, and 26+ programming language runtimes.
Working directory with fish-style shortening, Git root anchoring, path aliasing, and read-only lock indicator.
Instant synchronous HEAD branch read (< 0.1 ms) + non-blocking async worker badges for dirty, ahead/behind, stash, and submodules.
Jujutsu VCS repository change ID and bookmark tracking from active .jj/ working copy.
Command exit code badge with error signal translation and conditional zero suppression.
Execution duration of last command with minimum threshold gating and decimal precision controls.
Dynamic prompt symbol with color state tracking for successful exit, error code, and Vi mode.
Zsh Line Editor (ZLE) modal editing mode badge tracking NORMAL, INSERT, and VISUAL keymaps.
Nested shell depth warning alert displayed when $SHLVL exceeds configurable threshold.
Active background job counter indicator tracking asynchronous processes suspended or running in current shell.
Current local time formatted with zero-fork prompt expansion escapes (e.g. %*, %T, %D).
Operating system and Linux distribution identification with matching logo glyphs.
User and hostname indicator automatically surfacing for SSH remote sessions or root user privileges.
Container runtime environment badge identifying Docker, Podman, LXC, systemd-nspawn, or WSL.
Hardware battery level percentage and charging state with configurable low-battery alert threshold.
System physical memory utilization percentage with warning color thresholding.
System 1-minute CPU load average with configurable warning threshold.
Active Kubernetes cluster and namespace parsed directly from ~/.kube/config.
Active Docker context name read from $DOCKER_CONTEXT or ~/.docker/config.json.
Active AWS profile and configured region read from environment variables or ~/.aws/config.
Active Google Cloud Platform project name extracted from $CLOUDSDK_CORE_PROJECT or active gcloud configuration.
Active Microsoft Azure subscription name from $ARM_SUBSCRIPTION_NAME or azure profile.
Active Terraform workspace read from $TF_WORKSPACE or .terraform/environment.
Active Pulumi stack and project configuration parsed from Pulumi.yaml.
Helm chart name and release version parsed from Chart.yaml or helmfile.yaml.
CMake project name and minimum version parsed from CMakeLists.txt or presets.
Meson C/C++ project name and release version parsed from meson.build.
Bazel monorepo workspace name parsed from MODULE.bazel or WORKSPACE.
Rust toolchain release version parsed from rust-toolchain, rust-toolchain.toml, or Cargo.toml.
Go runtime version parsed from go.mod directive or local Go toolchain.
Node.js version read from .node-version, .nvmrc, or package.json engines.
Bun runtime version or project badge detected from bun.lockb or bunfig.toml.
Deno runtime version or project badge detected from deno.json or deno.lock.
Python virtual environment, Conda environment, or Poetry project indicator.
Ruby version detected from .ruby-version, Gemfile, or .tool-versions.
Java JDK version parsed from .java-version, pom.xml, or active $JAVA_HOME.
Kotlin compiler version parsed from build.gradle.kts or .tool-versions.
Scala language version parsed from build.sbt or .tool-versions.
Swift compiler and Swift Package Manager version from Package.swift.
Dart SDK and Flutter version parsed from pubspec.yaml or .tool-versions.
Zig toolchain version parsed from .zigversion, build.zig, or build.zig.zon.
PHP runtime version read from .php-version or composer.json.
Elixir runtime version parsed from mix.exs or .tool-versions.
Erlang/OTP version parsed from rebar.config or .tool-versions.
Julia environment release version parsed from Project.toml or .tool-versions.
Crystal language runtime version from shard.yml or .tool-versions.
Clojure project environment from deps.edn, project.clj, or .tool-versions.
Haskell GHC compiler version parsed from stack.yaml, cabal.project, or .tool-versions.
OCaml toolchain version parsed from dune-project, dune, or .tool-versions.
Solidity smart contract workspace parsed from foundry.toml or hardhat.config.js.
Perl version parsed from cpanfile or .tool-versions.
R environment version detected from DESCRIPTION, .Rprofile, or renv.lock.
.NET SDK release version parsed from global.json or project solution.
Lua runtime release version from .lua-version or .tool-versions.
Application package version extracted from package.json, Cargo.toml, or pyproject.toml.
Active Direnv loaded environment indicator triggered by $DIRENV_DIR or .envrc.
Active mise polyglot runtime environment indicator from $MISE_ENV or mise.toml.
Active Nix development shell indicator from $IN_NIX_SHELL or default.nix.
Static text badge or evaluated shell variable (e.g. text "PRODUCTION" --color 9).