Create a named instance
A custom module is a named table such as [custom.project]. Its prompt variable is ${custom.project}; the aggregate $custom renders unnamed references.
Use a short, stable name. The builder updates both the table and every format reference when you rename it.
format = "${custom.project}$directory$character"
[custom.project]
command = "basename $PWD"
when = true
format = "[$symbol$output]($style) "
style = "bold yellow"Control when the command runs
Use when for a shell condition, or detect_files, detect_folders, and detect_extensions for project detection.
Keep commands quick and deterministic because they execute whenever Starship draws the prompt. Prefer a built-in module when it exposes the same information.
Preview safely
The browser does not execute the command. Supply a representative output value in Simulated environment to preview formatting and empty output.
Treat imported custom commands as executable code before installing a config. The builder preserves them but cannot decide whether they are trustworthy.