Skip to content

Commit 4e14aab

Browse files
committed
feat: add Ghostty and Starship completions, update Claude Code completion
- New: Ghostty terminal completions — 13 actions (+list-fonts, +list-themes, +show-config, +validate-config, +edit-config, +show-face, +ssh-cache, etc.) with typed flags and custom completers for font styles and presentation modes. - New: Starship prompt completions — 12 subcommands (init, preset, module, toggle, timings, explain, etc.) with custom completers for shell names and preset names. - Update: Claude Code completions — add auto permission mode, max effort level, full model IDs (claude-opus-4-6, claude-haiku-4-5-20251001), --brief flag, --name flag, mark --mcp-debug as deprecated. Synced with CC v2.1.78. All completions validated with `nu -c 'use ... *'` on Nushell 0.111.
1 parent 196d943 commit 4e14aab

5 files changed

Lines changed: 325 additions & 4 deletions

File tree

custom-completions/claude/claude-completions.nu

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ def "nu-complete claude input-format" [] {
1414
}
1515

1616
def "nu-complete claude permission-mode" [] {
17-
[acceptEdits bypassPermissions default dontAsk plan]
17+
[acceptEdits bypassPermissions default dontAsk plan auto]
1818
}
1919

2020
def "nu-complete claude models" [] {
21-
[sonnet opus haiku claude-sonnet-4-6]
21+
[sonnet opus haiku claude-sonnet-4-6 claude-opus-4-6 claude-haiku-4-5-20251001]
2222
}
2323

2424
def "nu-complete claude effort" [] {
25-
[low medium high]
25+
[low medium high max]
2626
}
2727

