Prompts Overview¶
dvt manages terminal prompts as TerminalPrompt YAML resources. A TerminalPrompt defines the full configuration for a shell prompt engine -- its format, modules, colors, and behavior.
Supported Prompt Engines¶
| Engine | Type value | Description |
|---|---|---|
| Starship | starship |
Fast, cross-shell prompt written in Rust |
| Powerlevel10k | powerlevel10k |
Zsh-only, highly customizable powerline prompt |
| Oh-My-Posh | oh-my-posh |
Cross-shell prompt engine with JSON/YAML themes |
TerminalPrompt YAML Format¶
apiVersion: devopsmaestro.io/v1
kind: TerminalPrompt
metadata:
name: my-prompt
description: My custom Starship prompt
category: developer
spec:
type: starship
addNewline: true
palette: theme
format: "$directory$git_branch$character"
modules:
directory:
format: "[$path]($style) "
style: "${theme.primary}"
git_branch:
symbol: " "
format: "[$symbol$branch]($style) "
style: "${theme.accent}"
character:
successSymbol: "[>](bold ${theme.success})"
errorSymbol: "[>](bold ${theme.error})"
See the full field reference at YAML Reference: TerminalPrompt.
Commands¶
Apply a prompt from YAML¶
Apply multiple files or a directory:
List prompts¶
Output as YAML or JSON:
Filter by type:
Get a specific prompt¶
Generate a config file¶
Generate starship.toml (or equivalent) from a saved prompt:
The generated file is written to the appropriate config location for the prompt engine.
Set the active prompt¶
Mark a prompt as the active prompt:
Force replacement if another prompt is already active:
Delete a prompt¶
Force deletion without confirmation:
Theme Variable Interpolation¶
Prompt styles support ${theme.color} variables. These are resolved against the active palette at generation time, making prompts portable across color schemes.
modules:
directory:
style: "${theme.primary}"
git_branch:
style: "${theme.accent}"
character:
successSymbol: "[>](bold ${theme.success})"
errorSymbol: "[>](bold ${theme.error})"
See Theme Integration for the full variable reference.
Module Configuration¶
The modules field is a map of module names to their configuration. Each module supports:
| Field | Type | Description |
|---|---|---|
disabled |
bool | Disable this module entirely |
format |
string | Module format string |
style |
string | Module style (supports ${theme.X} variables) |
symbol |
string | Symbol override |
options |
map | Additional module-specific options |
Example with options:
modules:
nodejs:
format: "[$symbol($version )]($style)"
style: "${theme.success}"
symbol: " "
options:
detect_files: ["package.json", ".nvmrc"]
python:
format: "[$symbol$version]($style) "
style: "${theme.accent}"
disabled: false
Character Configuration¶
The character field configures the prompt character (the final symbol before your cursor):
spec:
character:
successSymbol: "[>](bold ${theme.success})"
errorSymbol: "[>](bold ${theme.error})"
viCmdSymbol: "[N](bold ${theme.accent})"
viInsSymbol: "[I](bold ${theme.primary})"
| Field | Description |
|---|---|
successSymbol |
Symbol shown after a successful command |
errorSymbol |
Symbol shown after a failed command |
viCmdSymbol |
Symbol in vi command mode |
viInsSymbol |
Symbol in vi insert mode |
Next Steps¶
- Prompt Library - Browse and install built-in prompts
- Theme Integration - Use theme color variables
- Terminal Profiles - Bundle prompts with plugins and shell config