You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(docs): Improve link and code highlight contrast
Reset the theme's primary colors to the defaults, since the color of
links was a bit too low contrast in the dark theme. The default primary
color is a very similar but slightly lighter shade of blue.
The background color of highlighted lines in code blocks is also fairly
low contrast, but it needs to be in order to keep the text readable. To
add contrast here, we now add a colored block to the left side of a
highlighted line.
* fix(docs): Improve ZMK setup instructions
This makes several improvements to the instructions for installing and
using ZMK CLI:
- Windows Terminal is also named "Terminal", so reworded the terminal
instructions to not separate Windows from other OSes.
- Specified that Windows Terminal should always be used on Windows, as
on older installations of Windows, the default terminal when opening
PowerShell may be the legacy console host, which may not support some
of the VT sequences used by ZMK CLI.
- Switched from pipx to uv. This eliminates the need for instructions
on installing Python, as uv will automatically install a supported
version of Python if needed.
- Updated the instructions for running "zmk init", as ZMK CLI version
0.4.0 switched from immediately asking for a repo URL to prompting
the user to select between creating a new repo or cloning an existing
one first.
- Since for a new user, having a keymap compile successfully on the
first attempt after modifying it may be the exception rather than the
norm, added a note about error messages in GitHub actions with a link
to the troubleshooting page.
Also added instructions for updating ZMK CLI to the latest version on
the ZMK CLI page.
Copy file name to clipboardExpand all lines: docs/docs/user-setup.mdx
+81-78Lines changed: 81 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,20 +7,19 @@ import Tabs from "@theme/Tabs";
7
7
importTabItemfrom"@theme/TabItem";
8
8
9
9
exportconst OsTabs = (props) => (
10
-
<Tabs
10
+
<Tabs
11
11
groupId="operating-system"
12
12
queryString
13
13
defaultValue="linux"
14
14
values={[
15
15
{ label: "Linux", value: "linux" },
16
16
{ label: "Windows", value: "win" },
17
-
{ label: "Mac OS", value: "mac" }
17
+
{ label: "macOS", value: "mac" },
18
18
]}
19
19
>
20
20
{/* eslint-disable-next-line */}
21
21
{props.children}
22
22
</Tabs>
23
-
24
23
);
25
24
26
25
Unlike other keyboard firmwares, ZMK Firmware has been built from the ground up to allow users to manage
@@ -54,10 +53,9 @@ Following the steps in this guide, you will:
54
53
55
54
You will need to install a few tools before you can get started.
56
55
57
-
Many instructions in this guide use commands that need to be run in a terminal application.
56
+
Many instructions in this guide use commands that need to be run in a terminal application. On most operating systems, the program is simply named "Terminal".
58
57
59
-
- On Windows, use [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701) or PowerShell.
60
-
- On other operating systems, the terminal program is usually just named "Terminal".
58
+
On Windows, get [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701) from the Microsoft Store if it isn't already installed.
61
59
62
60
### Install Git
63
61
@@ -67,7 +65,7 @@ Open a terminal and run the following command. If Git is already installed, it w
67
65
git --version
68
66
```
69
67
70
-
If it gives an error instead, install Git from https://git-scm.com/install/. Close and re-open your terminal and run the `git --version` command again to check if it installed correctly.
68
+
If it prints an error instead, install Git from https://git-scm.com/install/. Close and reopen your terminal and run the `git --version` command again to check if it installed correctly.
71
69
72
70
:::note
73
71
This guide will have you run several more `git` commands later. If you aren't familiar with Git, check out [Learn The Basics Of Git In Under 10 Minutes](https://www.freecodecamp.org/news/learn-the-basics-of-git-in-under-10-minutes-da548267cc91/) to help you get started.
@@ -91,132 +89,131 @@ gh auth login
91
89
92
90
Create a [personal access token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) and make sure to create it with the "workflow" scope option selected.
93
91
94
-
When running `git` commands later in this guide, Git will ask for your username and password. Enter your GitHub username, but **do not enter your password**. Instead, paste your access token for the password. You won't be able to see the token again after you create it, so keep the page open until you've done this and/or copy it to a secure location. If you lose the token, simply create another one.
92
+
When running `git` commands later in this guide, Git will ask for your username and password. Enter your GitHub username, but **do not enter your password**. Instead, paste your access token where it asks for the password. You won't be able to see the token again after you create it, so keep the page open until you've done this and/or copy it to a secure location. If you lose the token, simply create another one.
93
+
94
+
### Install uv
95
+
96
+
[uv](https://github.com/astral-sh/uv) is a Python package manager which can install ZMK CLI and a supported version of Python if necessary. The instructions for installing uv differ depending on your operating system. Select the tab for your OS below.
95
97
96
-
### Install Python and pipx
98
+
If installation fails, see [https://docs.astral.sh/uv/getting-started/installation/](https://docs.astral.sh/uv/getting-started/installation/) for more detailed instructions and alternative installation methods.
97
99
98
-
ZMK CLI requires Python version 3.10 or above.
100
+
<details>
101
+
<summary>Other package managers</summary>
99
102
100
-
There are several ways you can install ZMK CLI, but for simplicity, this guide will use[pipx](https://pipx.pypa.io/stable/). (If you are already familiar with another Python package manager such as [uv](https://github.com/astral-sh/uv), you can install the `zmk` package with it instead, but that will not be covered in this guide.)
103
+
ZMK CLI can also be installed with other Python package managers such as[pipx](https://pipx.pypa.io/stable/). If you have a different package manager you prefer, install the ["zmk" package](https://pypi.org/project/zmk/) and skip to [Config Repo Setup](#config-repo-setup).
101
104
102
-
The instructions for installing Python and pipx differ depending on your operating system.
105
+
</details>
103
106
104
107
<OsTabs>
105
108
<TabItemvalue="linux">
106
109
107
-
Python comes preinstalled on most Linux distributions, but pipx needs to be installed separately. In case Python isn't already installed, this guide will have you install both. Pick the commands relevant to the distribution you are using:
108
-
109
-
#### Ubuntu 23.04 or above
110
+
Open a terminal and run the following command:
110
111
111
112
```sh
112
-
sudo apt update
113
-
sudo apt install python3 pipx
114
-
pipx ensurepath
113
+
curl -LsSf https://astral.sh/uv/install.sh | sh
115
114
```
116
115
117
-
#### Ubuntu 22.04
116
+
If you get an error like "curl: command not found", try using wget:
118
117
119
118
```sh
120
-
sudo apt update
121
-
sudo apt install python3
122
-
python3 -m pip install --user pipx
123
-
python3 -m pipx ensurepath
119
+
wget -qO- https://astral.sh/uv/install.sh | sh
124
120
```
125
121
126
-
#### Ubuntu 20.04
127
-
128
-
Ubuntu 20.04 comes with an older version of Python. You can install Python 3.10 from the deadsnakes PPA with the following commands:
122
+
If that doesn't work either, install [curl](https://curl.se/) and try again. For example, on Ubuntu and other Debian-based Linux distributions, run:
129
123
130
124
```sh
131
-
sudo add-apt-repository ppa:deadsnakes/ppa
132
-
sudo apt install python3.10
133
-
python3.10 -m pip install --user pipx
134
-
python3.10 -m pipx ensurepath
125
+
sudo apt update
126
+
sudo apt install curl
127
+
curl -LsSf https://astral.sh/uv/install.sh | sh
135
128
```
136
129
137
-
You will then need to replace `python3` with `python3.10` in the rest of the installation instructions.
138
-
139
-
#### Fedora 35 or above
130
+
If the install script prints the following, close and reopen your terminal.
140
131
141
-
```sh
142
-
sudo dnf install python3 pipx
143
-
pipx ensurepath
144
132
```
133
+
To add $HOME/.local/bin to your PATH, either restart your shell or run:
145
134
146
-
If you have an older version of Fedora, you will need to update your operating system to a newer version or [build Python from source](https://docs.python.org/3/using/unix.html#building-python).
135
+
source $HOME/.local/bin/env (sh, bash, zsh)
136
+
source $HOME/.local/bin/env.fish (fish)
137
+
```
147
138
148
-
#### Other distributions
139
+
</TabItem>
140
+
<TabItemvalue="win">
149
141
150
-
Install Python 3 and pipx using your distribution's package manager. If there is no package for pipx, install it with `pip` after installing Python:
If this prints the text that is highlighted below, close and reopen your terminal.
158
149
159
-
```sh
160
-
python3 --version
161
150
```
162
-
163
-
If this prints a version less than 3.10, you will need to update your operating system to a newer version or [build Python from source](https://docs.python.org/3/using/unix.html#building-python).
151
+
// highlight-next-line
152
+
Path environment variable modified; restart your shell to use the new value.
153
+
Command line alias added: "uvx"
154
+
Command line alias added: "uv"
155
+
Command line alias added: "uvm"
156
+
Successfully installed
157
+
```
164
158
165
159
</TabItem>
160
+
<TabItemvalue="mac">
166
161
167
-
<TabItemvalue="win">
168
-
169
-
Open https://www.python.org/downloads/ and select "Download Python install manager". Run the installer, then open a terminal and run the following command to install the latest version of Python 3:
162
+
Open a terminal and run the following command:
170
163
171
164
```sh
172
-
py install 3
165
+
curl -LsSf https://astral.sh/uv/install.sh | sh
173
166
```
174
167
175
-
Next, install pipx:
168
+
If the install script prints the following, close and reopen your terminal.
176
169
177
-
```sh
178
-
py -m pip install --user pipx
179
-
py -m pipx ensurepath
170
+
```
171
+
To add $HOME/.local/bin to your PATH, either restart your shell or run:
172
+
173
+
source $HOME/.local/bin/env (sh, bash, zsh)
174
+
source $HOME/.local/bin/env.fish (fish)
180
175
```
181
176
182
177
</TabItem>
178
+
</OsTabs>
183
179
184
-
<TabItemvalue="mac">
180
+
### Install ZMK CLI
185
181
186
-
First, install Homebrew from https://brew.sh/. Next, open a terminal and run:
182
+
Finally, we'll install ZMK CLI. Open a terminal and run:
187
183
188
184
```sh
189
-
brew install pipx
190
-
pipx ensurepath
185
+
uv tool install zmk
191
186
```
192
187
193
-
This should automatically install Python 3 if it is missing.
188
+
<details>
189
+
<summary>I get an "executable already exists" error</summary>
194
190
195
-
</TabItem>
196
-
</OsTabs>
191
+
Earlier versions of this guide used pipx. If you get an error like this...
197
192
198
-
### Verify pipx Install
193
+
```
194
+
error: Executable already exists: zmk.exe (use `--force` to overwrite)
195
+
```
199
196
200
-
Close and re-open your terminal, then run:
197
+
...run the following commands to remove the pipx version and reinstall it with uv:
201
198
202
199
```sh
203
-
pipx --version
200
+
python3 -m pipx uninstall zmk
201
+
uv tool install zmk
204
202
```
205
203
206
-
It should print a version number. If not, go back to the previous step and make sure you installed pipx correctly. You can also try logging out of your computer and logging back in to make sure any environment variables changes made during installation take effect.
207
-
208
-
### Install ZMK CLI
204
+
</details>
209
205
210
-
Finally, we'll install ZMK CLI. Open a terminal and run:
206
+
This will likely print a message like ``warning: `/home/username/.local/bin` is not on your PATH``. To fix that, run:
211
207
212
208
```sh
213
-
pipx install zmk
214
-
zmk --version
209
+
uv tool update-shell
215
210
```
216
211
217
-
It should print a version number if everything installed correctly.
212
+
Close and reopen your terminal to apply the changes, then run the following command. It should print a version number if everything installed correctly.
218
213
219
-
On Linux, you may get an error saying you need to install another package such as `python3.10-venv`. If so, follow the instructions in the error message, then try the above commands again.
214
+
```sh
215
+
zmk --version
216
+
```
220
217
221
218
## Config Repo Setup
222
219
@@ -237,22 +234,22 @@ Then, [skip to the next step](#add-a-keyboard).
237
234
238
235
</details>
239
236
240
-
Open a terminal and use the `cd` command to move to a folder where you'd like to place the ZMK files (it will create a `zmk-config` subfolder in this location), then run `zmk init`. For example:
237
+
Open a terminal and use the `cd` command to move to a folder where you'd like to place the ZMK files (it will create a new folder in this location), then run `zmk init`. For example:
241
238
242
239
```sh
243
240
cd~/Documents
244
241
zmk init
245
242
```
246
243
247
-
Follow the instructions it gives you. If you already have a ZMK config repo on GitHub, you can enter its URL when prompted, for example:
244
+
Follow the instructions it gives you. If you already have a ZMK config repo on GitHub, select "Clone an existing repo" and enter its URL when prompted, for example:
Otherwise, leave this first prompt blank and press <kbd>Enter</kbd>, and it will walk you through creating a new repo.
250
+
Otherwise, select "Create a new ZMK config repo", and follow the instructions to create a new repo.
254
251
255
-
Once you finish following all the instructions, you will have a copy of the repo stored on your computer. All `zmk` commands will run on this repo (unless the working directory is inside a different repo). If you ever forget where the repo is located, you can run `zmk cd` to find it.
252
+
After this finishes, you will have a copy of the repo stored on your computer. All `zmk` commands will run on this repo (unless the working directory is inside a different repo). If you ever forget where the repo is located, you can run `zmk cd` to find it.
256
253
257
254
### Add a Keyboard
258
255
@@ -328,7 +325,7 @@ The text after `-m` is the "commit message", which gives a name to the commit. T
328
325
329
326
:::warning
330
327
331
-
If the `git push` command asks you for a username and password, enter your GitHub username, but **do not enter your password**. Instead, paste your access token for the password. (Go back to the [GitHub account setup instructions](#set-up-a-github-account) if you need to create a token.)
328
+
If the `git push` command asks you for a username and password, enter your GitHub username, but **do not enter your password**. Instead, paste your access token where it asks for the password. (Go back to the [GitHub account setup instructions](#set-up-a-github-account) if you need to create a token.)
332
329
333
330
:::
334
331
@@ -346,11 +343,17 @@ Or, you can manually open your GitHub repository in your browser and click the "
346
343
347
344

348
345
349
-
Once you have loaded the Actions tab, select the top build from the list. Once you load it, the right side panel will include
346
+
Once you have loaded the Actions tab, select the top build from the list. If the build was successful, the right side panel will include
350
347
a link to download the `firmware` upload:
351
348
352
349

353
350
351
+
:::info[Fixing build errors]
352
+
353
+
If you see a red X instead of a link to download the firmware, the build failed, likely due to an error in your repo. See the [troubleshooting page](./troubleshooting/building-issues.md) for help fixing the error. After making changes, [commit and push](#commit-and-push-to-github) again and GitHub will start a new build.
354
+
355
+
:::
356
+
354
357
Once downloaded, extract the zip and you can verify it should contain one or more `.uf2` or `.hex` files, which contain the firmware you need to write to your keyboard.
Copy file name to clipboardExpand all lines: docs/docs/zmk-cli.mdx
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,19 @@ ZMK CLI is a command line tool which helps with setting up a ZMK config repo and
7
7
8
8
See the [ZMK installation guide](user-setup.mdx#prerequisites) for instructions on installing ZMK CLI.
9
9
10
-
## Using ZMK CLI
10
+
The instructions below contain commands that need to be run in a terminal program. On most operating systems, the program is simply named "Terminal".
11
+
12
+
On Windows, get [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701) from the Microsoft Store if it isn't already installed.
11
13
12
-
The instructions below contain commands that need to be run in a terminal program.
14
+
## Updating ZMK CLI
13
15
14
-
- On Windows, use [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701) or PowerShell.
15
-
- On other operating systems, the terminal program is usually just named "Terminal".
16
+
To update to the latest version of ZMK, run the following command in a terminal:
17
+
18
+
```sh
19
+
uv tool upgrade zmk
20
+
```
21
+
22
+
## Using ZMK CLI
16
23
17
24
All ZMK CLI commands start with `zmk`. Run `zmk --help` for general usage instructions. For help with a specific subcommand, add `--help` after the subcommand, e.g. `zmk init --help`.
0 commit comments