Skip to content

Commit ab2f9fb

Browse files
authored
Add shell completion generation (#764)
* Add shell completion generation Add zero completions for bash, zsh, fish, PowerShell, and Elvish using one shared command tree that covers aliases, nested commands, root flags, and common exec flags. Validate missing and unsupported shell arguments as usage errors and document safe installation examples in command help. Refs #499 * Complete shell target suggestions Expose every supported shell as a completions subcommand candidate and document Elvish activation. Refs #499 * Fix Elvish completion syntax Close generated Elvish conditional branches, use value equality, and validate generated script structure plus native Bash and Zsh syntax. Refs #499
1 parent baa4be1 commit ab2f9fb

3 files changed

Lines changed: 582 additions & 0 deletions

File tree

‎internal/cli/app.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ func runWithDeps(args []string, stdout io.Writer, stderr io.Writer, deps appDeps
374374
case "exec":
375375
// Forward leading --add-dir occurrences so exec's own parser collects them.
376376
return runExec(append(addDirFlagArgs(addDirs), args[1:]...), stdout, stderr, deps)
377+
case "completions":
378+
return runCompletions(args[1:], stdout, stderr)
377379
case "daemon":
378380
return runDaemon(args[1:], stdout, stderr, deps)
379381
case "config":
@@ -1172,6 +1174,7 @@ Usage:
11721174
11731175
Commands:
11741176
exec Run a one-shot prompt through the Go agent runtime
1177+
completions Generate shell completion scripts
11751178
daemon Manage the local background worker daemon (start/stop/status/run/attach)
11761179
setup Guide first-run provider setup
11771180
config Inspect resolved Go configuration without leaking secrets

0 commit comments

Comments
 (0)