dotweave autocomplete
Print the shell completion script for bash, zsh, fish, or PowerShell.
Synopsis
dotweave autocomplete bash
dotweave autocomplete fish
dotweave autocomplete powershell
dotweave autocomplete zsh
Each subcommand writes a completion script to stdout and accepts no flag other than --help. None of them installs anything, so you choose where the script is evaluated or saved.
The scripts do not compute candidates themselves. They call a hidden dotweave __complete <input>... route, which prints one completion<TAB>brief line per candidate and reads the words from the COMP_LINE environment variable when the shell exports it. Command aliases are left out of the completion output, so only the canonical route names are proposed.
autocomplete bash
The bash script registers its completion function with complete -o default -o nospace, so bash falls back to filename completion when no candidate matches and does not append a space of its own.
eval "$(dotweave autocomplete bash)"
autocomplete zsh
The zsh script loads compinit when the session has no compdef, then installs a precmd hook that re-registers the completion whenever something else has taken over the dotweave binding.
eval "$(dotweave autocomplete zsh)"
autocomplete fish
The fish script defines its completion function and binds it with complete -c dotweave -f -a, which suppresses fish's own file candidates.
dotweave autocomplete fish | source
autocomplete powershell
The PowerShell script calls Register-ArgumentCompleter -Native for the dotweave command and returns each candidate with its brief as the tooltip.
dotweave autocomplete powershell | Invoke-Expression
Related commands
Read Set up shell completion for the per-shell profile edits that make this permanent, or dotweave track for the command whose path candidates completion helps you type.