logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

cli_commands.md (22835B)


  1. # QMK CLI Commands
  2. # User Commands
  3. ## `qmk compile`
  4. 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.
  5. This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
  6. **Usage for Configurator Exports**:
  7. ```
  8. qmk compile [-c] <configuratorExport.json>
  9. ```
  10. **Usage for Keymaps**:
  11. ```
  12. qmk compile [-c] [-e <var>=<value>] [-j <num_jobs>] [--compiledb] -kb <keyboard> -km <keymap>
  13. ```
  14. **Usage in Keyboard Directory**:
  15. Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap <keymap>`
  16. ```
  17. qmk compile
  18. ```
  19. **Usage for building all keyboards that support a specific keymap**:
  20. ```
  21. qmk compile -kb all -km <keymap>
  22. ```
  23. **Example**:
  24. ```
  25. $ qmk config compile.keymap=default
  26. $ cd ~/qmk_firmware/keyboards/planck/rev6
  27. $ qmk compile
  28. Ψ Compiling keymap with make planck/rev6:default
  29. ...
  30. ```
  31. or with optional keymap argument
  32. ```
  33. $ cd ~/qmk_firmware/keyboards/clueboard/66/rev4
  34. $ qmk compile -km 66_iso
  35. Ψ Compiling keymap with make clueboard/66/rev4:66_iso
  36. ...
  37. ```
  38. or in keymap directory
  39. ```
  40. $ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak
  41. $ qmk compile
  42. Ψ Compiling keymap with make gh60/satan:colemak
  43. ...
  44. ```
  45. **Usage in Layout Directory**:
  46. Must be under `qmk_firmware/layouts/`, and in a keymap folder.
  47. ```
  48. qmk compile -kb <keyboard>
  49. ```
  50. **Example**:
  51. ```
  52. $ cd ~/qmk_firmware/layouts/community/60_ansi/mechmerlin-ansi
  53. $ qmk compile -kb dz60
  54. Ψ Compiling keymap with make dz60:mechmerlin-ansi
  55. ...
  56. ```
  57. **Parallel Compilation**:
  58. It is possible to speed up compilation by adding the `-j`/`--parallel` flag.
  59. ```
  60. qmk compile -j <num_jobs> -kb <keyboard>
  61. ```
  62. 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.
  63. ```
  64. qmk compile -j 0 -kb <keyboard>
  65. ```
  66. **Compilation Database**:
  67. Creates a `compile_commands.json` file.
  68. 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.
  69. **Example:**
  70. ```
  71. $ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak
  72. $ qmk compile --compiledb
  73. Ψ Making clean
  74. Ψ Gathering build instructions from make ........
  75. Ψ Found 63 compile commands
  76. Ψ Writing build database to /Users/you/src/qmk_firmware/compile_commands.json
  77. Ψ Compiling keymap with make ........
  78. ... build log continues ...
  79. ```
  80. ## `qmk flash`
  81. 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.
  82. This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
  83. This command can also flash binary firmware files (hex or bin) such as the ones produced by [Configurator](https://config.qmk.fm).
  84. **Usage for Configurator Exports**:
  85. ```
  86. qmk flash [-bl <bootloader>] [-c] [-e <var>=<value>] [-j <num_jobs>] <configuratorExport.json>
  87. ```
  88. **Usage for Keymaps**:
  89. ```
  90. qmk flash -kb <keyboard> -km <keymap_name> [-bl <bootloader>] [-c] [-e <var>=<value>] [-j <num_jobs>]
  91. ```
  92. **Usage for pre-compiled firmwares**:
  93. **Note**: The microcontroller needs to be specified (`-m` argument) for keyboards with the following bootloaders:
  94. * HalfKay
  95. * QMK HID
  96. * USBaspLoader
  97. ISP flashing is also supported with the following flashers and require the microcontroller to be specified:
  98. * USBasp
  99. * USBtinyISP
  100. ```
  101. qmk flash [-m <microcontroller>] <compiledFirmware.[bin|hex]>
  102. ```
  103. **Listing the Bootloaders**
  104. ```
  105. qmk flash -b
  106. ```
  107. ## `qmk config`
  108. This command lets you configure the behavior of QMK. For the full `qmk config` documentation see [CLI Configuration](cli_configuration).
  109. **Usage**:
  110. ```
  111. qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN]
  112. ```
  113. ## `qmk cd`
  114. This command opens a new shell in your `qmk_firmware` directory.
  115. Note that if you are already somewhere within `QMK_HOME` (for example, the `keyboards/` folder), nothing will happen.
  116. To exit out into the parent shell, simply type `exit`.
  117. **Usage**:
  118. ```
  119. qmk cd
  120. ```
  121. ## `qmk find`
  122. 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.
  123. For example, one could search for all keyboards powered by the STM32F411 microcontroller:
  124. ```
  125. qmk find -f 'processor==STM32F411'
  126. ```
  127. The list can be further constrained by passing additional filter expressions:
  128. ```
  129. qmk find -f 'processor==STM32F411' -f 'features.rgb_matrix==true'
  130. ```
  131. The following filter expressions are supported:
  132. - `key == value`: Match targets where `key` is equal to `value`. May include wildcards such as `*` and `?`.
  133. - `key != value`: Match targets where `key` is not `value`. May include wildcards such as `*` and `?`.
  134. - `key < value`: Match targets where `key` is a number less than `value`.
  135. - `key > value`: Match targets where `key` is a number greater than `value`.
  136. - `key <= value`: Match targets where `key` is a number less than or equal to `value`.
  137. - `key >= value`: Match targets where `key` is a number greater than or equal to `value`.
  138. - `exists(key)`: Match targets where `key` is present.
  139. - `absent(key)`: Match targets where `key` is not present.
  140. - `contains(key, value)`: Match targets where `key` contains `value`. Can be used for strings, arrays and object keys.
  141. - `length(key, value)`: Match targets where the length of `key` is `value`. Can be used for strings, arrays and objects.
  142. You can also list arbitrary values for each matched target with `--print`:
  143. ```
  144. qmk find -f 'processor==STM32F411' -p 'keyboard_name' -p 'features.rgb_matrix'
  145. ```
  146. **Usage**:
  147. ```
  148. qmk find [-h] [-km KEYMAP] [-p PRINT] [-f FILTER]
  149. options:
  150. -km KEYMAP, --keymap KEYMAP
  151. The keymap name to build. Default is 'default'.
  152. -p PRINT, --print PRINT
  153. For each matched target, print the value of the supplied info.json key. May be passed multiple times.
  154. -f FILTER, --filter FILTER
  155. 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 '?'.
  156. ```
  157. ## `qmk console`
  158. 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`.
  159. **Usage**:
  160. ```
  161. qmk console [-d <pid>:<vid>[:<index>]] [-l] [-n] [-t] [-w <seconds>]
  162. ```
  163. **Examples**:
  164. Connect to all available keyboards and show their console messages:
  165. ```
  166. qmk console
  167. ```
  168. List all devices:
  169. ```
  170. qmk console -l
  171. ```
  172. Show only messages from clueboard/66/rev3 keyboards:
  173. ```
  174. qmk console -d C1ED:2370
  175. ```
  176. Show only messages from the second clueboard/66/rev3:
  177. ```
  178. qmk console -d C1ED:2370:2
  179. ```
  180. Show timestamps and VID:PID instead of names:
  181. ```
  182. qmk console -n -t
  183. ```
  184. Disable bootloader messages:
  185. ```
  186. qmk console --no-bootloaders
  187. ```
  188. ## `qmk doctor`
  189. 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.
  190. **Usage**:
  191. ```
  192. qmk doctor [-y] [-n]
  193. ```
  194. **Examples**:
  195. Check your environment for problems and prompt to fix them:
  196. ```
  197. qmk doctor
  198. ```
  199. Check your environment and automatically fix any problems found:
  200. ```
  201. qmk doctor -y
  202. ```
  203. Check your environment and report problems only:
  204. ```
  205. qmk doctor -n
  206. ```
  207. ## `qmk format-json`
  208. 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.
  209. **Usage**:
  210. ```
  211. qmk format-json [-f FORMAT] <json_file>
  212. ```
  213. ## `qmk info`
  214. 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.
  215. **Usage**:
  216. ```
  217. qmk info [-f FORMAT] [-m] [-l] [-km KEYMAP] [-kb KEYBOARD]
  218. ```
  219. This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
  220. **Examples**:
  221. Show basic information for a keyboard:
  222. ```
  223. qmk info -kb planck/rev5
  224. ```
  225. Show the matrix for a keyboard:
  226. ```
  227. qmk info -kb ergodox_ez -m
  228. ```
  229. Show a JSON keymap for a keyboard:
  230. ```
  231. qmk info -kb clueboard/california -km default
  232. ```
  233. ## `qmk json2c`
  234. Creates a keymap.c from a QMK Configurator export.
  235. **Usage**:
  236. ```
  237. qmk json2c [-o OUTPUT] filename
  238. ```
  239. ## `qmk c2json`
  240. Creates a keymap.json from a keymap.c.
  241. **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.
  242. **Usage**:
  243. ```
  244. qmk c2json -km KEYMAP -kb KEYBOARD [-q] [--no-cpp] [-o OUTPUT] filename
  245. ```
  246. **Examples**:
  247. ```
  248. qmk c2json -km default -kb handwired/dactyl_promicro
  249. ```
  250. or with filename:
  251. ```
  252. qmk c2json keyboards/handwired/dactyl_promicro/keymaps/default/keymap.c
  253. ```
  254. ## `qmk lint`
  255. Checks over a keyboard and/or keymap and highlights common errors, problems, and anti-patterns.
  256. **Usage**:
  257. ```
  258. qmk lint [-km KEYMAP] [-kb KEYBOARD] [--strict]
  259. ```
  260. This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
  261. **Examples**:
  262. Do a basic lint check:
  263. ```
  264. qmk lint -kb rominronin/katana60/rev2
  265. ```
  266. ## `qmk list-keyboards`
  267. This command lists all the keyboards currently defined in `qmk_firmware`
  268. **Usage**:
  269. ```
  270. qmk list-keyboards
  271. ```
  272. ## `qmk list-keymaps`
  273. This command lists all the keymaps for a specified keyboard (and revision).
  274. This command is directory aware. It will automatically fill in KEYBOARD if you are in a keyboard directory.
  275. **Usage**:
  276. ```
  277. qmk list-keymaps -kb planck/ez
  278. ```
  279. ## `qmk migrate`
  280. 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`.
  281. **Usage**:
  282. ```
  283. qmk migrate [-h] -kb KEYBOARD [-f FILTER]
  284. ```
  285. ## `qmk new-keyboard`
  286. This command creates a new keyboard based on available templates.
  287. 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.
  288. **Usage**:
  289. ```
  290. qmk new-keyboard [-kb KEYBOARD] [-t {atmega32u4,STM32F303,etc}] [-l {60_ansi,75_iso,etc}] -u USERNAME
  291. ```
  292. ## `qmk new-keymap`
  293. This command creates a new keymap based on a keyboard's existing default keymap.
  294. This command is directory aware. It will automatically fill in KEYBOARD and/or KEYMAP if you are in a keyboard or keymap directory.
  295. **Usage**:
  296. ```
  297. qmk new-keymap [-kb KEYBOARD] [-km KEYMAP]
  298. ```
  299. ## `qmk clean`
  300. 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.
  301. **Usage**:
  302. ```
  303. qmk clean [-a]
  304. ```
  305. ## `qmk via2json`
  306. 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.
  307. **Usage**:
  308. ```
  309. qmk via2json -kb KEYBOARD [-l LAYOUT] [-km KEYMAP] [-o OUTPUT] filename
  310. ```
  311. **Example:**
  312. ```
  313. $ qmk via2json -kb ai03/polaris -o polaris_keymap.json polaris_via_backup.json
  314. Ψ Wrote keymap to /home/you/qmk_firmware/polaris_keymap.json
  315. ```
  316. ## `qmk import-keyboard`
  317. This command imports a data-driven `info.json` keyboard into the repo.
  318. **Usage**:
  319. ```
  320. usage: qmk import-keyboard [-h] filename
  321. ```
  322. **Example:**
  323. ```
  324. $ qmk import-keyboard ~/Downloads/forever60.json
  325. Ψ Importing forever60.json.
  326. Ψ Imported a new keyboard named forever60.
  327. Ψ To start working on things, `cd` into keyboards/forever60,
  328. Ψ or open the directory in your preferred text editor.
  329. Ψ And build with qmk compile -kb forever60 -km default.
  330. ```
  331. ## `qmk import-keymap`
  332. This command imports a data-driven `keymap.json` keymap into the repo.
  333. **Usage**:
  334. ```
  335. usage: qmk import-keymap [-h] filename
  336. ```
  337. **Example:**
  338. ```
  339. qmk import-keymap ~/Downloads/asdf2.json
  340. Ψ Importing asdf2.json.
  341. Ψ Imported a new keymap named asdf2.
  342. Ψ To start working on things, `cd` into keyboards/takashicompany/dogtag/keymaps/asdf2,
  343. Ψ or open the directory in your preferred text editor.
  344. Ψ And build with qmk compile -kb takashicompany/dogtag -km asdf2.
  345. ```
  346. ## `qmk import-kbfirmware`
  347. This command creates a new keyboard based on a [Keyboard Firmware Builder](https://kbfirmware.com/) export.
  348. **Usage**:
  349. ```
  350. usage: qmk import-kbfirmware [-h] filename
  351. ```
  352. **Example:**
  353. ```
  354. $ qmk import-kbfirmware ~/Downloads/gh62.json
  355. Ψ Importing gh62.json.
  356. ⚠ Support here is basic - Consider using 'qmk new-keyboard' instead
  357. Ψ Imported a new keyboard named gh62.
  358. Ψ To start working on things, `cd` into keyboards/gh62,
  359. Ψ or open the directory in your preferred text editor.
  360. Ψ And build with qmk compile -kb gh62 -km default.
  361. ```
  362. ---
  363. # External Userspace Commands
  364. ## `qmk userspace-add`
  365. This command adds a keyboard/keymap to the External Userspace build targets.
  366. **Usage**:
  367. ```
  368. qmk userspace-add [-h] [-km KEYMAP] [-kb KEYBOARD] [builds ...]
  369. positional arguments:
  370. builds List of builds in form <keyboard>:<keymap>, or path to a keymap JSON file.
  371. options:
  372. -h, --help show this help message and exit
  373. -km KEYMAP, --keymap KEYMAP
  374. The keymap to build a firmware for. Ignored when a configurator export is supplied.
  375. -kb KEYBOARD, --keyboard KEYBOARD
  376. The keyboard to build a firmware for. Ignored when a configurator export is supplied.
  377. ```
  378. **Example**:
  379. ```
  380. $ qmk userspace-add -kb planck/rev6 -km default
  381. Ψ Added planck/rev6:default to userspace build targets
  382. Ψ Saved userspace file to /home/you/qmk_userspace/qmk.json
  383. ```
  384. ## `qmk userspace-remove`
  385. This command removes a keyboard/keymap from the External Userspace build targets.
  386. **Usage**:
  387. ```
  388. qmk userspace-remove [-h] [-km KEYMAP] [-kb KEYBOARD] [builds ...]
  389. positional arguments:
  390. builds List of builds in form <keyboard>:<keymap>, or path to a keymap JSON file.
  391. options:
  392. -h, --help show this help message and exit
  393. -km KEYMAP, --keymap KEYMAP
  394. The keymap to build a firmware for. Ignored when a configurator export is supplied.
  395. -kb KEYBOARD, --keyboard KEYBOARD
  396. The keyboard to build a firmware for. Ignored when a configurator export is supplied.
  397. ```
  398. **Example**:
  399. ```
  400. $ qmk userspace-remove -kb planck/rev6 -km default
  401. Ψ Removed planck/rev6:default from userspace build targets
  402. Ψ Saved userspace file to /home/you/qmk_userspace/qmk.json
  403. ```
  404. ## `qmk userspace-list`
  405. This command lists the External Userspace build targets.
  406. **Usage**:
  407. ```
  408. qmk userspace-list [-h] [-e]
  409. options:
  410. -h, --help show this help message and exit
  411. -e, --expand Expands any use of `all` for either keyboard or keymap.
  412. ```
  413. **Example**:
  414. ```
  415. $ qmk userspace-list
  416. Ψ Current userspace build targets:
  417. Ψ Keyboard: planck/rev6, keymap: you
  418. Ψ Keyboard: clueboard/66/rev3, keymap: you
  419. ```
  420. ## `qmk userspace-compile`
  421. This command compiles all the External Userspace build targets.
  422. **Usage**:
  423. ```
  424. qmk userspace-compile [-h] [-e ENV] [-n] [-c] [-j PARALLEL] [-t]
  425. options:
  426. -h, --help show this help message and exit
  427. -e ENV, --env ENV Set a variable to be passed to make. May be passed multiple times.
  428. -n, --dry-run Don't actually build, just show the commands to be run.
  429. -c, --clean Remove object files before compiling.
  430. -j PARALLEL, --parallel PARALLEL
  431. Set the number of parallel make jobs; 0 means unlimited.
  432. -t, --no-temp Remove temporary files during build.
  433. ```
  434. **Example**:
  435. ```
  436. $ qmk userspace-compile
  437. Ψ Preparing target list...
  438. Build planck/rev6:you [OK]
  439. Build clueboard/66/rev3:you [OK]
  440. ```
  441. ## `qmk userspace-doctor`
  442. This command examines your environment and alerts you to potential problems related to External Userspace.
  443. **Example**:
  444. ```
  445. % qmk userspace-doctor
  446. Ψ QMK home: /home/you/qmk_userspace/qmk_firmware
  447. Ψ Testing userspace candidate: /home/you/qmk_userspace -- Valid `qmk.json`
  448. Ψ QMK userspace: /home/you/qmk_userspace
  449. Ψ Userspace enabled: True
  450. ```
  451. ---
  452. # Developer Commands
  453. ## `qmk format-text`
  454. This command formats text files to have proper line endings.
  455. Every text file in the repository needs to have Unix (LF) line ending.
  456. If you are working on **Windows**, you must ensure that line endings are corrected in order to get your PRs merged.
  457. ```
  458. qmk format-text
  459. ```
  460. ## `qmk format-c`
  461. This command formats C code using clang-format.
  462. 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>`
  463. Run it with `-a` to format all core code, or pass filenames on the command line to run it on specific files.
  464. **Usage for specified files**:
  465. ```
  466. qmk format-c [file1] [file2] [...] [fileN]
  467. ```
  468. **Usage for all core files**:
  469. ```
  470. qmk format-c -a
  471. ```
  472. **Usage for only changed files against origin/master**:
  473. ```
  474. qmk format-c
  475. ```
  476. **Usage for only changed files against branch_name**:
  477. ```
  478. qmk format-c -b branch_name
  479. ```
  480. ## `qmk docs`
  481. 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.
  482. Use the `-b`/`--browser` flag to automatically open the local webserver in your default browser.
  483. Requires `node` and `yarn` to be installed as prerequisites.
  484. **Usage**:
  485. ```
  486. usage: qmk docs [-h] [-b] [-p PORT]
  487. options:
  488. -h, --help show this help message and exit
  489. -b, --browser Open the docs in the default browser.
  490. -p, --port PORT Port number to use.
  491. ```
  492. ## `qmk generate-docs`
  493. This command generates QMK documentation for production.
  494. 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.
  495. This command requires `node` and `yarn` to be installed as prerequisites, and requires the operating system to support symlinks.
  496. **Usage**:
  497. ```
  498. usage: qmk generate-docs [-h] [-s]
  499. options:
  500. -h, --help show this help message and exit
  501. -s, --serve Serves the generated docs once built.
  502. ```
  503. ## `qmk generate-rgb-breathe-table`
  504. 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/`.
  505. **Usage**:
  506. ```
  507. qmk generate-rgb-breathe-table [-q] [-o OUTPUT] [-m MAX] [-c CENTER]
  508. ```
  509. ## `qmk kle2json`
  510. 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.
  511. **Usage**:
  512. ```
  513. qmk kle2json [-f] <filename>
  514. ```
  515. **Examples**:
  516. ```
  517. $ qmk kle2json kle.txt
  518. ☒ File info.json already exists, use -f or --force to overwrite.
  519. ```
  520. ```
  521. $ qmk kle2json -f kle.txt -f
  522. Ψ Wrote out to info.json
  523. ```
  524. ## `qmk format-python`
  525. This command formats python code in `qmk_firmware`.
  526. **Usage**:
  527. ```
  528. qmk format-python
  529. ```
  530. ## `qmk pytest`
  531. This command runs the python test suite. If you make changes to python code you should ensure this runs successfully.
  532. **Usage**:
  533. ```
  534. qmk pytest [-t TEST]
  535. ```
  536. **Examples**:
  537. Run entire test suite:
  538. ```
  539. qmk pytest
  540. ```
  541. Run test group:
  542. ```
  543. qmk pytest -t qmk.tests.test_cli_commands
  544. ```
  545. Run single test:
  546. ```
  547. qmk pytest -t qmk.tests.test_cli_commands.test_c2json
  548. qmk pytest -t qmk.tests.test_qmk_path
  549. ```
  550. ## `qmk painter-convert-graphics`
  551. 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.
  552. ## `qmk painter-make-font-image`
  553. 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.
  554. ## `qmk painter-convert-font-image`
  555. 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.
  556. ## `qmk test-c`
  557. This command runs the C unit test suite. If you make changes to C code you should ensure this runs successfully.
  558. **Usage**:
  559. ```
  560. qmk test-c [-h] [-t TEST] [-l] [-c] [-e ENV] [-j PARALLEL]
  561. options:
  562. -h, --help show this help message and exit
  563. -t TEST, --test TEST Test to run from the available list. Supports wildcard globs. May be passed multiple times.
  564. -l, --list List available tests.
  565. -c, --clean Remove object files before compiling.
  566. -e ENV, --env ENV Set a variable to be passed to make. May be passed multiple times.
  567. -j PARALLEL, --parallel PARALLEL
  568. Set the number of parallel make jobs; 0 means unlimited.
  569. ```
  570. **Examples**:
  571. Run entire test suite:
  572. ```
  573. qmk test-c
  574. ```
  575. List available tests:
  576. ```
  577. qmk test-c --list
  578. ```
  579. Run matching test:
  580. ```
  581. qmk test-c --test unicode*
  582. ```
  583. Run single test:
  584. ```
  585. qmk test-c --test basic
  586. ```
  587. ## `qmk generate-compilation-database`
  588. **Usage**:
  589. ```
  590. qmk generate-compilation-database [-kb KEYBOARD] [-km KEYMAP]
  591. ```
  592. 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.