Open-Source Wikis

/

Starship

/

Reference

/

Dependencies

starship/starship

Dependencies

Direct crate dependencies declared in Cargo.toml. Indirect dependencies (the long tail in Cargo.lock) are not listed here.

Runtime crates

CLI and config

Crate Use
clap (with derive, cargo, unicode) CLI parsing
clap_complete, clap_complete_nushell Shell completion generation
toml, toml_edit TOML reading and editing (the latter preserves comments and formatting for starship config <key> <value>)
serde, serde_json, jsonc-parser, quick-xml, yaml-rust2, rust-ini Format parsers used by various modules to read project metadata files
indexmap (with serde) Order-preserving maps for the config
schemars (gated on config-schema) JSON Schema generation for .github/config-schema.json

Rendering

Crate Use
nu-ansi-term ANSI escape generation; used to render styled segments
pest, pest_derive Parser generator for the format-string DSL
unicode-segmentation, unicode-width Width/segmentation calculations for terminal output
terminal_size Read terminal width
urlencoding URL-safe escaping for status emoji

Filesystem and process

Crate Use
dirs, home Locate platform-appropriate config/cache/home directories
dunce Convert Windows \\?\ extended paths to plain paths for display
path-slash Normalize path separators
process_control Spawn commands with a hard timeout (used by every Context::exec_cmd)
shell-words Quote/unquote shell arguments
which Locate executables on PATH
tempfile (dev) Test fixtures and isolation

Concurrency

Crate Use
rayon Module-level parallelism
parking_lot Poison-free locks for shared state between git_status and git_metrics

Git

Crate Use
gix (no defaults; max-performance-safe, revision, zlib-rs, status, sha1) All git operations. Default features are disabled because of the prompt-latency issues documented in #4251.
sha1 SHA-1 hashing (mostly for git short-hashes)

Domain helpers

Crate Use
chrono (no defaults; clock, std, wasmbind) Timestamps for shell mode and time module
regex (no defaults; perf, std, unicode-perl) Substitution patterns in directory.substitutions and elsewhere
semver, versions Version-string parsing and comparison
strsim Levenshtein for spelling-suggestion in error messages
os_info (with schemars) OS family detection for the os module — comment in Cargo.toml says: "update os module config and tests when upgrading os_info"
whoami (no defaults; std, wasi-wasite) Username/hostname for the corresponding modules
guess_host_triple Inferring rustup target triple
rand Sole use: shell-prompt color shuffling for the gruvbox-rainbow preset and a couple of other places
systemstat (pinned =0.2.6) Memory module
starship-battery (optional, battery feature) Battery module
notify-rust (optional, notify feature) Desktop notifications for cmd_duration

Build/utility

Crate Use
shadow-rs Bake build-time metadata (commit hash, build date) into the binary
log (with std) Logging facade. The custom logger is in src/logger.rs.
mockall (dev) Mock generation for tests
winres (build, Windows only) Embed Windows version info / icon in the EXE
deelevate (Windows only) Detect elevation status for the privileged-shell indicator
windows (Windows only) Win32 bindings for various platform-specific operations
nix (non-Windows; no defaults; feature, fs, user) POSIX bindings for hostname, file mode, etc.

Why some defaults are turned off

  • gix defaults disabled — see #4251. The default feature set pulled in heavyweight algorithms that hurt prompt latency.
  • chrono defaults disabled — drops the oldtime legacy time crate.
  • regex defaults disabled — drops the Aho-Corasick prefilter (Starship's regexes are short and benefit less from the prefilter than from a smaller binary).
  • whoami defaults disabled — keeps WASI subset usable.
  • shadow-rs defaults disabled — only build is needed.

Pinned versions

systemstat = "=0.2.6" is pinned because newer versions broke memory reading on macOS. This is the only =-pinned dependency.

Optional features

[features]
default = ["battery", "notify"]
battery = ["starship-battery"]
config-schema = ["schemars"]
notify = ["notify-rust"]
Feature Default? What disables/enables
battery yes Pulls in starship-battery. Disable on Termux.
notify yes Pulls in notify-rust. Disable on macOS+Nix.
config-schema no Adds the starship config-schema subcommand and schemars. Used by CI to regenerate the JSON Schema.

Build profile

[profile.release]
codegen-units = 1
lto = true
strip = true

Aggressive: full LTO, single codegen unit, stripped binary. Trades compile time for the smallest, fastest possible release artifact — the prompt has to be fast on every keystroke.

[profile.bench]
codegen-units = 16
lto = "thin"
strip = false

Bench profile keeps debug symbols and uses thin LTO so flame graphs and perf records are useful.

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

Dependencies – Starship wiki | Factory