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):

~/.zshrc
plugins=( casonadams/zline ) zload "${plugins[@]}"

Manual Git clone installation:

Terminal
git clone https://github.com/casonadams/zline.git ~/.zline echo 'source ~/.zline/zline.zsh' >> ~/.zshrc echo 'zline preset powerline --transient' >> ~/.zshrc echo 'zline init' >> ~/.zshrc

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:

~/.zshrc
zline_left=( dir --shorten 1 --anchor git git --clean 2 --dirty 3 --icon " " rust --icon "" package newline prompt_char ) zline_right=( exec_time --min 2 time --color cyan )

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.

dir VCS & FS

Working directory with fish-style shortening, Git root anchoring, path aliasing, and read-only lock indicator.

--shorten 1 | --anchor git | --alias key=val | --readonly-icon
git VCS & FS

Instant synchronous HEAD branch read (< 0.1 ms) + non-blocking async worker badges for dirty, ahead/behind, stash, and submodules.

--clean 2 | --dirty 3 | --ahead 12 | --submodule | --stash
jj VCS & FS

Jujutsu VCS repository change ID and bookmark tracking from active .jj/ working copy.

Trigger: .jj/
status System

Command exit code badge with error signal translation and conditional zero suppression.

--hide-zero | --color 9
exec_time System

Execution duration of last command with minimum threshold gating and decimal precision controls.

--min 2 | --precision 2
prompt_char System

Dynamic prompt symbol with color state tracking for successful exit, error code, and Vi mode.

--symbol '❯' | --error '❯'
vi_mode System

Zsh Line Editor (ZLE) modal editing mode badge tracking NORMAL, INSERT, and VISUAL keymaps.

--normal NOR | --insert INS | --hide-insert
shlvl System

Nested shell depth warning alert displayed when $SHLVL exceeds configurable threshold.

--threshold 2 | --warn 9
jobs System

Active background job counter indicator tracking asynchronous processes suspended or running in current shell.

Pure Zsh builtin (%j)
time System

Current local time formatted with zero-fork prompt expansion escapes (e.g. %*, %T, %D).

--format '%*'
os System

Operating system and Linux distribution identification with matching logo glyphs.

--text
user_host System

User and hostname indicator automatically surfacing for SSH remote sessions or root user privileges.

SSH & UID == 0 detection
container System

Container runtime environment badge identifying Docker, Podman, LXC, systemd-nspawn, or WSL.

Trigger: /.dockerenv | /run/.containerenv
battery System

Hardware battery level percentage and charging state with configurable low-battery alert threshold.

--warn 20
ram System

System physical memory utilization percentage with warning color thresholding.

--warn 80
load System

System 1-minute CPU load average with configurable warning threshold.

--warn 4.0
k8s Cloud

Active Kubernetes cluster and namespace parsed directly from ~/.kube/config.

Trigger: ~/.kube/config
docker Cloud

Active Docker context name read from $DOCKER_CONTEXT or ~/.docker/config.json.

Trigger: Dockerfile | compose.yaml
aws Cloud

Active AWS profile and configured region read from environment variables or ~/.aws/config.

Trigger: $AWS_PROFILE | ~/.aws/
gcp Cloud

Active Google Cloud Platform project name extracted from $CLOUDSDK_CORE_PROJECT or active gcloud configuration.

Trigger: $CLOUDSDK_CORE_PROJECT | ~/.config/gcloud/
azure Cloud

Active Microsoft Azure subscription name from $ARM_SUBSCRIPTION_NAME or azure profile.

Trigger: $AZURE_CONFIG_DIR | ~/.azure/
terraform Cloud

Active Terraform workspace read from $TF_WORKSPACE or .terraform/environment.

Trigger: *.tf | .terraform/
pulumi Cloud

Active Pulumi stack and project configuration parsed from Pulumi.yaml.

Trigger: Pulumi.yaml
helm Cloud

Helm chart name and release version parsed from Chart.yaml or helmfile.yaml.

Trigger: Chart.yaml | helmfile.yaml
cmake Cloud

CMake project name and minimum version parsed from CMakeLists.txt or presets.

Trigger: CMakeLists.txt | CMakePresets.json
meson Cloud

Meson C/C++ project name and release version parsed from meson.build.

Trigger: meson.build
bazel Cloud

Bazel monorepo workspace name parsed from MODULE.bazel or WORKSPACE.

Trigger: MODULE.bazel | WORKSPACE | BUILD
rust Runtime

