Skip to content

Shell Autocomplete

Set up tab completion for devsync commands in bash and zsh.

Devsync supports shell autocomplete for bash, zsh, and powershell. Once set up, pressing Tab will complete command names, flags, and subcommand arguments.


Devsync can print a shell-specific completion script to stdout:

Terminal window
devsync autocomplete bash
devsync autocomplete zsh
devsync autocomplete powershell

The output is a shell script that you source in your shell’s startup file to enable completion.


Add the following line to your ~/.bashrc:

Terminal window
eval "$(devsync autocomplete bash)"

Then reload your shell:

Terminal window
source ~/.bashrc

After setup, Tab completion works for:

  • Top-level commands: push, pull, track, untrack, status, init, doctor, cd, profile, autocomplete
  • Subcommands: profile list, profile use
  • Flags: --mode, --profile, --dry-run, --verbose, etc.
  • Flag values: --mode completes to normal, secret, ignore

Tracking Your Completion Script with devsync

Section titled “Tracking Your Completion Script with devsync”

If you track your .bashrc or .zshrc with devsync, the eval line will be synced automatically to new machines. After pulling on a new machine, the autocomplete will work as soon as you reload your shell.

Terminal window
devsync track ~/.zshrc