Starship Prompt Builder

Directory module

Show the current working directory with controlled truncation, repository-root treatment, read-only indicators, and style.

When it appears

The directory module is available in every prompt. Its path changes with the shell's current working directory.

Preview

Rendered from the starting configuration in a representative simulated environment.

starship — preview
app🔒 

Starting configuration

[directory]
truncation_length = 4
truncate_to_repo = true
style = "bold cyan"
Open in the builder

The configuration is compressed into the URL fragment and stays in your browser.

Key options

formatstring
The format for the module.
stylestring
The style for the module.
truncation_lengthnumber
The number of parent folders that the current directory should be truncated to.
truncate_to_repoboolean
Whether or not to truncate to the root of the git repo that you're currently in.
read_onlystring
The symbol indicating current directory is read only.
home_symbolstring
The symbol indicating home directory.

Format variables

$path
The current directory path
$read_only
The symbol indicating the current directory is read only.
$repo_root
The git root directory name
$style
Mirrors the value of option style

Common adjustments

  • Increase truncation_length when important parent folders disappear.
  • Keep truncate_to_repo enabled when the repository name matters more than its parents.
  • Use repo_root_style to distinguish the project root without restyling the whole path.