feat: add shell completion subcommand (#138)

Why
---
Improves the usability of the `codex` CLI by adding shell completion for
file paths. This allows users to quickly complete file arguments using
tab completion in bash, zsh, and fish shells. Enable via `eval "$(codex
completion <shell>)"`.
This commit is contained in:
Tomas Cupr
2025-04-17 01:34:44 +02:00
committed by GitHub
parent 6829a5a012
commit 33d0d73b82
2 changed files with 35 additions and 0 deletions

View File

@@ -153,6 +153,7 @@ Both approaches are _transparent_ to everyday usage you still run `codex` fr
| `codex` | Interactive REPL | `codex` |
| `codex "…"` | Initial prompt for interactive REPL | `codex "fix lint errors"` |
| `codex -q "…"` | Noninteractive "quiet mode" | `codex -q --json "explain utils.ts"` |
| `codex completion <bash|zsh|fish>` | Print shell completion script | `codex completion bash` |
Key flags: `--model/-m`, `--approval-mode/-a`, and `--quiet/-q`.