Shell completion
rstube complete <shell> prints a completion script to stdout. Supported
shells: bash, zsh, fish, elvish, powershell.
Bash
Install once:
rstube complete bash > ~/.local/share/bash-completion/completions/rstube
Or source on the fly in your ~/.bashrc:
source <(rstube complete bash)
Name completion for playlists and videos
The bash script injects small helpers that read your config at tab time. Completion is scoped by section — playlist names never bleed into video slots and vice versa.
Playlist names (configured via playlists add) complete in:
rstube playlists show <TAB>rstube playlists remove <TAB>rstube playlists fetch <TAB>
Video ids (configured via videos add) complete in:
rstube videos remove <TAB>rstube videos fetch <TAB>
The helpers read $RSTUBE_CONFIG_DIR/config.toml, falling back to the
XDG default.
Zsh
rstube complete zsh > ~/.zfunc/_rstube
# ensure ~/.zfunc is in fpath; e.g. in .zshrc:
# fpath=(~/.zfunc $fpath)
# autoload -U compinit && compinit
Fish
rstube complete fish > ~/.config/fish/completions/rstube.fish
Elvish / PowerShell
See the respective shells’ documentation for where to install generated completion scripts. rstube just prints to stdout — installation location is up to you.
Notes
- The bash playlist-name injection is bash-specific. Other shells get standard clap-generated completion (subcommands, flags, enums) but not playlist-name completion.
- Re-run
rstube complete bash > ...whenever you upgrade rstube — the flag set may have changed.