2019-07-15 19:14:27 +00:00
# QMK CLI
This page describes how to setup and use the QMK CLI.
# Overview
The QMK CLI makes building and working with QMK keyboards easier. We have provided a number of commands to help you work with QMK:
2019-08-25 18:58:24 +00:00
* `qmk compile`
* `qmk doctor`
2019-07-15 19:14:27 +00:00
# Setup
Simply add the `qmk_firmware/bin` directory to your `PATH` . You can run the `qmk` commands from any directory.
```
export PATH=$PATH:$HOME/qmk_firmware/bin
```
You may want to add this to your `.profile` , `.bash_profile` , `.zsh_profile` , or other shell startup scripts.
# Commands
2019-08-25 18:58:24 +00:00
## `qmk compile`
2019-07-15 19:14:27 +00:00
2019-08-25 18:58:24 +00:00
This command allows you to compile firmware from any directory. You can compile JSON exports from < https: / / config . qmk . fm > or compile keymaps in the repo.
2019-07-15 19:14:27 +00:00
2019-08-25 18:58:24 +00:00
**Usage for Configurator Exports**:
2019-07-15 19:14:27 +00:00
```
2019-08-25 18:58:24 +00:00
qmk compile < configuratorExport.json >
```
**Usage for Keymaps**:
```
qmk compile -kb < keyboard_name > -km < keymap_name >
2019-07-15 19:14:27 +00:00
```
2019-08-22 17:18:52 +00:00
## `qmk cformat`
This command formats C code using clang-format. Run it with no arguments to format all core code, or pass filenames on the command line to run it on specific files.
**Usage**:
```
qmk cformat [file1] [file2] [...] [fileN]
```