aboutsummaryrefslogtreecommitdiff
path: root/docs/cli_commands.md
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2020-03-15 07:48:44 -0700
committerGitHub <noreply@github.com>2020-03-15 07:48:44 -0700
commitdc68418660e9ba1d21e391548038652b793790a7 (patch)
tree51cd5c8f05a5ab177f50c31718d88cbe0d0e1154 /docs/cli_commands.md
parent499d7c8ce610a3c150c64eaacbca3038f7796cc5 (diff)
downloadqmk_firmware-dc68418660e9ba1d21e391548038652b793790a7.tar.gz
qmk_firmware-dc68418660e9ba1d21e391548038652b793790a7.zip
Fix some broken links in the docs (#8394)
* fix some broken links * remove duplicate and confusing material from cli.md * Switch brazil to the 2 letter country code * Update docs/_langs.md Co-Authored-By: Ryan <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'docs/cli_commands.md')
-rw-r--r--docs/cli_commands.md247
1 files changed, 247 insertions, 0 deletions
diff --git a/docs/cli_commands.md b/docs/cli_commands.md
new file mode 100644
index 000000000..bffa8263e
--- /dev/null
+++ b/docs/cli_commands.md
@@ -0,0 +1,247 @@
1# QMK CLI Commands
2
3# CLI Commands
4
5## `qmk cformat`
6
7This command formats C code using clang-format.
8
9Run 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>`
10
11Run it with `-a` to format all core code, or pass filenames on the command line to run it on specific files.
12
13**Usage for specified files**:
14
15```
16qmk cformat [file1] [file2] [...] [fileN]
17```
18
19**Usage for all core files**:
20
21```
22qmk cformat -a
23```
24
25**Usage for only changed files against origin/master**:
26
27```
28qmk cformat
29```
30
31**Usage for only changed files against branch_name**:
32
33```
34qmk cformat -b branch_name
35```
36
37## `qmk compile`
38
39This 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.
40
41**Usage for Configurator Exports**:
42
43```
44qmk compile <configuratorExport.json>
45```
46
47**Usage for Keymaps**:
48
49```
50qmk compile -kb <keyboard_name> -km <keymap_name>
51```
52
53**Usage in Keyboard Directory**:
54
55Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap <keymap_name>`
56```
57qmk compile
58```
59
60**Example**:
61```
62$ qmk config compile.keymap=default
63$ cd ~/qmk_firmware/keyboards/planck/rev6
64$ qmk compile
65Ψ Compiling keymap with make planck/rev6:default
66...
67```
68or with optional keymap argument
69
70```
71$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4
72$ qmk compile -km 66_iso
73Ψ Compiling keymap with make clueboard/66/rev4:66_iso
74...
75```
76or in keymap directory
77
78```
79$ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak
80$ qmk compile
81Ψ Compiling keymap with make make gh60/satan:colemak
82...
83```
84
85**Usage in Layout Directory**:
86
87Must be under `qmk_firmware/layouts/`, and in a keymap folder.
88```
89qmk compile -kb <keyboard_name>
90```
91
92**Example**:
93```
94$ cd ~/qmk_firmware/layouts/community/60_ansi/mechmerlin-ansi
95$ qmk compile -kb dz60
96Ψ Compiling keymap with make dz60:mechmerlin-ansi
97...
98```
99
100## `qmk flash`
101
102This command is similar to `qmk compile`, but can also target a bootloader. The bootloader is optional, and is set to `:flash` by default.
103To specify a different bootloader, use `-bl <bootloader>`. Visit the [Flashing Firmware](flashing.md) guide for more details of the available bootloaders.
104
105**Usage for Configurator Exports**:
106
107```
108qmk flash <configuratorExport.json> -bl <bootloader>
109```
110
111**Usage for Keymaps**:
112
113```
114qmk flash -kb <keyboard_name> -km <keymap_name> -bl <bootloader>
115```
116
117**Listing the Bootloaders**
118
119```
120qmk flash -b
121```
122
123## `qmk config`
124
125This command lets you configure the behavior of QMK. For the full `qmk config` documentation see [CLI Configuration](cli_configuration.md).
126
127**Usage**:
128
129```
130qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN]
131```
132
133## `qmk docs`
134
135This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936.
136
137**Usage**:
138
139```
140qmk docs [-p PORT]
141```
142
143## `qmk doctor`
144
145This command examines your environment and alerts you to potential build or flash problems. It can fix many of them if you want it to.
146
147**Usage**:
148
149```
150qmk doctor [-y] [-n]
151```
152
153**Examples**:
154
155Check your environment for problems and prompt to fix them:
156
157 qmk doctor
158
159Check your environment and automatically fix any problems found:
160
161 qmk doctor -y
162
163Check your environment and report problems only:
164
165 qmk doctor -n
166
167## `qmk json2c`
168
169Creates a keymap.c from a QMK Configurator export.
170
171**Usage**:
172
173```
174qmk json2c [-o OUTPUT] filename
175```
176
177## `qmk kle2json`
178
179This 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.
180
181**Usage**:
182
183```
184qmk kle2json [-f] <filename>
185```
186
187**Examples**:
188
189```
190$ qmk kle2json kle.txt
191☒ File info.json already exists, use -f or --force to overwrite.
192```
193
194```
195$ qmk kle2json -f kle.txt -f
196Ψ Wrote out to info.json
197```
198
199## `qmk list-keyboards`
200
201This command lists all the keyboards currently defined in `qmk_firmware`
202
203**Usage**:
204
205```
206qmk list-keyboards
207```
208
209## `qmk list-keymaps`
210
211This command lists all the keymaps for a specified keyboard (and revision).
212
213**Usage**:
214
215```
216qmk list-keymaps -kb planck/ez
217```
218
219## `qmk new-keymap`
220
221This command creates a new keymap based on a keyboard's existing default keymap.
222
223**Usage**:
224
225```
226qmk new-keymap [-kb KEYBOARD] [-km KEYMAP]
227```
228
229## `qmk pyformat`
230
231This command formats python code in `qmk_firmware`.
232
233**Usage**:
234
235```
236qmk pyformat
237```
238
239## `qmk pytest`
240
241This command runs the python test suite. If you make changes to python code you should ensure this runs successfully.
242
243**Usage**:
244
245```
246qmk pytest
247```