{"id":20160601,"url":"https://github.com/zmkfirmware/zmk-cli","last_synced_at":"2026-03-08T04:01:33.597Z","repository":{"id":253675260,"uuid":"844201484","full_name":"zmkfirmware/zmk-cli","owner":"zmkfirmware","description":"Command line tool for ZMK Firmware","archived":false,"fork":false,"pushed_at":"2026-02-24T01:15:45.000Z","size":256,"stargazers_count":14,"open_issues_count":9,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-24T08:02:20.448Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zmk.dev/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"joelspadin/zmk-cli","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmkfirmware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"zmkfirmware"}},"created_at":"2024-08-18T17:24:20.000Z","updated_at":"2026-02-24T01:15:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9bf6815-d264-4be9-a7e6-4d476a85c318","html_url":"https://github.com/zmkfirmware/zmk-cli","commit_stats":{"total_commits":70,"total_committers":1,"mean_commits":70.0,"dds":0.0,"last_synced_commit":"cc89ad4eb747af1e39e9946d3a280576a6a64386"},"previous_names":["zmkfirmware/zmk-cli"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/zmkfirmware/zmk-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmkfirmware%2Fzmk-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmkfirmware%2Fzmk-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmkfirmware%2Fzmk-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmkfirmware%2Fzmk-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmkfirmware","download_url":"https://codeload.github.com/zmkfirmware/zmk-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmkfirmware%2Fzmk-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30244547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T00:14:52.805Z","updated_at":"2026-03-08T04:01:33.578Z","avatar_url":"https://github.com/zmkfirmware.png","language":"Python","funding_links":["https://opencollective.com/zmkfirmware"],"categories":["Tools and Software"],"sub_categories":["CLI and Utilities"],"readme":"# ZMK CLI\n\nA command line program to help set up [ZMK Firmware](https://zmk.dev).\n\nZMK CLI walks you through installing ZMK and setting up a GitHub repository to store and build custom firmware. It also automates some common tasks such as adding new keyboards to your repository.\n\nThe instructions below contain commands that need to be run in a terminal program. On Windows, use the [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701) or PowerShell. On other operating systems, the terminal program is usually just named \"Terminal\".\n\n# Installation\n\nThis readme will provide brief instructions for installing ZMK CLI. For instructions in more detail, see the [ZMK Documentation](https://zmk.dev/docs/user-setup).\n\n## Install Git\n\nInstall Git from https://git-scm.com/downloads or your OS's package manager.\n\nYou will also need a [GitHub account](https://github.com/signup).\n\n## Install uv\n\nInstall uv from https://docs.astral.sh/uv/getting-started/installation/.\n\n## Install ZMK CLI\n\nRun the following command to install ZMK CLI:\n\n```sh\nuv tool install zmk\n```\n\nIf you have already installed ZMK CLI, you can update to the latest version with the following command:\n\n```sh\nuv tool upgrade zmk\n```\n\n# Usage\n\nAll 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`.\n\n## Initialize a Repository\n\n\u003e ⚠️ If you have already created a repo and cloned it to your computer, you do not need to run this command. Set the [user.home](#userhome) setting to point to the existing repo instead.\n\nThe `zmk init` command walks you through creating a GitHub repository, then clones it to your computer so you can edit it.\n\nOpen a terminal and use the `cd` command to move to a directory where you'd like to place the ZMK files, then run `zmk init`. For example:\n\n```sh\ncd ~/Documents\nzmk init\n```\n\nFollow the instructions it gives you. If you already have a ZMK config repo, select \"Clone an existing repo\" and enter the repo's URL, for example:\n\n```\nRepository URL: https://github.com/myusername/zmk-config\n```\n\nOtherwise, select \"Create a new ZMK config repo\" and it will walk you through creating a new repo.\n\nOnce 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.\n\nNow that you have a repo created, see [Customizing ZMK](https://zmk.dev/docs/customization) for documentation on how to customize it, and see the instructions below for how ZMK CLI can automate some common tasks.\n\n## Keyboard Management\n\n### Add a Keyboard\n\nTo start building firmware for a new keyboard, run `zmk keyboard add`. Follow the instructions to select a keyboard (and controller board if necessary), and it will add it to the list of firmware to build and copy a default keymap into your repo.\n\nYou can then run `zmk code \u003ckeyboard\u003e` to open the keymap in a text editor.\n\nThis command reads from a local copy of ZMK to determine the supported keyboards. If the keyboard you want to use isn't listed, try running `zmk update` to update the local copy to the latest version of ZMK. If it still isn't listed, you may be able to find a [Zephyr module](#module-management) that provides it, or you may need to [create it yourself](#create-a-new-keyboard).\n\n### Remove a keyboard\n\nTo remove a keyboard from the build, run `zmk keyboard remove` and select the item to remove. For a split keyboard, you will need to run this twice and remove the left and right sides.\n\nThis simply removes a keyboard from the `build.yaml` file. It does not delete any `.keymap` or `.conf` files.\n\n### List Supported Keyboards\n\nRun `zmk keyboard list` to print a list of supported keyboard hardware.\n\n### Create a New Keyboard\n\nIf ZMK doesn't support your keyboard yet, you can run `zmk keyboard new` to create a new keyboard from a template.\n\nNote that this will generate most of the boilerplate for you, but you will still need to manually edit the files to match your keyboard. See the [New Keyboard Shield](https://zmk.dev/docs/development/hardware-integration/new-shield) guide for how to finish writing the keyboard files.\n\n## Module Management\n\n[Zephyr modules](https://docs.zephyrproject.org/4.1.0/develop/modules.html) can add support for new keyboards, behaviors, and other features to ZMK. Use the `zmk module` command to install modules into your repo:\n\n```sh\nzmk module add     # Add a module\nzmk module remove  # Remove an installed module\nzmk module list    # List the installed modules\nzmk update         # Update the local copies of ZMK and modules to their latest versions\n```\n\n## Edit Keymap and Config Files\n\nThe `zmk code` command will open ZMK files in a text editor:\n\n```sh\nzmk code                    # Open the repo directory in an editor\nzmk code \u003ckeyboard\u003e         # Open \u003ckeyboard\u003e.keymap in an editor\nzmk code --conf \u003ckeyboard\u003e  # Open \u003ckeyboard\u003e.conf in an editor\nzmk code --build            # Open build.yaml in an editor\n```\n\nThe first time you run this command, it will ask you which editor you want to use. If you want to change this choice later or use an editor that wasn't listed, see the [core.editor](#coreeditor) and [code.explorer](#coreexplorer) settings.\n\n## Push Changes to GitHub\n\nRun `zmk cd` to go to the repo directory. From here, you can run `git` commands manage the repo.\n\nFor example, after adding a keyboard to your repo and editing its keymap, you can run the following commands to push your changes to GitHub and trigger a firmware build:\n\n```sh\ngit add .\ngit commit\ngit push\n```\n\nYou will need to [authenticate with GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-authentication-to-github#authenticating-with-the-command-line) before the `git push` command will work. The easiest way to do this is to install the [GitHub CLI](https://cli.github.com/) and run\n\n```sh\ngh auth login\n```\n\nbut you can also use a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens). If using an access token, make sure you create it with the \"workflow\" scope option selected.\n\n## Download Firmware from GitHub\n\nAfter pushing changes, GitHub will automatically build the firmware for you. Run `zmk download` (or `zmk dl` for short) to open the GitHub actions page in your browser.\n\nFrom this page, you can click on a build (the latest is at the top) to view its status. If the build succeeded, you can download the firmware from the \"Artifacts\" section at the bottom of the build summary page.\n\n## ZMK Version Management\n\nThe `zmk version` command manages the version of ZMK you are using:\n\n```sh\nzmk version             # Print the current ZMK version\nzmk version --list      # List the available versions\nzmk version \u003crevision\u003e  # Switch to the version given by \u003crevision\u003e\n```\n\nYou can set the revision to any Git tag, branch, or commit:\n\n```sh\nzmk version v0.3     # Switch to tag \"v0.3\"\nzmk version main     # Switch to branch \"main\"\nzmk version 1958217  # Switch to commit \"1958217\"\n```\n\nNote that `zmk version --list` will only list tagged versions.\n\n## Configuration\n\nThe `zmk config` command manages settings for ZMK CLI:\n\n```sh\nzmk config                 # List all settings\nzmk config \u003cname\u003e          # Print the value of the setting \u003cname\u003e\nzmk config \u003cname\u003e \u003cvalue\u003e  # Set \u003cname\u003e to \u003cvalue\u003e\nzmk config --unset \u003cname\u003e  # Remove the setting \u003cname\u003e\n```\n\nBy default, these settings are stored in a file in your user profile directory. Run `zmk config --path` to get the location of this file. You can change where the settings file is stored by setting a `ZMK_CLI_CONFIG` environment variable to the new path to use, or by adding a `--config-file=\u003cpath\u003e` argument when running `zmk`.\n\nOther commands use the following settings:\n\n### core.editor\n\nCommand line for a text editor to use with the `zmk code` command.\n\nFor example, to set Visual Studio Code as the editor and make it always open a new window, run:\n\n```sh\nzmk config core.editor \"code --new-window\"\n```\n\n### core.explorer\n\nCommand line for a file explorer to use with the `zmk code` command when opening a directory.\n\nIf this setting is not set, the `core.editor` tool will be run instead. Set this setting when using a text editor that does not support opening directories.\n\n### user.home\n\nThe path to the repository to use whenever `zmk` is run and the working directory is not inside a ZMK config repository.\n\nFor example, to point ZMK CLI to an existing repo at `~/Documents/zmk-config`, run:\n\n```sh\nzmk config user.home ~/Documents/zmk-config\n```\n\n# Development\n\nIf you would like to help improve ZMK CLI, you can clone this repo and install it into a virtual environment where you can modify it. First, open a terminal to the root directory of the repository. Then, create a virtual environment and install the project's dependencies:\n\n```sh\n# Create virtual environment and install dependencies\nuv sync\n# Install pre-commit hooks\nuv run prek install\n```\n\nTo run the development version of the program, either prefix commands with `uv run`...\n\n```sh\nuv run zmk \u003cargs...\u003e\n```\n\n...or [activate the virtual environment](https://docs.astral.sh/uv/pip/environments/#using-a-virtual-environment) first, and then you can use just `zmk`.\n\nIf you want `zmk` to run the development version even when you are not inside the virtual environment, you can install it globally in editable mode:\n\n```sh\nuv tool install -e .\n```\n\n## Linting\n\nAfter running `uv run prek install`, linting and code formatting will be run automatically when you make a commit. You can also run these tools manually:\n\n```sh\n# lint codebase\nuv run ruff check\n# format files\nuv run ruff format\n```\n\nType checking is slower and difficult to configure to run as a Git commit hook, so this needs to be run manually.\n\n```sh\nuv run pyright .\n```\n\nGitHub will also run these checks and report any errors when you make a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmkfirmware%2Fzmk-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmkfirmware%2Fzmk-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmkfirmware%2Fzmk-cli/lists"}