# Shell completion

Source: https://libtmux.org/en/rs/latest/workspace/cli/completion/

> Generate completion for the installed workspace command.

**Workspace Manager concept example** A working example of the core library. It can change without notice.



Generate completion using the installed `tmux-workspace` command. The script
matches that executable's command definitions.

## Enable Bash completion

```console
$ tmux-workspace --generate bash > tmux-workspace.bash
```

Check the generated script before loading it in your current Bash session:

```console
$ bash -n tmux-workspace.bash
```

```bash
source ./tmux-workspace.bash
```

Keep the script in your shell's completion directory to load it in later
sessions. Regenerate it after upgrading the CLI.

## Other shells

`--generate` also accepts `zsh`, `fish`, `powershell` and `elvish`.

Follow the selected shell's completion setup before sourcing its script.
Generating a script does not start tmux or load workspace files.

[CLI source](https://github.com/libtmux/libtmux-rs/blob/e9be0b6f6d22cd2eb79b0ec08964f82e717e5fe4/crates/tmux-workspace/docs/cli.md).
