Description
Describe the Bug
I'm a bit of a qmk noob, so it's possible I'm just doing something wrong here, but I found the whole process rather confusing regardless.
The docs currently say this:
qmk_firmware/docs/cli_commands.md
Lines 315 to 319 in 49d1359
However, I was very confused when this command didn't work for any of my keyboards or my custom keymaps:
qmk info -kb zsa/moonlander -km default
Keyboard Name: Moonlander Mark I
Manufacturer: ZSA Technology Labs
Website: zsa.io/moonlander
Maintainer: ZSA via Drashna
Layouts: LAYOUT
Processor: STM32F303
Bootloader: stm32-dfu
Layout aliases: LAYOUT_moonlander=LAYOUT
qmk info -kb keebio/foldkb -km default
Keyboard Name: FoldKB Rev. 1
Manufacturer: Keebio
Website: https://keeb.io
Maintainer: nooges
Layouts: LAYOUT
Processor: atmega32u4
Bootloader: atmel-dfu
Turns out that there's a bit of code here that only renders the layout if it's in json format:
qmk_firmware/lib/python/qmk/cli/info.py
Lines 53 to 54 in 49d1359
Sure enough, when I ran qmk c2json --no-cpp -km default -kb zsa/moonlander -o keyboards/zsa/moonlander/keymaps/default/keymap.json
, qmk info
generated the expected output.
We should probably document this somewhere, or try to fix it, since I went down a rabbit hole of learning qmk's python library to figure out what was going on. It seems like there's three ways to deal with this:
- document this in
cli_commands.md
- Add an
else
and a log line to the end ofshow_keymap()
telling the user that the command won't work with their .c keymap. - If we find a .c keymap, attempt to run
qmk.keymap.c2json()
and send that output torender_layout
I'd be happy to fix this myself, but since the fix would be somewhat opinionated, and I've never contributed here, I figured I'd ask first. I can put in a PR if someone tells me which fix is the preferable one.
Keyboard Used
No response
Link to product page (if applicable)
No response
Operating System
No response
qmk doctor Output
Is AutoHotKey / Karabiner installed
- AutoHotKey (Windows)
- Karabiner (macOS)
Other keyboard-related software installed
No response
Additional Context
No response