qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

cli_commands.md (22876B)


      1 # QMK CLI Commands
      2 
      3 # User Commands
      4 
      5 ## `qmk compile`
      6 
      7 This command allows you to compile firmware from any directory. You can compile JSON exports from <https://config.qmk.fm>, compile keymaps in the repo, or compile the keyboard in the current working directory.
      8 
      9 This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
     10 
     11 **Usage for Configurator Exports**:
     12 
     13 ```
     14 qmk compile [-c] <configuratorExport.json>
     15 ```
     16 
     17 **Usage for Keymaps**:
     18 
     19 ```
     20 qmk compile [-c] [-e <var>=<value>] [-j <num_jobs>] [--compiledb] -kb <keyboard> -km <keymap>
     21 ```
     22 
     23 **Usage in Keyboard Directory**:
     24 
     25 Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap <keymap>`
     26 ```
     27 qmk compile
     28 ```
     29 
     30 **Usage for building all keyboards that support a specific keymap**:
     31 
     32 ```
     33 qmk compile -kb all -km <keymap>
     34 ```
     35 
     36 **Example**:
     37 ```
     38 $ qmk config compile.keymap=default
     39 $ cd ~/qmk_firmware/keyboards/planck/rev6
     40 $ qmk compile
     41 Ψ Compiling keymap with make planck/rev6:default
     42 ...
     43 ```
     44 or with optional keymap argument
     45 
     46 ```
     47 $ cd ~/qmk_firmware/keyboards/clueboard/66/rev4
     48 $ qmk compile -km 66_iso
     49 Ψ Compiling keymap with make clueboard/66/rev4:66_iso
     50 ...
     51 ```
     52 or in keymap directory
     53 
     54 ```
     55 $ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak
     56 $ qmk compile
     57 Ψ Compiling keymap with make gh60/satan:colemak
     58 ...
     59 ```
     60 
     61 **Usage in Layout Directory**:
     62 
     63 Must be under `qmk_firmware/layouts/`, and in a keymap folder.
     64 ```
     65 qmk compile -kb <keyboard>
     66 ```
     67 
     68 **Example**:
     69 ```
     70 $ cd ~/qmk_firmware/layouts/community/60_ansi/mechmerlin-ansi
     71 $ qmk compile -kb dz60
     72 Ψ Compiling keymap with make dz60:mechmerlin-ansi
     73 ...
     74 ```
     75 
     76 **Parallel Compilation**:
     77 
     78 It is possible to speed up compilation by adding the `-j`/`--parallel` flag.
     79 ```
     80 qmk compile -j <num_jobs> -kb <keyboard>
     81 ```
     82 The `num_jobs` argument determines the maximum number of jobs that can be used. Setting it to zero will enable parallel compilation without limiting the maximum number of jobs.
     83 ```
     84 qmk compile -j 0 -kb <keyboard>
     85 ```
     86 
     87 **Compilation Database**:
     88 
     89 Creates a `compile_commands.json` file.
     90 
     91 Does your IDE/editor use a language server but doesn't _quite_ find all the necessary include files? Do you hate red squigglies? Do you wish your editor could figure out `#include QMK_KEYBOARD_H`? You might need a [compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html)! Compiling using this argument can create this for you.
     92 
     93 **Example:**
     94 
     95 ```
     96 $ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak
     97 $ qmk compile --compiledb
     98 Ψ Making clean
     99 Ψ Gathering build instructions from make ........
    100 Ψ Found 63 compile commands
    101 Ψ Writing build database to /Users/you/src/qmk_firmware/compile_commands.json
    102 Ψ Compiling keymap with make ........
    103 ... build log continues ...
    104 ```
    105 
    106 ## `qmk flash`
    107 
    108 This command is similar to `qmk compile`, but can also target a bootloader. The bootloader is optional, and is set to `:flash` by default. To specify a different bootloader, use `-bl <bootloader>`. Visit the [Flashing Firmware](flashing) guide for more details of the available bootloaders.
    109 
    110 This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
    111 
    112 This command can also flash binary firmware files (hex or bin) such as the ones produced by [Configurator](https://config.qmk.fm).
    113 
    114 **Usage for Configurator Exports**:
    115 
    116 ```
    117 qmk flash [-bl <bootloader>] [-c] [-e <var>=<value>] [-j <num_jobs>] <configuratorExport.json>
    118 ```
    119 
    120 **Usage for Keymaps**:
    121 
    122 ```
    123 qmk flash -kb <keyboard> -km <keymap_name> [-bl <bootloader>] [-c] [-e <var>=<value>] [-j <num_jobs>]
    124 ```
    125 
    126 **Usage for pre-compiled firmwares**:
    127 
    128 **Note**: The microcontroller needs to be specified (`-m` argument) for keyboards with the following bootloaders:
    129 * HalfKay
    130 * QMK HID
    131 * USBaspLoader
    132 
    133 ISP flashing is also supported with the following flashers and require the microcontroller to be specified:
    134 * USBasp
    135 * USBtinyISP
    136 
    137 ```
    138 qmk flash [-m <microcontroller>] <compiledFirmware.[bin|hex]>
    139 ```
    140 
    141 **Listing the Bootloaders**
    142 
    143 ```
    144 qmk flash -b
    145 ```
    146 
    147 ## `qmk config`
    148 
    149 This command lets you configure the behavior of QMK. For the full `qmk config` documentation see [CLI Configuration](cli_configuration).
    150 
    151 **Usage**:
    152 
    153 ```
    154 qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN]
    155 ```
    156 
    157 ## `qmk cd`
    158 
    159 This command opens a new shell in your `qmk_firmware` directory.
    160 
    161 Note that if you are already somewhere within `QMK_HOME` (for example, the `keyboards/` folder), nothing will happen.
    162 
    163 To exit out into the parent shell, simply type `exit`.
    164 
    165 **Usage**:
    166 
    167 ```
    168 qmk cd
    169 ```
    170 
    171 ## `qmk find`
    172 
    173 This command allows for searching through keyboard/keymap targets, filtering by specific criteria. `info.json` and `rules.mk` files contribute to the search data, as well as keymap configurations, and the results can be filtered using "dotty" syntax matching the overall `info.json` file format.
    174 
    175 For example, one could search for all keyboards powered by the STM32F411 microcontroller:
    176 
    177 ```
    178 qmk find -f 'processor==STM32F411'
    179 ```
    180 
    181 The list can be further constrained by passing additional filter expressions:
    182 
    183 ```
    184 qmk find -f 'processor==STM32F411' -f 'features.rgb_matrix==true'
    185 ```
    186 
    187 The following filter expressions are supported:
    188 
    189  - `key == value`: Match targets where `key` is equal to `value`. May include wildcards such as `*` and `?`.
    190  - `key != value`: Match targets where `key` is not `value`. May include wildcards such as `*` and `?`.
    191  - `key < value`: Match targets where `key` is a number less than `value`.
    192  - `key > value`: Match targets where `key` is a number greater than `value`.
    193  - `key <= value`: Match targets where `key` is a number less than or equal to `value`.
    194  - `key >= value`: Match targets where `key` is a number greater than or equal to `value`.
    195  - `exists(key)`: Match targets where `key` is present.
    196  - `absent(key)`: Match targets where `key` is not present.
    197  - `contains(key, value)`: Match targets where `key` contains `value`. Can be used for strings, arrays and object keys.
    198  - `length(key, value)`: Match targets where the length of `key` is `value`. Can be used for strings, arrays and objects.
    199 
    200 You can also list arbitrary values for each matched target with `--print`:
    201 
    202 ```
    203 qmk find -f 'processor==STM32F411' -p 'keyboard_name' -p 'features.rgb_matrix'
    204 ```
    205 
    206 **Usage**:
    207 
    208 ```
    209 qmk find [-h] [-km KEYMAP] [-p PRINT] [-f FILTER]
    210 
    211 options:
    212   -km KEYMAP, --keymap KEYMAP
    213                         The keymap name to build. Default is 'default'.
    214   -p PRINT, --print PRINT
    215                         For each matched target, print the value of the supplied info.json key. May be passed multiple times.
    216   -f FILTER, --filter FILTER
    217                         Filter the list of keyboards based on their info.json data. Accepts the formats key=value, function(key), or function(key,value), eg. 'features.rgblight=true'. Valid functions are 'absent', 'contains', 'exists' and 'length'. May be passed multiple times; all filters need to match. Value may include wildcards such as '*' and '?'.
    218 ```
    219 
    220 ## `qmk console`
    221 
    222 This command lets you connect to keyboard consoles to get debugging messages. It only works if your keyboard firmware has been compiled with `CONSOLE_ENABLE=yes`.
    223 
    224 **Usage**:
    225 
    226 ```
    227 qmk console [-d <pid>:<vid>[:<index>]] [-l] [-n] [-t] [-w <seconds>]
    228 ```
    229 
    230 **Examples**:
    231 
    232 Connect to all available keyboards and show their console messages:
    233 
    234 ```
    235 qmk console
    236 ```
    237 
    238 List all devices:
    239 
    240 ```
    241 qmk console -l
    242 ```
    243 
    244 Show only messages from clueboard/66/rev3 keyboards:
    245 
    246 ```
    247 qmk console -d C1ED:2370
    248 ```
    249 
    250 Show only messages from the second clueboard/66/rev3:
    251 
    252 ```
    253 qmk console -d C1ED:2370:2
    254 ```
    255 
    256 Show timestamps and VID:PID instead of names:
    257 
    258 ```
    259 qmk console -n -t
    260 ```
    261 
    262 Disable bootloader messages:
    263 
    264 ```
    265 qmk console --no-bootloaders
    266 ```
    267 
    268 ## `qmk doctor`
    269 
    270 This command examines your environment and alerts you to potential build or flash problems. It can fix many of them if you want it to.
    271 
    272 **Usage**:
    273 
    274 ```
    275 qmk doctor [-y] [-n]
    276 ```
    277 
    278 **Examples**:
    279 
    280 Check your environment for problems and prompt to fix them:
    281 
    282 ```
    283 qmk doctor
    284 ```
    285 
    286 Check your environment and automatically fix any problems found:
    287 
    288 ```
    289 qmk doctor -y
    290 ```
    291 
    292 Check your environment and report problems only:
    293 
    294 ```
    295 qmk doctor -n
    296 ```
    297 
    298 ## `qmk format-json`
    299 
    300 Formats a JSON file in a (mostly) human-friendly way. Will usually correctly detect the format of the JSON (info.json or keymap.json) but you can override this with `--format` if necessary.
    301 
    302 **Usage**:
    303 
    304 ```
    305 qmk format-json [-f FORMAT] <json_file>
    306 ```
    307 
    308 ## `qmk info`
    309 
    310 Displays information about keyboards and keymaps in QMK. You can use this to get information about a keyboard, show the layouts, display the underlying key matrix, or to pretty-print JSON keymaps.
    311 
    312 **Usage**:
    313 
    314 ```
    315 qmk info [-f FORMAT] [-m] [-l] [-km KEYMAP] [-kb KEYBOARD]
    316 ```
    317 
    318 This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
    319 
    320 **Examples**:
    321 
    322 Show basic information for a keyboard:
    323 
    324 ```
    325 qmk info -kb planck/rev5
    326 ```
    327 
    328 Show the matrix for a keyboard:
    329 
    330 ```
    331 qmk info -kb ergodox_ez -m
    332 ```
    333 
    334 Show a JSON keymap for a keyboard:
    335 
    336 ```
    337 qmk info -kb clueboard/california -km default
    338 ```
    339 
    340 ## `qmk json2c`
    341 
    342 Creates a keymap.c from a QMK Configurator export.
    343 
    344 **Usage**:
    345 
    346 ```
    347 qmk json2c [-o OUTPUT] filename
    348 ```
    349 
    350 ## `qmk c2json`
    351 
    352 Creates a keymap.json from a keymap.c.
    353 
    354 **Note:** Parsing C source files is not easy, therefore this subcommand may not work with your keymap. In some cases not using the C pre-processor helps.
    355 
    356 **Usage**:
    357 
    358 ```
    359 qmk c2json -km KEYMAP -kb KEYBOARD [-q] [--no-cpp] [-o OUTPUT] filename
    360 ```
    361 
    362 **Examples**:
    363 
    364 ```
    365 qmk c2json -km default -kb handwired/dactyl_promicro
    366 ```
    367 
    368 or with filename:
    369 
    370 ```
    371 qmk c2json keyboards/handwired/dactyl_promicro/keymaps/default/keymap.c
    372 ```
    373 
    374 ## `qmk lint`
    375 
    376 Checks over a keyboard and/or keymap and highlights common errors, problems, and anti-patterns.
    377 
    378 **Usage**:
    379 
    380 ```
    381 qmk lint [-km KEYMAP] [-kb KEYBOARD] [--strict]
    382 ```
    383 
    384 This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
    385 
    386 **Examples**:
    387 
    388 Do a basic lint check:
    389 
    390 ```
    391 qmk lint -kb rominronin/katana60/rev2
    392 ```
    393 
    394 ## `qmk list-keyboards`
    395 
    396 This command lists all the keyboards currently defined in `qmk_firmware`
    397 
    398 **Usage**:
    399 
    400 ```
    401 qmk list-keyboards
    402 ```
    403 
    404 ## `qmk list-keymaps`
    405 
    406 This command lists all the keymaps for a specified keyboard (and revision).
    407 
    408 This command is directory aware. It will automatically fill in KEYBOARD if you are in a keyboard directory.
    409 
    410 **Usage**:
    411 
    412 ```
    413 qmk list-keymaps -kb planck/ez
    414 ```
    415 
    416 ## `qmk migrate`
    417 
    418 This command searches for legacy code that can be converted to the new `info.json` format and adds it to the specified keyboard's `info.json`.
    419 
    420 **Usage**:
    421 
    422 ```
    423 qmk migrate [-h] -kb KEYBOARD [-f FILTER]
    424 ```
    425 
    426 ## `qmk new-keyboard`
    427 
    428 This command creates a new keyboard based on available templates.
    429 
    430 Any arguments that are not provided will prompt for input. If `-u` is not passed and `user.name` is set in .gitconfig, it will be used as the default username in the prompt.
    431 
    432 **Usage**:
    433 
    434 ```
    435 qmk new-keyboard [-kb KEYBOARD] [-t {atmega32u4,STM32F303,etc}] [-l {60_ansi,75_iso,etc}] -u USERNAME
    436 ```
    437 
    438 ## `qmk new-keymap`
    439 
    440 This command creates a new keymap based on a keyboard's existing default keymap.
    441 
    442 This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
    443 
    444 **Usage**:
    445 
    446 ```
    447 qmk new-keymap [-kb KEYBOARD] [-km KEYMAP]
    448 ```
    449 
    450 ## `qmk clean`
    451 
    452 This command cleans up the `.build` folder. If `--all` is passed, any .hex or .bin files present in the `qmk_firmware` directory will also be deleted.
    453 
    454 **Usage**:
    455 
    456 ```
    457 qmk clean [-a]
    458 ```
    459 
    460 ## `qmk via2json`
    461 
    462 This command an generate a keymap.json from a VIA keymap backup. Both the layers and the macros are converted, enabling users to easily move away from a VIA-enabled firmware without writing any code or reimplementing their keymaps in QMK Configurator.
    463 
    464 **Usage**:
    465 
    466 ```
    467 qmk via2json -kb KEYBOARD [-l LAYOUT] [-km KEYMAP] [-o OUTPUT] filename
    468 ```
    469 
    470 **Example:**
    471 
    472 ```
    473 $ qmk via2json -kb ai03/polaris -o polaris_keymap.json polaris_via_backup.json
    474 Ψ Wrote keymap to /home/you/qmk_firmware/polaris_keymap.json
    475 ```
    476 
    477 ## `qmk import-keyboard`
    478 
    479 This command imports a data-driven `info.json` keyboard into the repo.
    480 
    481 **Usage**:
    482 
    483 ```
    484 usage: qmk import-keyboard [-h] filename
    485 ```
    486 
    487 **Example:**
    488 
    489 ```
    490 $ qmk import-keyboard ~/Downloads/forever60.json
    491 Ψ Importing forever60.json.
    492 
    493 Ψ Imported a new keyboard named forever60.
    494 Ψ To start working on things, `cd` into keyboards/forever60,
    495 Ψ or open the directory in your preferred text editor.
    496 Ψ And build with qmk compile -kb forever60 -km default.
    497 ```
    498 
    499 ## `qmk import-keymap`
    500 
    501 This command imports a data-driven `keymap.json` keymap into the repo.
    502 
    503 **Usage**:
    504 
    505 ```
    506 usage: qmk import-keymap [-h] filename
    507 ```
    508 
    509 **Example:**
    510 
    511 ```
    512 qmk import-keymap ~/Downloads/asdf2.json
    513 Ψ Importing asdf2.json.
    514 
    515 Ψ Imported a new keymap named asdf2.
    516 Ψ To start working on things, `cd` into keyboards/takashicompany/dogtag/keymaps/asdf2,
    517 Ψ or open the directory in your preferred text editor.
    518 Ψ And build with qmk compile -kb takashicompany/dogtag -km asdf2.
    519 ```
    520 
    521 ## `qmk import-kbfirmware`
    522 
    523 This command creates a new keyboard based on a [Keyboard Firmware Builder](https://kbfirmware.com/) export.
    524 
    525 **Usage**:
    526 
    527 ```
    528 usage: qmk import-kbfirmware [-h] filename
    529 ```
    530 
    531 **Example:**
    532 
    533 ```
    534 $ qmk import-kbfirmware ~/Downloads/gh62.json
    535 Ψ Importing gh62.json.
    536 
    537 ⚠ Support here is basic - Consider using 'qmk new-keyboard' instead
    538 Ψ Imported a new keyboard named gh62.
    539 Ψ To start working on things, `cd` into keyboards/gh62,
    540 Ψ or open the directory in your preferred text editor.
    541 Ψ And build with qmk compile -kb gh62 -km default.
    542 ```
    543 
    544 ---
    545 
    546 # External Userspace Commands
    547 
    548 ## `qmk userspace-add`
    549 
    550 This command adds a keyboard/keymap to the External Userspace build targets.
    551 
    552 **Usage**:
    553 
    554 ```
    555 qmk userspace-add [-h] [-km KEYMAP] [-kb KEYBOARD] [builds ...]
    556 
    557 positional arguments:
    558   builds                List of builds in form <keyboard>:<keymap>, or path to a keymap JSON file.
    559 
    560 options:
    561   -h, --help            show this help message and exit
    562   -km KEYMAP, --keymap KEYMAP
    563                         The keymap to build a firmware for. Ignored when a configurator export is supplied.
    564   -kb KEYBOARD, --keyboard KEYBOARD
    565                         The keyboard to build a firmware for. Ignored when a configurator export is supplied.
    566 ```
    567 
    568 **Example**:
    569 
    570 ```
    571 $ qmk userspace-add -kb planck/rev6 -km default
    572 Ψ Added planck/rev6:default to userspace build targets
    573 Ψ Saved userspace file to /home/you/qmk_userspace/qmk.json
    574 ```
    575 
    576 ## `qmk userspace-remove`
    577 
    578 This command removes a keyboard/keymap from the External Userspace build targets.
    579 
    580 **Usage**:
    581 
    582 ```
    583 qmk userspace-remove [-h] [-km KEYMAP] [-kb KEYBOARD] [builds ...]
    584 
    585 positional arguments:
    586   builds                List of builds in form <keyboard>:<keymap>, or path to a keymap JSON file.
    587 
    588 options:
    589   -h, --help            show this help message and exit
    590   -km KEYMAP, --keymap KEYMAP
    591                         The keymap to build a firmware for. Ignored when a configurator export is supplied.
    592   -kb KEYBOARD, --keyboard KEYBOARD
    593                         The keyboard to build a firmware for. Ignored when a configurator export is supplied.
    594 ```
    595 
    596 **Example**:
    597 
    598 ```
    599 $ qmk userspace-remove -kb planck/rev6 -km default
    600 Ψ Removed planck/rev6:default from userspace build targets
    601 Ψ Saved userspace file to /home/you/qmk_userspace/qmk.json
    602 ```
    603 
    604 ## `qmk userspace-list`
    605 
    606 This command lists the External Userspace build targets.
    607 
    608 **Usage**:
    609 
    610 ```
    611 qmk userspace-list [-h] [-e]
    612 
    613 options:
    614   -h, --help    show this help message and exit
    615   -e, --expand  Expands any use of `all` for either keyboard or keymap.
    616 ```
    617 
    618 **Example**:
    619 
    620 ```
    621 $ qmk userspace-list
    622 Ψ Current userspace build targets:
    623 Ψ Keyboard: planck/rev6, keymap: you
    624 Ψ Keyboard: clueboard/66/rev3, keymap: you
    625 ```
    626 
    627 ## `qmk userspace-compile`
    628 
    629 This command compiles all the External Userspace build targets.
    630 
    631 **Usage**:
    632 
    633 ```
    634 qmk userspace-compile [-h] [-e ENV] [-p] [-n] [-c] [-j PARALLEL] [-t]
    635 
    636 options:
    637   -h, --help            show this help message and exit
    638   -e, --env ENV         Set a variable to be passed to make. May be passed multiple times.
    639   -p, --print-failures  Print failed builds.
    640   -n, --dry-run         Don't actually build, just show the commands to be run.
    641   -c, --clean           Remove object files before compiling.
    642   -j, --parallel PARALLEL
    643                         Set the number of parallel make jobs; 0 means unlimited.
    644   -t, --no-temp         Remove temporary files during build.
    645 ```
    646 
    647 **Example**:
    648 
    649 ```
    650 $ qmk userspace-compile
    651 Ψ Preparing target list...
    652 Build planck/rev6:you                                                  [OK]
    653 Build clueboard/66/rev3:you                                            [OK]
    654 ```
    655 
    656 ## `qmk userspace-doctor`
    657 
    658 This command examines your environment and alerts you to potential problems related to External Userspace.
    659 
    660 **Example**:
    661 
    662 ```
    663 % qmk userspace-doctor
    664 Ψ QMK home: /home/you/qmk_userspace/qmk_firmware
    665 Ψ Testing userspace candidate: /home/you/qmk_userspace -- Valid `qmk.json`
    666 Ψ QMK userspace: /home/you/qmk_userspace
    667 Ψ Userspace enabled: True
    668 ```
    669 
    670 ---
    671 
    672 # Developer Commands
    673 
    674 ## `qmk format-text`
    675 
    676 This command formats text files to have proper line endings.
    677 
    678 Every text file in the repository needs to have Unix (LF) line ending.
    679 If you are working on **Windows**, you must ensure that line endings are corrected in order to get your PRs merged.
    680 
    681 ```
    682 qmk format-text
    683 ```
    684 
    685 ## `qmk format-c`
    686 
    687 This command formats C code using clang-format.
    688 
    689 Run it with no arguments to format all core code that has been changed. Default checks `origin/master` with `git diff`, branch can be changed using `-b <branch_name>`
    690 
    691 Run it with `-a` to format all core code, or pass filenames on the command line to run it on specific files.
    692 
    693 **Usage for specified files**:
    694 
    695 ```
    696 qmk format-c [file1] [file2] [...] [fileN]
    697 ```
    698 
    699 **Usage for all core files**:
    700 
    701 ```
    702 qmk format-c -a
    703 ```
    704 
    705 **Usage for only changed files against origin/master**:
    706 
    707 ```
    708 qmk format-c
    709 ```
    710 
    711 **Usage for only changed files against branch_name**:
    712 
    713 ```
    714 qmk format-c -b branch_name
    715 ```
    716 
    717 ## `qmk docs`
    718 
    719 This command starts a local HTTP server which you can use for browsing or improving the docs, and provides live reload capability whilst editing. Default port is 8936.
    720 Use the `-b`/`--browser` flag to automatically open the local webserver in your default browser.
    721 
    722 Requires `node` and `yarn` to be installed as prerequisites.
    723 
    724 **Usage**:
    725 
    726 ```
    727 usage: qmk docs [-h] [-b] [-p PORT]
    728 
    729 options:
    730   -h, --help       show this help message and exit
    731   -b, --browser    Open the docs in the default browser.
    732   -p, --port PORT  Port number to use.
    733 ```
    734 
    735 ## `qmk generate-docs`
    736 
    737 This command generates QMK documentation for production.
    738 Use the `-s`/`--serve` flag to also serve the static site on port 4173 once built. Note that this does not provide live reloading; use `qmk docs` instead for development purposes.
    739 
    740 This command requires `node` and `yarn` to be installed as prerequisites, and requires the operating system to support symlinks.
    741 
    742 **Usage**:
    743 
    744 ```
    745 usage: qmk generate-docs [-h] [-s]
    746 
    747 options:
    748   -h, --help   show this help message and exit
    749   -s, --serve  Serves the generated docs once built.
    750 ```
    751 
    752 ## `qmk generate-rgb-breathe-table`
    753 
    754 This command generates a lookup table (LUT) header file for the [RGB Lighting](features/rgblight) feature's breathing animation. Place this file in your keyboard or keymap directory as `rgblight_breathe_table.h` to override the default LUT in `quantum/rgblight/`.
    755 
    756 **Usage**:
    757 
    758 ```
    759 qmk generate-rgb-breathe-table [-q] [-o OUTPUT] [-m MAX] [-c CENTER]
    760 ```
    761 
    762 ## `qmk kle2json`
    763 
    764 This command allows you to convert from raw KLE data to QMK Configurator JSON. It accepts either an absolute file path, or a file name in the current directory. By default it will not overwrite `info.json` if it is already present. Use the `-f` or `--force` flag to overwrite.
    765 
    766 **Usage**:
    767 
    768 ```
    769 qmk kle2json [-f] <filename>
    770 ```
    771 
    772 **Examples**:
    773 
    774 ```
    775 $ qmk kle2json kle.txt
    776 ☒ File info.json already exists, use -f or --force to overwrite.
    777 ```
    778 
    779 ```
    780 $ qmk kle2json -f kle.txt -f
    781 Ψ Wrote out to info.json
    782 ```
    783 
    784 ## `qmk format-python`
    785 
    786 This command formats python code in `qmk_firmware`.
    787 
    788 **Usage**:
    789 
    790 ```
    791 qmk format-python
    792 ```
    793 
    794 ## `qmk pytest`
    795 
    796 This command runs the python test suite. If you make changes to python code you should ensure this runs successfully.
    797 
    798 **Usage**:
    799 
    800 ```
    801 qmk pytest [-t TEST]
    802 ```
    803 
    804 **Examples**:
    805 
    806 Run entire test suite:
    807 
    808 ```
    809 qmk pytest
    810 ```
    811 
    812 Run test group:
    813 
    814 ```
    815 qmk pytest -t qmk.tests.test_cli_commands
    816 ```
    817 
    818 Run single test:
    819 
    820 ```
    821 qmk pytest -t qmk.tests.test_cli_commands.test_c2json
    822 qmk pytest -t qmk.tests.test_qmk_path
    823 ```
    824 
    825 ## `qmk painter-convert-graphics`
    826 
    827 This command converts images to a format usable by QMK, i.e. the QGF File Format. See the [Quantum Painter](quantum_painter#quantum-painter-cli) documentation for more information on this command.
    828 
    829 ## `qmk painter-make-font-image`
    830 
    831 This command converts a TTF font to an intermediate format for editing, before converting to the QFF File Format. See the [Quantum Painter](quantum_painter#quantum-painter-cli) documentation for more information on this command.
    832 
    833 ## `qmk painter-convert-font-image`
    834 
    835 This command converts an intermediate font image to the QFF File Format. See the [Quantum Painter](quantum_painter#quantum-painter-cli) documentation for more information on this command.
    836 
    837 ## `qmk test-c`
    838 
    839 This command runs the C unit test suite. If you make changes to C code you should ensure this runs successfully.
    840 
    841 **Usage**:
    842 
    843 ```
    844 qmk test-c [-h] [-t TEST] [-l] [-c] [-e ENV] [-j PARALLEL]
    845 
    846 options:
    847   -h, --help            show this help message and exit
    848   -t TEST, --test TEST  Test to run from the available list. Supports wildcard globs. May be passed multiple times.
    849   -l, --list            List available tests.
    850   -c, --clean           Remove object files before compiling.
    851   -e ENV, --env ENV     Set a variable to be passed to make. May be passed multiple times.
    852   -j PARALLEL, --parallel PARALLEL
    853                         Set the number of parallel make jobs; 0 means unlimited.
    854 ```
    855 
    856 **Examples**:
    857 
    858 Run entire test suite:
    859 
    860 ```
    861 qmk test-c
    862 ```
    863 
    864 List available tests:
    865 
    866 ```
    867 qmk test-c --list
    868 ```
    869 
    870 Run matching test:
    871 
    872 ```
    873 qmk test-c --test unicode*
    874 ```
    875 
    876 Run single test:
    877 
    878 ```
    879 qmk test-c --test basic
    880 ```
    881 
    882 ## `qmk generate-compilation-database`
    883 
    884 **Usage**:
    885 
    886 ```
    887 qmk generate-compilation-database [-kb KEYBOARD] [-km KEYMAP]
    888 ```
    889 
    890 This command has been deprecated as it cannot take into account configurables such as [converters](/feature_converters) or environment variables normally specified on the command line; please use the `--compiledb` flag with `qmk compile` instead.