Open-Source Wikis

/

Starship

/

Starship

/

Glossary

starship/starship

Glossary

Terms used across Starship's code, config, and documentation. Where useful, the canonical implementation file is linked.

Module

A self-contained unit of prompt output that produces zero or more segments — for example rust, git_branch, or kubernetes. Every module has:

See the Modules section.

Segment

A typed piece of text that lives inside a module — TextSegment, FillSegment, or a LineTerm. Defined in src/segment.rs. Segments inherit their parent module's style unless one is set explicitly.

Format string

A user-supplied template like "$directory$git_branch[\$](red)" written in Starship's mini-DSL. Parsed by StringFormatter using the pest grammar in src/formatter/spec.pest. The grammar supports $variables, ${scoped names}, [text](style) text groups, and (...) conditional groups that disappear if all variables inside are empty.

Variable

Any $name or ${name} referenced inside a format string. The set of variables a format string uses is collected by VariableHolder::get_variables and is what drives the modules that actually run. The special variable $all expands to every module in PROMPT_ORDER that is not disabled and not already mentioned in the format.

Style string

A space-separated list of color and attribute tokens like bold red bg:blue underline. Defined in src/config.rs (Style::from_config). Recognizes named colors, hex (#rrggbb), 256-color indices, palette references (palette.foo resolved via palettes in starship.toml), and the keywords bold, italic, underline, dimmed, inverted, bg:, prev_fg, prev_bg, and none.

Palette

A user-defined color name table in starship.toml:

palette = "ocean"
[palettes.ocean]
primary = "#0bc5ea"

Modules can then reference style = "fg:primary". The selected palette name comes from palette in starship.toml; resolution happens in Style::resolve_palette.

Profile

A named alternative format string, used for special prompt variants. Configured under [profiles] in starship.toml, e.g.:

[profiles]
transient = "$character"

Built-in internal profiles live in default_profiles; the claude-code profile is one. Selected via starship prompt --profile <name> or starship statusline claude-code.

Target

The kind of prompt Starship is currently rendering: Main, Right (right-side prompt), Continuation, or Profile(name). Defined in Context::Target. The shell init scripts pick the right target via starship prompt --right, --continuation, or --profile.

Continuation prompt

The shorter prompt printed for line continuations (the one shown after a backslash-newline in bash, for example). Configured via continuation_prompt in starship.toml; renderer path is Target::Continuation.

Init script

The shell-specific glue that wires starship into the shell's prompt-redraw hook. The phase-one stub is generated by init_stub; the phase-two full script is whichever src/init/starship.<shell> file applies. See Init scripts.

Preset

A pre-baked configuration shipped in docs/public/presets/toml/ and embedded into the binary at compile time by build.rs. Listed by starship preset --list, printed by starship preset <name>. Examples: nerd-font-symbols, gruvbox-rainbow, tokyo-night, pure-preset.

Custom module

A user-defined module configured under [custom.<name>] in starship.toml. It can detect a project by file/extension/directory presence or by the exit code of a when command, then render the output of a command. Implemented in src/modules/custom.rs. See Custom modules.

Env var module

A user-defined module configured under [env_var.<name>] (or [env_var] for a single one) that simply reflects an environment variable. Implemented in src/modules/env_var.rs.

Statusline

A non-prompt rendering target used by Claude Code's statusLine integration. starship statusline claude-code reads a JSON payload from stdin (ClaudeCodeData), populates Context.claude_code_data, and renders the claude-code profile. The Claude-only modules are claude_model, claude_context, and claude_cost.

Toolchain version

What modules like rust, python, nodejs, etc. produce — usually the version of a language toolchain detected for the current directory, formatted via VersionFormatter.

VCS module

A module that reflects version-control state: git_*, hg_*, fossil_*, pijul_channel, vcs, vcsh. Most use the gix crate for Git access; some shell out to the system hg or fossil binary.

Context

The per-prompt shared object passed to every module. Defined in Context and described in detail in Context. Holds the parsed config, current/logical directory, env, mocked command output (in tests), gix repo handle, and claude_code_data.

Properties

CLI flags forwarded from the shell to starship prompt, like --status=$?, --cmd-duration=…, --jobs=$#, --keymap=…. Defined as Properties using clap derive. The shell init scripts compute these from shell builtins on every redraw.

ModuleRenderer

The test harness in src/test/mod.rs. Wraps Context with mock env, mock command output, mock home, and a sandboxed tempdir root. Returns the rendered string for assertion. See Testing.

STARSHIP_* environment variables

Variables Starship reads at runtime:

Var Purpose
STARSHIP_CONFIG Path to the user's TOML config
STARSHIP_CACHE Where session log files are written
STARSHIP_LOG Log level (error, warn, info, debug, trace)
STARSHIP_NUM_THREADS Override the rayon pool size (default min(cpus, 8))
STARSHIP_SESSION_KEY Random per-session id, set by some shells via starship session
STARSHIP_SHELL Set by init scripts so Context::get_shell knows which shell is running

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Glossary – Starship wiki | Factory