MCPcopy Index your code
hub / github.com/MrMarble/zmk-viewer

github.com/MrMarble/zmk-viewer @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
62 symbols 156 edges 10 files 4 documented · 6% updated 2y agov2.0.0 · 2024-05-01★ 1796 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ZMK viewer

GitHub go.mod Go version CodeQL golangci-lint

A work in progress Cli tool to generate preview images from a zmk .keymap file.

Installation

You can download a pre compiled binary directly from the releases for your OS/Architecture.

Linux/MacOS

I made an installation script that should download the latest available version corresponding to your OS and architecture. sudo is needed to copy the binary to /usr/local/bin

curl -sL https://raw.githubusercontent.com/MrMarble/zmk-viewer/master/scripts/install.sh | sudo -E bash -
# or with wget
wget -O - https://raw.githubusercontent.com/MrMarble/zmk-viewer/master/scripts/install.sh | sudo -E bash -

Windows

Download the executable directly from the releases

Others

If you already have Go in your system you can use go install to build the binary without cloning the repo first.

go install github.com/mrmarble/zmk-viewer/cmd/zmk-viewer@latest # or target a specific version @v0.1.0

Usage

Usage: zmk-viewer generate <keyboard-name>

Generate layout image.

Arguments:
  <keyboard-name>    Keyboard name to fetch layout.

Flags:
  -h, --help                  Show context-sensitive help.
  -D, --debug                 Enable debug mode
      --version               Print version information and quit

  -f, --file=STRING           ZMK .keymap file
  -l, --layout-file=STRING    info.json file
  -t, --transparent           Use a transparent background.
  -r, --raw                   Draw the ZMK codes instead of the key labels.
  -s, --single                Generate a single image.
  -u, --unified               Generate a single image with all the layers.
  -o, --output="."            Output directory.

Keyboard name should be the same as in https://config.qmk.fm.

zmk-viewer generate cradio

Will output this image:

You can pass a .keymap file (this one for reference) to generate the layout with bindings

Normal

zmk-viewer generate -f ~/zmk-config/config/cradio.keymap cradio

will output an image for each layer:

Single

zmk-viewer generate -f ~/zmk-config/config/cradio.keymap cradio --single

will output one image with all layers:

Unified

zmk-viewer generate -f ~/zmk-config/config/cradio.keymap cradio --unified

will output one image with all layers stacked:

⭐ Stargazers

Star History Chart

Core symbols most depended-on inside this repo

Shape

Function 34
Struct 13
Method 12
TypeAlias 3

Languages

Go100%

Modules by API surface

internal/img/generate.go24 symbols
cmd/zmk-viewer/main.go9 symbols
pkg/keymap/parser.go8 symbols
pkg/infojson/infojson.go8 symbols
pkg/keymap/parser_test.go6 symbols
cmd/zmk-viewer/generate/generate.go3 symbols
pkg/keymap/keys.go1 symbols
pkg/infojson/infojson_test.go1 symbols
pkg/devicetree/binding_test.go1 symbols
pkg/devicetree/binding.go1 symbols

For agents

$ claude mcp add zmk-viewer \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page