|
| 1 | +# Starship prompt completions for Nushell |
| 2 | +# https://starship.rs — The cross-shell prompt for astronauts |
| 3 | + |
| 4 | +# --- Completion helpers --- |
| 5 | + |
| 6 | +def "nu-complete starship shells" [] { |
| 7 | + [bash elvish fish nushell powershell zsh] |
| 8 | +} |
| 9 | + |
| 10 | +def "nu-complete starship presets" [] { |
| 11 | + [ |
| 12 | + bracketed-segments |
| 13 | + catppuccin-powerline |
| 14 | + gruvbox-rainbow |
| 15 | + jetpack |
| 16 | + nerd-font-symbols |
| 17 | + no-empty-icons |
| 18 | + no-nerd-font |
| 19 | + no-runtime-versions |
| 20 | + pastel-powerline |
| 21 | + plain-text-symbols |
| 22 | + pure-preset |
| 23 | + tokyo-night |
| 24 | + ] |
| 25 | +} |
| 26 | + |
| 27 | +# --- Main command --- |
| 28 | + |
| 29 | +# The cross-shell prompt for astronauts |
| 30 | +export extern starship [ |
| 31 | + --help(-h) # Print help |
| 32 | + --version(-V) # Print version |
| 33 | +] |
| 34 | + |
| 35 | +# --- Subcommands --- |
| 36 | + |
| 37 | +# Create a pre-populated GitHub issue with information about your configuration |
| 38 | +export extern "starship bug-report" [ |
| 39 | + --help(-h) # Print help |
| 40 | +] |
| 41 | + |
| 42 | +# Generate starship shell completions for your shell to stdout |
| 43 | +export extern "starship completions" [ |
| 44 | + shell: string@"nu-complete starship shells" # Shell to generate completions for |
| 45 | + --help(-h) # Print help |
| 46 | +] |
| 47 | + |
| 48 | +# Edit the starship configuration |
| 49 | +export extern "starship config" [ |
| 50 | + name?: string # Configuration key to edit |
| 51 | + value?: string # Value to place into that key |
| 52 | + --help(-h) # Print help |
| 53 | +] |
| 54 | + |
| 55 | +# Explains the currently showing modules |
| 56 | +export extern "starship explain" [ |
| 57 | + --status(-s): int # Status code of the previously run command |
| 58 | + --pipestatus: string # Pipe status codes |
| 59 | + --terminal-width(-w): int # Width of the current terminal |
| 60 | + --path(-p): path # Path that the prompt should render for |
| 61 | + --logical-path(-P): string # Logical path for the prompt |
| 62 | + --cmd-duration(-d): int # Execution duration of the last command (ms) |
| 63 | + --keymap(-k): string # Keymap of fish/zsh/cmd |
| 64 | + --jobs(-j): int # Number of currently running jobs |
| 65 | + --shlvl: int # Current value of SHLVL |
| 66 | + --help(-h) # Print help |
| 67 | +] |
| 68 | + |
| 69 | +# Prints the shell function used to execute starship |
| 70 | +export extern "starship init" [ |
| 71 | + shell: string@"nu-complete starship shells" # Shell to initialize |
| 72 | + --print-full-init # Print full init script |
| 73 | + --help(-h) # Print help |
| 74 | +] |
| 75 | + |
| 76 | +# Prints a specific prompt module |
| 77 | +export extern "starship module" [ |
| 78 | + name?: string # Name of the module to print |
| 79 | + --list(-l) # List all supported modules |
| 80 | + --status(-s): int # Status code of the previously run command |
| 81 | + --pipestatus: string # Pipe status codes |
| 82 | + --terminal-width(-w): int # Width of the current terminal |
| 83 | + --path(-p): path # Path that the prompt should render for |
| 84 | + --logical-path(-P): string # Logical path for the prompt |
| 85 | + --cmd-duration(-d): int # Execution duration of the last command (ms) |
| 86 | + --keymap(-k): string # Keymap of fish/zsh/cmd |
| 87 | + --jobs(-j): int # Number of currently running jobs |
| 88 | + --shlvl: int # Current value of SHLVL |
| 89 | + --help(-h) # Print help |
| 90 | +] |
| 91 | + |
| 92 | +# Prints a preset config |
| 93 | +export extern "starship preset" [ |
| 94 | + name?: string@"nu-complete starship presets" # Preset name |
| 95 | + --output(-o): path # Output the preset to a file |
| 96 | + --list(-l) # List all preset names |
| 97 | + --help(-h) # Print help |
| 98 | +] |
| 99 | + |
| 100 | +# Prints the computed starship configuration |
| 101 | +export extern "starship print-config" [ |
| 102 | + --default(-d) # Print the default instead of computed config |
| 103 | + --help(-h) # Print help |
| 104 | + ...name: string # Configuration keys to print |
| 105 | +] |
| 106 | + |
| 107 | +# Prints the full starship prompt |
| 108 | +export extern "starship prompt" [ |
| 109 | + --right # Print the right prompt |
| 110 | + --profile: string # Print prompt with specified profile name |
| 111 | + --continuation # Print the continuation prompt |
| 112 | + --status(-s): int # Status code of the previously run command |
| 113 | + --pipestatus: string # Pipe status codes |
| 114 | + --terminal-width(-w): int # Width of the current terminal |
| 115 | + --path(-p): path # Path that the prompt should render for |
| 116 | + --logical-path(-P): string # Logical path for the prompt |
| 117 | + --cmd-duration(-d): int # Execution duration of the last command (ms) |
| 118 | + --keymap(-k): string # Keymap of fish/zsh/cmd |
| 119 | + --jobs(-j): int # Number of currently running jobs |
| 120 | + --shlvl: int # Current value of SHLVL |
| 121 | + --help(-h) # Print help |
| 122 | +] |
| 123 | + |
| 124 | +# Generate random session key |
| 125 | +export extern "starship session" [ |
| 126 | + --help(-h) # Print help |
| 127 | +] |
| 128 | + |
| 129 | +# Prints timings of all active modules |
| 130 | +export extern "starship timings" [ |
| 131 | + --status(-s): int # Status code of the previously run command |
| 132 | + --pipestatus: string # Pipe status codes |
| 133 | + --terminal-width(-w): int # Width of the current terminal |
| 134 | + --path(-p): path # Path that the prompt should render for |
| 135 | + --logical-path(-P): string # Logical path for the prompt |
| 136 | + --cmd-duration(-d): int # Execution duration of the last command (ms) |
| 137 | + --keymap(-k): string # Keymap of fish/zsh/cmd |
| 138 | + --jobs(-j): int # Number of currently running jobs |
| 139 | + --shlvl: int # Current value of SHLVL |
| 140 | + --help(-h) # Print help |
| 141 | +] |
| 142 | + |
| 143 | +# Toggle a given starship module |
| 144 | +export extern "starship toggle" [ |
| 145 | + name: string # Name of the module to toggle |
| 146 | + value?: string # Key of the config to toggle |
| 147 | + --help(-h) # Print help |
| 148 | +] |
0 commit comments