Skip to content

Shell Completions

Griffen Fargo edited this page Apr 22, 2026 · 2 revisions

Strut ships tab-completion scripts for bash, zsh, and fish. They complete stack names, commands, subcommands, environment names, and common flags.

Install

Run strut completions <shell> and either eval the output (bash/zsh) or save it into your shell's completion directory (fish).

# bash — add to ~/.bashrc
eval "$(strut completions bash)"

# zsh — add to ~/.zshrc
eval "$(strut completions zsh)"

# fish — save once
strut completions fish > ~/.config/fish/completions/strut.fish

Or let strut install for you:

strut init --completions    # detects $SHELL, installs to the right rc/file

--completions is idempotent — running it twice doesn't duplicate the eval line in your rc file.

What gets completed

Context Completions
strut <TAB> Top-level commands + stack names from stacks/*/
strut <stack> <TAB> Per-stack commands (deploy, health, backup, …)
strut <stack> backup <TAB> Backup subcommands: postgres neo4j mysql sqlite all verify list health …
strut <stack> drift <TAB> detect report fix monitor history auto-fix
strut <stack> db:pull <TAB> postgres neo4j mysql sqlite all
strut <stack> volumes <TAB> status init config
strut <stack> keys <TAB> rotate status check env ssh github
--env <TAB> Environment names from .*.env files at project root
--services <TAB> messaging ui full gdrive
--registry <TAB> ghcr dockerhub ecr none
strut completions <TAB> bash zsh fish
strut group <TAB> Group names from groups.conf + list show add remove
strut list <TAB> plugins --json
strut help <TAB> Any strut command (core or per-stack)

Stack names, env names, and group names are discovered dynamically by walking up from $PWD for strut.conf — so completions update automatically when you add a new stack or env file.

Customization

The completion scripts live under completions/ in Strut_Home (bash.sh, zsh.sh, fish.fish). They are plain shell, so you can layer your own wrapper on top — e.g., to add project-specific commands from a plugin, extend the completion function in your rc after the eval line.

Limitations

  • strut <stack> <plugin> — plugins are not auto-completed yet. Use strut list plugins to see the available ones; plugin names come up via the generic per-stack-command list once registered in your shell session.
  • Only the most common flags per command are completed. Falling back to --env --services --json --dry-run --help for unknown commands keeps the scripts small; the full flag set is documented in CLI Reference.

Clone this wiki locally