If you are using Bash 4.2 or later, Zsh, or FiSH you can enable Tab Completion for the QMK CLI. This will let you tab complete the names of flags, keyboards, files, and other `qmk` options.
## Setup
There are several ways you can setup tab completion.
### For Your User Only
Add this to the end of your `.profile` or `.bashrc`:
source ~/qmk_firmware/util/qmk_tab_complete.sh
If you put `qmk_firmware` into another location you will need to adjust this path.
### System Wide Symlink
If you want the tab completion available to all users of the system you can add a symlink to the `qmk_tab_complete.sh` script:
In some cases a symlink may not work. Instead you can copy the file directly into place. Be aware that updates to the tab complete script may happen from time to time, you will want to recopy the file periodically.
@cli.argument('filename',nargs='?',arg_only=True,type=qmk.path.FileType('r'),help='The configurator export to compile')
@cli.argument('-kb','--keyboard',type=keyboard_folder,help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.')
@cli.argument('-km','--keymap',help='The keymap to build a firmware for. Ignored when a configurator export is supplied.')
@cli.argument('filename',nargs='?',arg_only=True,type=qmk.path.FileType('r'),completer=FilesCompleter('.json'),help='The configurator export to compile')
@cli.argument('-kb','--keyboard',type=keyboard_folder,completer=keyboard_completer,help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.')
@cli.argument('-km','--keymap',completer=keymap_completer,help='The keymap to build a firmware for. Ignored when a configurator export is supplied.')
@cli.argument('-n','--dry-run',arg_only=True,action='store_true',help="Don't actually build, just show the make command to be run.")
@cli.argument('-j','--parallel',type=int,default=1,help="Set the number of parallel make jobs to run.")
@cli.argument('-e','--env',arg_only=True,action='append',default=[],help="Set a variable to be passed to make. May be passed multiple times.")
cli.echo('For more info, visit https://docs.qmk.fm/#/flashing')
@cli.argument('filename',nargs='?',arg_only=True,type=qmk.path.FileType('r'),help='The configurator export JSON to compile.')
@cli.argument('filename',nargs='?',arg_only=True,type=qmk.path.FileType('r'),completer=FilesCompleter('.json'),help='The configurator export JSON to compile.')
@cli.argument('-b','--bootloaders',action='store_true',help='List the available bootloaders.')
@cli.argument('-bl','--bootloader',default='flash',help='The flash command, corresponding to qmk\'s make options of bootloaders.')
@cli.argument('-km','--keymap',help='The keymap to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.')
@cli.argument('-kb','--keyboard',type=keyboard_folder,help='The keyboard to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.')
@cli.argument('-kb','--keyboard',type=keyboard_folder,completer=keyboard_completer,help='The keyboard to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.')
@cli.argument('-n','--dry-run',arg_only=True,action='store_true',help="Don't actually build, just show the make command to be run.")
@cli.argument('-j','--parallel',type=int,default=1,help="Set the number of parallel make jobs to run.")
@cli.argument('-e','--env',arg_only=True,action='append',default=[],help="Set a variable to be passed to make. May be passed multiple times.")