docs/content/docs/guides/molecli-shell-completion.md
devops-engineer 7c1ac608d3
Some checks failed
Secret scan / secret-scan (pull_request) Successful in 23s
CI / build (pull_request) Failing after 35s
fix(post-suspension): migrate github.com/Molecule-AI refs to git.moleculesai.app (Class G #168)
The GitHub org Molecule-AI was suspended on 2026-05-06; canonical SCM
is now Gitea at https://git.moleculesai.app/molecule-ai/. Stale
github.com/Molecule-AI/... URLs return 404 and break tooling that
clones / pip-installs / curls them.

This bundles all non-Go-module URL fixes for this repo into a single PR.
Go module path references (in *.go, go.mod, go.sum) are out of scope
here -- tracked separately under Task #140.

Token-auth clone URLs also flip ${GITHUB_TOKEN} -> ${GITEA_TOKEN} since
the GitHub token does not auth against Gitea.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 13:04:27 -07:00

2.1 KiB

title description
molecli Shell Completion Enable tab completion for the molecli (molecule-cli) TUI dashboard in bash, zsh, fish, and PowerShell.

molecli Shell Completion

The molecule CLI (molecli) supports shell completion for bash, zsh, fish, and PowerShell. Completion scripts are auto-generated by Cobra and cover all subcommands and flags.

Install

bash

Add to ~/.bashrc or ~/.bash_completion.d/:

source <(molecule completion bash)

Or source from your profile:

# In ~/.bash_profile or ~/.bashrc
[[ -f ~/.bash_completion ]] && source ~/.bash_completion
source <(molecule completion bash)

zsh

Add to ~/.zshrc:

autoload -U compinit && compinit
autoload -Uz bashcompinit && bashcompinit
source <(molecule completion zsh)
compdef _molecule molecule

Completion will activate automatically after restarting your shell or running source ~/.zshrc.

fish

molecule completion fish | source

To persist across sessions, add the line above to ~/.config/fish/config.fish.

PowerShell

Add to your PowerShell profile ($PROFILE):

molecule completion powershell | Out-String | Invoke-Expression

To find and edit your profile:

Split-Path $PROFILE
code $PROFILE  # or your preferred editor

Supported Shells

Shell Flag Install target
bash bash ~/.bashrc
zsh zsh ~/.zshrc
fish fish ~/.config/fish/config.fish
PowerShell powershell $PROFILE

Verifying

After sourcing, test by typing a partial command:

molecule <TAB><TAB>

You should see available subcommands: completion, workspace, config, etc.

Reference

molecule completion [bash|zsh|fish|powershell]
  • bash — Bash completions (~/.bashrc)
  • zsh — Zsh completions with compdef (~/.zshrc)
  • fish — Fish shell completions (~/.config/fish/completions)
  • powershell — PowerShell completions ($PROFILE)

See molecule-cli PR #5 for implementation details.