2828
def "nu-complete claude scope" [] {
@@ -51,7 +51,8 @@ export extern claude [
5151
--json-schema: string # JSON schema
5252
--include-partial-messages # Include partial messages
5353
--input-format: string@"nu-complete claude input-format" # Input format
54-
--mcp-debug # MCP debug mode
54+
--brief # Enable SendUserMessage tool for agent-to-user communication
55+
--mcp-debug # [DEPRECATED] MCP debug mode (use --debug instead)
5556
--dangerously-skip-permissions # Skip permissions (dangerous)
5657
--allow-dangerously-skip-permissions # Allow skip permissions
5758
--max-budget-usd: number # Max budget in USD
@@ -89,6 +90,7 @@ export extern claude [
8990
--worktree(-w): string # Git worktree
9091
--tmux # Tmux mode
9192
--effort: string@"nu-complete claude effort" # Effort level
93+
--name(-n): string # Set a display name for this session
9294
--version(-v) # Show version
9395
--help(-h) # Show help
9496
...args: string # Command or prompt
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Ghostty Completions
2+
3+
Completions for the [Ghostty](https://ghostty.org) terminal emulator CLI.
4+
5+
## Usage
6+
7+
```nu
8+
use ghostty-completions.nu *
9+
```
10+
11+
## Features
12+
13+
- Main `ghostty` command with `-e` flag and config key support
14+
- All `+action` subcommands: `+list-fonts`, `+list-themes`, `+list-keybinds`, `+list-colors`, `+list-actions`, `+show-config`, `+validate-config`, `+edit-config`, `+show-face`, `+ssh-cache`, `+crash-report`, `+version`, `+boo`
15+
- Custom completions for font styles and presentation modes
16+
- Flag descriptions from `ghostty +action --help`
17+
18+
## Tested With
19+
20+
- Ghostty 1.3.x
21+
- Nushell 0.111+
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Ghostty terminal emulator completions for Nushell
2+
# https://ghostty.org — Version 1.3.x
3+
# Ghostty uses +action syntax for subcommands and --key=value for config options
4+
5+
# --- Completion helpers ---
6+
7+
def "nu-complete ghostty actions" [] {
8+
[
9+
{ value: "+list-fonts", description: "List available fonts" }
10+
{ value: "+list-themes", description: "List available themes" }
11+
{ value: "+list-keybinds", description: "List configured keybindings" }
12+
{ value: "+list-colors", description: "List named RGB colors" }
13+
{ value: "+list-actions", description: "List all bindable actions" }
14+
{ value: "+show-config", description: "Show current configuration" }
15+
{ value: "+validate-config", description: "Validate config file" }
16+
{ value: "+edit-config", description: "Open config in $EDITOR" }
17+
{ value: "+show-face", description: "Show font face for a codepoint" }
18+
{ value: "+crash-report", description: "Inspect crash reports" }
19+
{ value: "+ssh-cache", description: "Manage SSH terminfo cache" }
20+
{ value: "+version", description: "Show version information" }
21+
{ value: "+boo", description: "Display the Ghostty animation" }
22+
]
23+
}
24+
25+
def "nu-complete ghostty font-style" [] {
26+
[regular bold italic bold_italic]
27+
}
28+
29+
def "nu-complete ghostty presentation" [] {
30+
[text emoji]
31+
}
32+
33+
# --- Main command ---
34+
35+
# Ghostty terminal emulator
36+
export extern ghostty [
37+
-e: string # Run a command instead of the shell
38+
--help # Show help
39+
--version # Show version
40+
...args: string # Action (+action) or config (--key=value)
41+
]
42+
43+
# --- Actions ---
44+
45+
# List available fonts
46+
export extern "ghostty +list-fonts" [
47+
--family: string # Filter by font family name
48+
--style: string@"nu-complete ghostty font-style" # Filter by style
49+
--bold # Show bold variants
50+
--italic # Show italic variants
51+
--help # Show help
52+
]
53+
54+
# List available color themes
55+
export extern "ghostty +list-themes" [
56+
--plain # Disable formatting for Unix tooling
57+
--help # Show help
58+
]
59+
60+
# List configured keybindings
61+
export extern "ghostty +list-keybinds" [
62+
--default # Show default keybindings
63+
--docs # Print documentation for each keybind
64+
--help # Show help
65+
]
66+
67+
# List named RGB colors
68+
export extern "ghostty +list-colors" [
69+
--plain # Disable formatting for Unix tooling
70+
--help # Show help
71+
]
72+
73+
# List all bindable actions
74+
export extern "ghostty +list-actions" [
75+
--docs # Print documentation for each action
76+
--help # Show help
77+
]
78+
79+
# Show current configuration
80+
export extern "ghostty +show-config" [
81+
--default # Show default config instead of user config
82+
--changes-only # Only show options changed from default
83+
--docs # Print documentation above each option
84+
--help # Show help
85+
]
86+
87+
# Validate Ghostty configuration file
88+
export extern "ghostty +validate-config" [
89+
--config-file: path # Path to config file to validate
90+
--help # Show help
91+
]
92+
93+
# Open Ghostty config in $VISUAL or $EDITOR
94+
export extern "ghostty +edit-config" [
95+
--help # Show help
96+
]
97+
98+
# Show font face used for a specific codepoint
99+
export extern "ghostty +show-face" [
100+
--cp: string # Codepoint (decimal, hex 0x, octal 0o, binary 0b)
101+
--string: string # Find face for all codepoints in a string
102+
--style: string@"nu-complete ghostty font-style" # Search for a specific style
103+
--presentation: string@"nu-complete ghostty presentation" # Force text or emoji presentation
104+
--help # Show help
105+
]
106+
107+
# Manage SSH terminfo cache
108+
export extern "ghostty +ssh-cache" [
109+
--clear # Clear the entire cache
110+
--add # Add an entry to the cache
111+
--remove # Remove an entry from the cache
112+
--host: string # Hostname for add/remove
113+
--ttl: string # Time-to-live for cache entry
114+
--help # Show help
115+
]
116+
117+
# Inspect and send crash reports
118+
export extern "ghostty +crash-report" [
119+
--help # Show help
120+
]
121+
122+
# Show Ghostty version information
123+
export extern "ghostty +version" [
124+
--help # Show help
125+
]
126+
127+
# Display the Ghostty animation from the website
128+
export extern "ghostty +boo" [
129+
--help # Show help
130+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Starship Completions
2+
3+
Completions for the [Starship](https://starship.rs) cross-shell prompt.
4+
5+
## Usage
6+
7+
```nu
8+
use starship-completions.nu *
9+
```
10+
11+
## Features
12+
13+
- All subcommands: `bug-report`, `completions`, `config`, `explain`, `init`, `module`, `preset`, `print-config`, `prompt`, `session`, `timings`, `toggle`
14+
- Custom completions for shell names and preset names
15+
- Full flag support including prompt context flags (`--status`, `--path`, `--cmd-duration`, etc.)
16+
17+
## Tested With
18+
19+
- Starship 1.x
20+
- Nushell 0.111+
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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

Comments
 (0)