Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/swift-file-length-budget.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
4483 Sources/cmuxApp.swift
4482 Sources/Panels/FilePreviewPanel.swift
4367 cmuxTests/BrowserPanelTests.swift
4283 Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift
4121 Sources/BrowserWindowPortal.swift
3964 Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift
3934 Sources/Feed/FeedPanelView.swift
3926 cmuxTests/TabManagerUnitTests.swift
3896 cmuxTests/WindowAndDragTests.swift
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ jobs:
- name: Validate Python test harness syntax
run: git ls-files 'tests/*.py' 'tests_v2/*.py' 'scripts/*.py' | xargs python3 -m py_compile

- name: Validate CLI shell completions are in sync
run: python3 tests/test_cli_completions_contract.py

- name: Set up Python 3.9 for nightly prune compatibility
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
Expand Down
3 changes: 3 additions & 0 deletions CLI/CMUXCLI+CommandSuggestions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ extension CMUXCLI {
"read-screen",
"refresh-surfaces",
"reload-config",
"remote",
"remote-daemon-status",
"remotes",
"rename-tab",
"rename-window",
"rename-workspace",
Expand All @@ -176,6 +178,7 @@ extension CMUXCLI {
"setup-hooks",
"shortcuts",
"simulate-app-active",
"simulate-sidebar-drag",
"sidebar",
"sidebar-state",
"split-off",
Expand Down
58 changes: 58 additions & 0 deletions completions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# cmux shell completions

Tab-completion for the `cmux` CLI in **bash**, **zsh**, and **fish**.

> **These files are generated. Do not edit them by hand.**
> They are produced by [`scripts/generate-cli-completions.py`](../scripts/generate-cli-completions.py)
> from the `topLevelCommandNames` registry and the `usage()` help text in
> `CLI/CMUXCLI+CommandSuggestions.swift` and `CLI/cmux.swift`.
> `tests/test_cli_completions_contract.py` (run in CI) fails if a command is
> added without regenerating, so completions stay in sync automatically.

## What completes

- All top-level commands (`cmux <Tab>`)
- Per-command flags (`cmux send --<Tab>`)
- First-level subcommands (`cmux auth <Tab>` → `login logout status`)
- Enum flag values (`cmux diff --source <Tab>` → `unstaged staged branch last-turn`)

## Install

### bash

```bash
# one-off for the current shell
source /path/to/cmux/completions/cmux.bash

# persistent: copy into a bash-completion directory, e.g.
cp completions/cmux.bash "$(brew --prefix)/etc/bash_completion.d/cmux"
```

### zsh

```zsh
# put cmux.zsh on your fpath, e.g.
cp completions/cmux.zsh "$(brew --prefix)/share/zsh/site-functions/_cmux"
# then restart zsh (or run: autoload -U compinit && compinit)
```

### fish

```fish
cp completions/cmux.fish ~/.config/fish/completions/cmux.fish
```

## Regenerate

```bash
scripts/generate-cli-completions.py --write
```

By default the generator reads the command registry from
`CLI/CMUXCLI+CommandSuggestions.swift` and the `usage()` heredoc from
`CLI/cmux.swift`, so no built binary is required. To regenerate against a built
binary instead:

```bash
scripts/generate-cli-completions.py --write --cmux-bin /path/to/cmux
```
339 changes: 339 additions & 0 deletions completions/cmux.bash

Large diffs are not rendered by default.

656 changes: 656 additions & 0 deletions completions/cmux.fish

Large diffs are not rendered by default.

Loading
Loading