Rust toolchain release version parsed from rust-toolchain, rust-toolchain.toml, or Cargo.toml.

Trigger: Cargo.toml | rust-toolchain.toml
golang Runtime

Go runtime version parsed from go.mod directive or local Go toolchain.

Trigger: go.mod | *.go
node Runtime

Node.js version read from .node-version, .nvmrc, or package.json engines.

Trigger: package.json | .nvmrc | .node-version
bun Runtime

Bun runtime version or project badge detected from bun.lockb or bunfig.toml.

Trigger: bun.lockb | bunfig.toml
deno Runtime

Deno runtime version or project badge detected from deno.json or deno.lock.

Trigger: deno.json | deno.jsonc | deno.lock
venv Runtime

Python virtual environment, Conda environment, or Poetry project indicator.

Trigger: $VIRTUAL_ENV | $CONDA_DEFAULT_ENV | .venv
ruby Runtime

Ruby version detected from .ruby-version, Gemfile, or .tool-versions.

Trigger: Gemfile | .ruby-version
java Runtime

Java JDK version parsed from .java-version, pom.xml, or active $JAVA_HOME.

Trigger: pom.xml | build.gradle | .java-version
kotlin Runtime

Kotlin compiler version parsed from build.gradle.kts or .tool-versions.

Trigger: *.kt | *.kts | build.gradle.kts
scala Runtime

Scala language version parsed from build.sbt or .tool-versions.

Trigger: build.sbt | *.scala
swift Runtime

Swift compiler and Swift Package Manager version from Package.swift.

Trigger: Package.swift | *.swift
dart Runtime

Dart SDK and Flutter version parsed from pubspec.yaml or .tool-versions.

Trigger: pubspec.yaml | *.dart
zig Runtime

Zig toolchain version parsed from .zigversion, build.zig, or build.zig.zon.

Trigger: build.zig | .zigversion
php Runtime

PHP runtime version read from .php-version or composer.json.

Trigger: composer.json | .php-version
elixir Runtime

Elixir runtime version parsed from mix.exs or .tool-versions.

Trigger: mix.exs | *.ex | *.exs
erlang Runtime

Erlang/OTP version parsed from rebar.config or .tool-versions.

Trigger: rebar.config | *.erl
julia Runtime

Julia environment release version parsed from Project.toml or .tool-versions.

Trigger: Project.toml | *.jl
crystal Runtime

Crystal language runtime version from shard.yml or .tool-versions.

Trigger: shard.yml | *.cr
clojure Runtime

Clojure project environment from deps.edn, project.clj, or .tool-versions.

Trigger: deps.edn | project.clj | *.clj
haskell Runtime

Haskell GHC compiler version parsed from stack.yaml, cabal.project, or .tool-versions.

Trigger: stack.yaml | *.cabal | *.hs
ocaml Runtime

OCaml toolchain version parsed from dune-project, dune, or .tool-versions.

Trigger: dune-project | *.ml
solidity Runtime

Solidity smart contract workspace parsed from foundry.toml or hardhat.config.js.

Trigger: foundry.toml | hardhat.config.js | *.sol
perl Runtime

Perl version parsed from cpanfile or .tool-versions.

Trigger: cpanfile | *.pl | *.pm
r Runtime

R environment version detected from DESCRIPTION, .Rprofile, or renv.lock.

Trigger: DESCRIPTION | renv.lock | *.R
dotnet Runtime

.NET SDK release version parsed from global.json or project solution.

Trigger: global.json | *.csproj | *.fsproj
lua Runtime

Lua runtime release version from .lua-version or .tool-versions.

Trigger: .lua-version | *.lua
package Environment

Application package version extracted from package.json, Cargo.toml, or pyproject.toml.

Trigger: package.json | Cargo.toml | pyproject.toml
direnv Environment

Active Direnv loaded environment indicator triggered by $DIRENV_DIR or .envrc.

Trigger: $DIRENV_DIR | .envrc
mise Environment

Active mise polyglot runtime environment indicator from $MISE_ENV or mise.toml.

Trigger: mise.toml | .tool-versions
nix_shell Environment

Active Nix development shell indicator from $IN_NIX_SHELL or default.nix.

Trigger: $IN_NIX_SHELL | flake.nix | shell.nix
text Environment

Static text badge or evaluated shell variable (e.g. text "PRODUCTION" --color 9).

text <content> [--color <col>]