Git Product home page Git Product logo

qmk_cli's Introduction

QMK CLI

CLI Setup

A program to help users work with QMK Firmware.

Features

  • Interact with your qmk_firmware tree from any location
  • Use qmk clone to pull down anyone's qmk_firmware fork
  • Setup your build environment with qmk setup
  • Use qmk console to get debugging information from your keyboard(s)
  • Check that your environment is correctly setup with qmk doctor
  • Integrates with qmk_firmware for additional functionality:
    • qmk compile
    • qmk info
    • qmk flash
    • qmk lint
    • ...and many more!

Packages

We provide "install and go" packages for many Operating Systems.

Linux

Packages for several distributions available here: https://github.com/qmk/qmk_fpm

macOS

Using Homebrew:

brew install qmk/qmk/qmk

Windows

Download our custom MSYS2 installer here: https://msys.qmk.fm/

Quickstart

  • python3 -m pip install qmk
  • qmk setup

Building

We follow PEP517, you can install using build:

Setup:

python3 -m pip install build

Build:

python3 -m build

You can read more about working with PEP517 packages in the Python Packaging User Guide.

Documentation

Full documentation: https://docs.qmk.fm/#/tutorial

qmk_cli's People

Contributors

dependabot[bot] avatar drashna avatar duckle29 avatar erovia avatar fauxpark avatar lesshonor avatar qmk-bot avatar skullydazed avatar strikerrus avatar tzarc avatar zvecr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qmk_cli's Issues

[Bug] No module named 'hid'

Describe the Bug

After running qmk setup the first time, everything installed, and I got an error message. Now no qmk commands work.

Message:

Error: %s: %s ('ModuleNotFoundError', ModuleNotFoundError("No module named 'hid'"))
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/qmk_cli/script_qmk.py", line 74, in main
import qmk.cli # noqa
File "/home/danniel/qmk_firmware/lib/python/qmk/cli/init.py", line 158, in
from . import console # noqa
File "/home/danniel/qmk_firmware/lib/python/qmk/cli/console.py", line 9, in
import hid
ModuleNotFoundError: No module named 'hid'

Additional Context

Running Arch, installed via sudo pacman -S qmk, with all the dependencies.

[Bug] `qmk info -l` rendering is broken by `\n` presence in `info.json` key labels

Describe the Bug

Running qmk info -l -kb <keyboard> returns bad data if the label field in the info.json file contains \n.

Either QMK CLI should check for this, or we should enforce not using \n in labels. (How would we even do that?)

 noroadsleft  ~/qmk_firmware/keyboards  (master)
$ qmk info -l -kb idb/idb_60
Keyboard Name: idb 60
Manufacturer: idb Keyboards
Website: https://idb-keyboards.xyz/60
Maintainer: pngu
Keyboard Folder: idb/idb_60
Layouts: LAYOUT, LAYOUT_default
Processor: atmega32u2
Bootloader: atmel-dfu
Layout aliases: LAYOUT_all=LAYOUT
Layout Layout:
┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐
│Es││!
││@
││#
││$
││%
││^
││&
││*
││(
││)
││_
││+
││BS││~
│
└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘
┌────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌────┐
│Tab ││Q ││W ││E ││R ││T ││Y ││U ││I ││O ││P ││{
││}
││|
\ │
└────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└────┘
┌─────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌───────┐
│Caps ││A ││S ││D ││F ││G ││H ││J ││K ││L ││:
││"
││Enter  │
└─────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└───────┘
┌───┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌─────┐┌──┐
│Shi││>
││Z ││X ││C ││V ││B ││N ││M ││<
││>
││?
││Shift││Fn│
└───┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└─────┘└──┘
┌────┐┌──┐┌────┐┌──────────────────────────┐┌────┐┌──┐┌────┐
│Ctrl││Wi││Alt ││Space                     ││Alt ││Wi││Ctrl│
└────┘└──┘└────┘└──────────────────────────┘└────┘└──┘└────┘
Layout Layout_Default:
┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──────┐
│Es││!
││@
││#
││$
││%
││^
││&
││*
││(
││)
││_
││+
││BS    │
└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──────┘
┌────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌────┐
│Tab ││Q ││W ││E ││R ││T ││Y ││U ││I ││O ││P ││{
││}
││|
\ │
└────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└────┘
┌─────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌───────┐
│Caps ││A ││S ││D ││F ││G ││H ││J ││K ││L ││:
││"
││Enter  │
└─────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└───────┘
┌───────┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌──┐┌─────┐┌──┐
│Shift  ││Z ││X ││C ││V ││B ││N ││M ││<
││>
││?
││Shift││Fn│
└───────┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└──┘└─────┘└──┘
┌────┐    ┌────┐┌──────────────────────────┐┌────┐    ┌────┐
│Ctrl│    │Alt ││Space                     ││Alt │    │Ctrl│
└────┘    └────┘└──────────────────────────┘└────┘    └────┘

The data:

{
    "keyboard_name": "idb 60",
    "url": "https://idb-keyboards.xyz/60",
    "maintainer": "pngu",
    "layouts": {
        "LAYOUT_default": {
            "layout": [
                {"label":"Esc", "x":0, "y":0},
                {"label":"!\n1", "x":1, "y":0},
                {"label":"@\n2", "x":2, "y":0},
                {"label":"#\n3", "x":3, "y":0},
                {"label":"$\n4", "x":4, "y":0},
                {"label":"%\n5", "x":5, "y":0},
                {"label":"^\n6", "x":6, "y":0},
                {"label":"&\n7", "x":7, "y":0},
                {"label":"*\n8", "x":8, "y":0},
                {"label":"(\n9", "x":9, "y":0},
                {"label":")\n0", "x":10, "y":0},
                {"label":"_\n-", "x":11, "y":0},
                {"label":"+\n=", "x":12, "y":0},
                {"label":"BS", "x":13, "y":0, "w":2.0},
                {"label":"Tab", "x":0, "y":1, "w":1.5},
                {"label":"Q", "x":1.5, "y":1},
                {"label":"W", "x":2.5, "y":1},
                {"label":"E", "x":3.5, "y":1},
                {"label":"R", "x":4.5, "y":1},
                {"label":"T", "x":5.5, "y":1},
                {"label":"Y", "x":6.5, "y":1},
                {"label":"U", "x":7.5, "y":1},
                {"label":"I", "x":8.5, "y":1},
                {"label":"O", "x":9.5, "y":1},
                {"label":"P", "x":10.5, "y":1},
                {"label":"{\n[", "x":11.5, "y":1},
                {"label":"}\n]", "x":12.5, "y":1},
                {"label":"|\n\\", "x":13.5, "y":1, "w":1.5},
                {"label":"Caps Lock", "x":0, "y":2, "w":1.75},
                {"label":"A", "x":1.75, "y":2},
                {"label":"S", "x":2.75, "y":2},
                {"label":"D", "x":3.75, "y":2},
                {"label":"F", "x":4.75, "y":2},
                {"label":"G", "x":5.75, "y":2},
                {"label":"H", "x":6.75, "y":2},
                {"label":"J", "x":7.75, "y":2},
                {"label":"K", "x":8.75, "y":2},
                {"label":"L", "x":9.75, "y":2},
                {"label":":\n;", "x":10.75, "y":2},
                {"label":"\"\n'", "x":11.75, "y":2},
                {"label":"Enter", "x":12.75, "y":2, "w":2.25},
                {"label":"Shift", "x":0, "y":3, "w":2.25},
                {"label":"Z", "x":2.25, "y":3},
                {"label":"X", "x":3.25, "y":3},
                {"label":"C", "x":4.25, "y":3},
                {"label":"V", "x":5.25, "y":3},
                {"label":"B", "x":6.25, "y":3},
                {"label":"N", "x":7.25, "y":3},
                {"label":"M", "x":8.25, "y":3},
                {"label":"<\n,", "x":9.25, "y":3},
                {"label":">\n.", "x":10.25, "y":3},
                {"label":"?\n/", "x":11.25, "y":3},
                {"label":"Shift", "x":12.25, "y":3, "w":1.75},
                {"label":"Fn", "x":14, "y":3},
                {"label":"Ctrl", "x":0, "y":4, "w":1.5},
                {"label":"Alt", "x":2.5, "y":4, "w":1.5},
                {"label":"Space", "x":4, "y":4, "w":7},
                {"label":"Alt", "x":11, "y":4, "w":1.5},
                {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}
            ]
        },
        "LAYOUT": {
            "layout": [
                {"label":"Esc", "x":0, "y":0},
                {"label":"!\n1", "x":1, "y":0},
                {"label":"@\n2", "x":2, "y":0},
                {"label":"#\n3", "x":3, "y":0},
                {"label":"$\n4", "x":4, "y":0},
                {"label":"%\n5", "x":5, "y":0},
                {"label":"^\n6", "x":6, "y":0},
                {"label":"&\n7", "x":7, "y":0},
                {"label":"*\n8", "x":8, "y":0},
                {"label":"(\n9", "x":9, "y":0},
                {"label":")\n0", "x":10, "y":0},
                {"label":"_\n-", "x":11, "y":0},
                {"label":"+\n=", "x":12, "y":0},
                {"label":"BS", "x":13, "y":0},
                {"label":"~\n`", "x":14, "y":0},
                {"label":"Tab", "x":0, "y":1, "w":1.5},
                {"label":"Q", "x":1.5, "y":1},
                {"label":"W", "x":2.5, "y":1},
                {"label":"E", "x":3.5, "y":1},
                {"label":"R", "x":4.5, "y":1},
                {"label":"T", "x":5.5, "y":1},
                {"label":"Y", "x":6.5, "y":1},
                {"label":"U", "x":7.5, "y":1},
                {"label":"I", "x":8.5, "y":1},
                {"label":"O", "x":9.5, "y":1},
                {"label":"P", "x":10.5, "y":1},
                {"label":"{\n[", "x":11.5, "y":1},
                {"label":"}\n]", "x":12.5, "y":1},
                {"label":"|\n\\", "x":13.5, "y":1, "w":1.5},
                {"label":"Caps Lock", "x":0, "y":2, "w":1.75},
                {"label":"A", "x":1.75, "y":2},
                {"label":"S", "x":2.75, "y":2},
                {"label":"D", "x":3.75, "y":2},
                {"label":"F", "x":4.75, "y":2},
                {"label":"G", "x":5.75, "y":2},
                {"label":"H", "x":6.75, "y":2},
                {"label":"J", "x":7.75, "y":2},
                {"label":"K", "x":8.75, "y":2},
                {"label":"L", "x":9.75, "y":2},
                {"label":":\n;", "x":10.75, "y":2},
                {"label":"\"\n'", "x":11.75, "y":2},
                {"label":"Enter", "x":12.75, "y":2, "w":2.25},
                {"label":"Shift", "x":0, "y":3, "w":1.25},
                {"label":">\n<\n\n|", "x":1.25, "y":3},
                {"label":"Z", "x":2.25, "y":3},
                {"label":"X", "x":3.25, "y":3},
                {"label":"C", "x":4.25, "y":3},
                {"label":"V", "x":5.25, "y":3},
                {"label":"B", "x":6.25, "y":3},
                {"label":"N", "x":7.25, "y":3},
                {"label":"M", "x":8.25, "y":3},
                {"label":"<\n,", "x":9.25, "y":3},
                {"label":">\n.", "x":10.25, "y":3},
                {"label":"?\n/", "x":11.25, "y":3},
                {"label":"Shift", "x":12.25, "y":3, "w":1.75},
                {"label":"Fn", "x":14, "y":3},
                {"label":"Ctrl", "x":0, "y":4, "w":1.5},
                {"label":"Win", "x":1.5, "y":4},
                {"label":"Alt", "x":2.5, "y":4, "w":1.5},
                {"label":"Space", "x":4, "y":4, "w":7},
                {"label":"Alt", "x":11, "y":4, "w":1.5},
                {"label":"Win", "x":12.5, "y":4},
                {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}
            ]
        }
    }
}

Additional Context?

https://github.com/qmk/qmk_firmware/blob/03f4c53564550024821aafadef69b5daaaa09abd/keyboards/idb/idb_60/info.json
https://github.com/qmk/qmk_firmware/blob/03f4c53564550024821aafadef69b5daaaa09abd/keyboards/sendyyeah/75pixels/info.json

qmk setup fails when QMK_HOME has ~ in the path

setting the environment variable to a path with a tilde in it makes qmk setup fail.

export QMK_HOME='~/.qmk_firmware'

Traceback (most recent call last):
  File "/home/mikkel/.local/bin/qmk", line 10, in <module>
    sys.exit(main())
  File "/home/mikkel/.local/lib/python3.7/site-packages/qmk_cli/script_qmk.py", line 77, in main
    import qmk.cli
ModuleNotFoundError: No module named 'qmk'

this isn't a problem if the absolute path is given.

[Feature Request] Please properly document how to setup the CLI

Description

Right now, the documentation doesn't say anything about setting up the CLI.

I had to figure out by myself that qmk setup is needed for correctly using the application.

Also, the documentation talks about qmk complie and qmk flash all over the place without mentioning that qmk setup is needed for even those sub-commands to appear!

`qmk setup` crashes on W10

Got this when running qmk setup

WillyKaze@LUNES MINGW64 /d/Users/WillyKaze/repos/qmk_firmware
$ qmk setup
INFO Found qmk_firmware at D:\Users\WillyKaze\repos\qmk_firmware.

*** Would you like to set 'D:\Users\WillyKaze\repos\qmk_firmware' as your QMK home? [y/n] n

<class 'TypeError'>
ERROR argument of type 'WindowsPath' is not iterable
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.7/site-packages\milc.py", line 635, in __call__
    return self.__call__()
  File "C:/msys64/mingw64/lib/python3.7/site-packages\milc.py", line 640, in __call__
    return self._entrypoint(self)
  File "C:/msys64/mingw64/lib/python3.7/site-packages\qmk_cli\subcommands\setup.py", line 62, in setup
    subprocess.run(doctor_cmd)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 472, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 1119, in _execute_child
    args = list2cmdline(args)
  File "C:/msys64/mingw64/lib/python3.7\subprocess.py", line 530, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

Editing the subcommands/setup.py fixed this issue at line 54:

    # Run `qmk_firmware/bin/qmk doctor` to check the rest of the environment out
    qmk_bin = cli.args.home / 'bin/qmk'
    doctor_cmd = [sys.executable, str(qmk_bin), 'doctor'] # <<<<

    if cli.args.yes:
        doctor_cmd.append('--yes')

[Bug] Getting "FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'" when I try and run qmk setup

I follow the instructions on the readme and get this error when I run qmk setup:

  File "/home/ian/.local/bin/./qmk", line 8, in <module>
    sys.exit(main())
  File "/home/ian/.local/lib/python3.9/site-packages/qmk_cli/script_qmk.py", line 60, in main
    broken_modules = find_broken_requirements('requirements.txt')
  File "/home/ian/.local/lib/python3.9/site-packages/qmk_cli/helpers.py", line 21, in find_broken_requirements
    with Path(requirements).open() as fd:
  File "/usr/lib/python3.9/pathlib.py", line 1241, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/usr/lib/python3.9/pathlib.py", line 1109, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

Additional Context

Using Arch Linux.
Python 3.9.2
pip 21.0.1 from /home/ian/.local/lib/python3.9/site-packages/pip (python 3.9)

I also tried the Arch package but had the same result.

[Bug] QMK CLI crashes with "conflicting subparser" error

Describe the Bug

All of the QMK CLI commands fail with an error from MILC. I'm using the latest version from Homebrew (1.1.2_1). It appears to be related to argparse changes in Python 3.11; see, for example, Azure/azure-cli#23015.

Additional Context?

~/qmk_firmware [nickpascucci●] » qmk compile
Traceback (most recent call last):
  File "/usr/local/bin/qmk", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/Cellar/qmk/1.1.2_1/libexec/lib/python3.11/site-packages/qmk_cli/script_qmk.py", line 76, in main
    import qmk.cli  # noqa
    ^^^^^^^^^^^^^^
  File "/Users/nick/qmk_firmware/lib/python/qmk/cli/__init__.py", line 223, in <module>
    __import__(subcommand)
  File "/Users/nick/qmk_firmware/lib/python/qmk/cli/console.py", line 262, in <module>
    @cli.subcommand('Acquire debugging information from usb hid devices.', hidden=False if cli.config.user.developer else True)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/qmk/1.1.2_1/libexec/lib/python3.11/site-packages/milc/milc.py", line 623, in subcommand_function
    return self.add_subcommand(handler, description, hidden=hidden, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/qmk/1.1.2_1/libexec/lib/python3.11/site-packages/milc/milc.py", line 604, in add_subcommand
    self.subcommands[name] = SubparserWrapper(self, name, self._subparsers.add_parser(name, **kwargs))
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/argparse.py", line 1192, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument {config,clone,console,env,setup,c2json,chibios-confmigrate,clean,compile}: conflicting subparser: console

[Feature Request] Warn when setting qmk_{firmware,userspace} paths if they contain spaces

Description

Due to make and possibly other build build tools used for qmk, a space in your paths to qmk_firmware or qmk_userspace can cause compilation to fail. Specifically, I had no issue with a space in my path until I started using External Userspace. While using External Userspace with a space in the path for both qmk_firmware and qmk_userspace, qmk compile and qmk userspace-compile fail with unhelpful errors.

While it may not be possibly to fully support spaces in paths, it might be a good idea to not allow spaces in paths to begin with. That could be enforced at the qmk_cli level. When user.qmk_home or user.overlay_dir are set, there could be a check for spaces, and an error if they are present.

[Bug] 'config' command not recognized

Cannot set config defaults (default keyboard, default keymap, etc.).

Describe the Bug

Using version 0.0.50 (have not tested on previous ones), running qmk config returns the following error:

usage: qmk [-h] [-V] [-v] [--datetime-fmt DATETIME_FMT] [--log-fmt LOG_FMT] [--log-file-fmt LOG_FILE_FMT]
           [--log-file-level {debug,info,warning,error,critical}] [--log-file LOG_FILE] [--color] [--no-color]
           [--unicode] [--no-unicode] [--interactive] [--config-file CONFIG_FILE]
           {clone,env,setup,c2json,chibios-confmigrate,clean,compile,doctor,flash,generate-rgb-breathe-table,info,json2c,lint,list-keyboards,list-keymaps,new-keyboard,new-keymap}
           ...
qmk: error: argument {clone,env,setup,c2json,chibios-confmigrate,clean,compile,doctor,flash,generate-rgb-breathe-table,info,json2c,lint,list-keyboards,list-keymaps,new-keyboard,new-keymap}: invalid choice: 'config' (choose from 'clone', 'env', 'setup', 'c2json', 'cformat', 'chibios-confmigrate', 'clean', 'compile', 'docs', 'doctor', 'fileformat', 'flash', 'format-json', 'generate-api', 'generate-config-h', 'generate-dfu-header', 'generate-docs', 'generate-info-json', 'generate-keyboard-h', 'generate-layouts', 'generate-rgb-breathe-table', 'generate-rules-mk', 'hello', 'info', 'json2c', 'lint', 'list-keyboards', 'list-keymaps', 'kle2json', 'multibuild', 'new-keyboard', 'new-keymap', 'pyformat', 'pytest')

Additional Context

Running on a WSL2 instance of Ubuntu 20.04 LTS. Installation procedure followed as per the docs.

Thanks for your time,
Cheers

[Bug] qmk.ini symlink is broken on configure

If qmk.ini is a symlink, changing values with qmk configure breaks the symlink and overwrites with a new file.

Reproduction

  • Create a new qmk.ini with qmk setup or another method
  • Move this file somewhere else, and drop a symlink to it in the correct location (.config/qmk/qmk.ini -> somedir/qmk.ini)
  • Run qmk configure somekey=someval
  • Observe that .config/qmk/qmk.ini is no longer a symlink (ls -l .config/qmk/qmk.ini)

Additional Context

  • Operating system: Linux (Arch)
  • qmk_cli version: Off of master branch (0.0.40.r5.gd805fe2)

[Bug] Existing `~/qmk_firmware` breaks CLI

Describe the Bug

I had an old clone of the qmk firmware repo in ~/qmk_firmware (from before the CLI repo existed looking at dates) which resulted in this error on running any commands:

$ qmk setup
Traceback (most recent call last):
  File "/usr/bin/qmk", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/qmk_cli/script_qmk.py", line 76, in main
    import qmk.cli  # noqa
    ^^^^^^^^^^^^^^
  File "/home/klh/qmk_firmware/lib/python/qmk/cli/__init__.py", line 193, in <module>
    __import__(subcommand)
  File "/home/klh/qmk_firmware/lib/python/qmk/cli/console.py", line 261, in <module>
    @cli.subcommand('Acquire debugging information from usb hid devices.', hidden=False if cli.config.user.developer else True)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/klh/.local/lib/python3.12/site-packages/milc/milc.py", line 708, in subcommand_function
    return self.add_subcommand(handler, description, hidden=hidden, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/klh/.local/lib/python3.12/site-packages/milc/milc.py", line 689, in add_subcommand
    self.subcommands[name] = SubparserWrapper(self, name, self._subparsers.add_parser(name, **kwargs))
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/argparse.py", line 1219, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument {config,clone,console,env,setup,c2json,chibios-confmigrate,clean,compile}: conflicting subparser: console

Not the most user-friendly message - not sure if it can be handled better since I don't know Python that well.

Additional Context?

No response

Cannot run `qmk` as root

gentoo ~ # qmk
Traceback (most recent call last):
  File "/home/finn/.local/bin/qmk", line 5, in <module>
    from qmk_cli.script_qmk import main
ModuleNotFoundError: No module named 'qmk_cli'

[Bug] qmk info throws an error if no keymap is provided / defined

Describe the Bug

Running qmk info -kb throws an error if there is no -km | --keymap argument provided or no default keymap is configured via qmk config.

$ qmk info -kb arisu
Keyboard Name: Arisu
Manufacturer: Fate
Website: https://github.com/FateNozomi/arisu-pcb
Maintainer: FateNozomi
Keyboard Folder: arisu
Layouts: LAYOUT
Processor: atmega32u4
Bootloader: atmel-dfu
<class 'TypeError'>
☒ unsupported operand type(s) for /: 'PosixPath' and 'NoneType'
Traceback (most recent call last):
  File "/home/jordan/.local/lib/python3.7/site-packages/milc/milc.py", line 523, in __call__
    return self.__call__()
  File "/home/jordan/.local/lib/python3.7/site-packages/milc/milc.py", line 528, in __call__
    return self._subcommand(self)
  File "/home/jordan/projects/personal/qmk_firmware/lib/python/qmk/decorators.py", line 27, in wrapper
    return func(*args, **kwargs)
  File "/home/jordan/projects/personal/qmk_firmware/lib/python/qmk/decorators.py", line 47, in wrapper
    return func(*args, **kwargs)
  File "/home/jordan/projects/personal/qmk_firmware/lib/python/qmk/cli/info.py", line 188, in info
    show_keymap(kb_info_json, title_caps)
  File "/home/jordan/projects/personal/qmk_firmware/lib/python/qmk/cli/info.py", line 24, in show_keymap
    keymap_path = locate_keymap(cli.config.info.keyboard, cli.config.info.keymap)
  File "/home/jordan/projects/personal/qmk_firmware/lib/python/qmk/keymap.py", line 287, in locate_keymap
    if (keymap_dir / keymap / 'keymap.c').exists():
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'NoneType'

I tried printing out the keymap argument by adding print('keymap (-km | --keymap): ' + cli.config_source.info.keymap) and the result was keymap (-km | --keymap): argument.

Additional Context?

I would say this should be filed in https://github.com/qmk/qmk_cli, except that I don't get this error with MILC 1.5.0 - only after updating to the latest version (1.6.4) do I get the same thing, and it also occurs in MSYS with:

TypeError: unsupported operand type(s) for /: 'WindowsPath' and 'NoneType'

So it is either a MILC bug, or some interaction between MILC and the QMK CLI.

Originally posted by @fauxpark in qmk/qmk_firmware#14509 (comment)

[Bug] 0.0.41 breaks setup on MSYS

Describe the Bug

image

Additional Context

fe42ab3 introduces a slightly different behaviour for running doctor as part of setup.

doctor_command = [sys.executable, sys.argv[0], 'doctor']

Where argv[0] contains a path that now gets munged by python.

In my brief testing,

  • calling cygpath on these variable before cli.run makes no difference
  • MSYS2_ARG_CONV_EXCL does not change this pathing behaviour

Do not hardcode 'bin/qmk' in qmk_cli/subcommands/setup.py

Hello, can you not hardcode 'bin/qmk' in the qmk_cli/subcommands/setup.py file?
I'm trying to package your software in Guix (http://guix.gnu.org/) and this hardcoded path makes my life harder - it breaks the "qmk setup" command:

Ψ QMK Doctor is checking your environment.
Ψ Detected Linux.
☒ Can't run `bin/qmk --version`

Using "/usr/bin/env qmk" will solve the issue.

Thanks.

[Bug] "Cannot import name 'format_ansi' from 'milc'"

Describe the Bug

Upon running any command using the QMK command line tool, I get the error:

ImportError: cannot import name 'format_ansi' from 'milc' (/home/cst/.local/lib/python3.8/site-packages/milc/__init__.py)

I tried getting QMK using:

  • apt first, and although I successfully got an executable I saw that error.
  • pip next, and I again got an executable but still saw that error.
  • Then, cloning directly and using python -m build, which worked but was local to the directory (causing qmk setup to fail, I suspect because qmk was not on my path).

As a workaround, I ran python -m build --no-isolation, which resolved the dependencies outside of a virtual environment. This allowed me to install via qmk and the tool is now working for me.

I'm running on Ubuntu 20.04, and my Python interpreter is Python 3.8.

Additional Context?

No response

[Feature Request] Catch `KeyboardInterrupt`s (CTRL-C) in the CLI

Feature Request Type

  • Core functionality
  • Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
  • Alteration (enhancement/optimization) of existing feature(s)
  • New behavior

Description

Currently when you press CTRL-C while the CLI is running, you'll see the default Python behavior of showing the (sometimes very long) traceback. This is rarely going to be useful and just clutters the terminal output.

I suggest that we catch KeyboardInterrupts (can be done globally with a signal handler as well) and just exit w/o printing anything. or perhaps just a short message like Pressed CTRL-C or something like that. Thoughts?

[Bug] AttributeError: module 'idna' has no attribute 'IDNAError'

Describe the Bug

I tried to install qmk cli using homebrew, it installed but everytime i try to use it (qmk setup or qmk flash) i'll get this error

Traceback (most recent call last):
  File "/opt/homebrew/bin/qmk", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/qmk/1.1.5_1/libexec/lib/python3.12/site-packages/qmk_cli/script_qmk.py", line 76, in main
    import qmk.cli  # noqa
    ^^^^^^^^^^^^^^
  File "/Users/lubomirfiala/qmk_firmware/lib/python/qmk/cli/__init__.py", line 253, in <module>
    __import__(subcommand)
  File "/Users/lubomirfiala/qmk_firmware/lib/python/qmk/cli/ci/validate_aliases.py", line 5, in <module>
    from qmk.keyboard import resolve_keyboard, keyboard_folder, keyboard_alias_definitions
  File "/Users/lubomirfiala/qmk_firmware/lib/python/qmk/keyboard.py", line 10, in <module>
    import qmk.path
  File "/Users/lubomirfiala/qmk_firmware/lib/python/qmk/path.py", line 8, in <module>
    from qmk.constants import MAX_KEYBOARD_SUBFOLDERS, QMK_FIRMWARE, QMK_USERSPACE, HAS_QMK_USERSPACE
  File "/Users/lubomirfiala/qmk_firmware/lib/python/qmk/constants.py", line 7, in <module>
    from qmk.userspace import detect_qmk_userspace
  File "/Users/lubomirfiala/qmk_firmware/lib/python/qmk/userspace.py", line 6, in <module>
    import jsonschema
  File "/opt/homebrew/Cellar/qmk/1.1.5_1/libexec/lib/python3.12/site-packages/jsonschema/__init__.py", line 13, in <module>
    from jsonschema._format import FormatChecker
  File "/opt/homebrew/Cellar/qmk/1.1.5_1/libexec/lib/python3.12/site-packages/jsonschema/_format.py", line 287, in <module>
    raises=(idna.IDNAError, UnicodeError),
            ^^^^^^^^^^^^^^
AttributeError: module 'idna' has no attribute 'IDNAError'

Is it a bug or I did something wrong?

Additional Context?

No response

[Bug] "config" command does not add new keys to qmk.ini file

Describe the Bug

When my ~/.config/qmk/qmk.ini file does not have a key already in it, qmk config doesn't add that key. For example if user.keyboard isn't in the qmk.ini file, running qmk config user.keyboard=keyboard doesn't make any changes to qmk.ini. However if I add user.keyboard manually, then qmk config will update that key correctly.

I tried qmk --log-file qmk.log --log-file-level debug config user.keyboard=keyboard and that didn't produce a log file.

Additional Context?

qmk --version
1.0.0

I installed for the first time today using python3 -m pip install --user qmk (following the setup instructions here).

python3 --version
Python 3.9.7

OS: Pop!_OS 21.10 x86_64

Let me know if you need any more information, and thanks for your help!

[Bug] Python libraries hid and hidapi occupy the same namespace with different APIs

Describe the Bug

The two python dependencies hid and hidapi occupies the same namespace in Python with different APIs.

This implies one can only install one version globally on a system and you enter an either/or scenario.

From looking at qmk it seems hid is only used by https://github.com/qmk/qmk_firmware/blob/9dea6f772077dc5c09daf40378e45884d29ab2e2/keyboards/dekunukem/duckypad/keymaps/m4cs/sysinfo.py, but the dependency is still enforced top-level in qmk_cli.

Preferably it should be optional or one should just go with the more popular hidapi library.

https://github.com/trezor/cython-hidapi

https://github.com/apmorton/pyhidapi

Additional Context?

No response

[Bug] Failed loading libhidapi.dylib on M1 mac due to homebrew path changed

Can not compile firmware even dependencies are fulfilled.

Describe the Bug

After manually installed the osx-cross/avr/avr-gcc (which installs avr-gcc@9 at the time present) and arm-none-eabi-gcc, qmk doctor passed with just a warning about the avr-gcc version, I can run the build command on my M1 Macbook Pro. However, the build failed with just saying that

ERROR: Can not run "qmk" command!

 Please run util/qmk_install.sh to install all the dependencies QMK requires.

make: *** [phoenix:default] Error 1

After digging into the code, I found that it fails at loading the dynamic library HIDAPI, which fails at the __init__.py of the hid site package. I checked my LD_LIBRARY_PATH and the libhidapi.dylib is right there.

This happens because the homebrew path changed on M1 machines into /opt/homebrew, thus the search failed. I know this may not be the issue of qmk_cli, but there are some improvements we can make:

  1. Improve the error message without just saying ERROR: Can not run "qmk" command!, at least make the error clear with different log levels such as debug.
  2. Find a workaround for fixing this:
    • Could be setting some environment variables to make the search of dynamic library successful? I am not sure about that because looks like it is using another process without passing environment variables.
    • Document the workaround such as make a soft link pointing to the old search path.

Additional Context

I have tested by manually setting the load path to

hidapi = ctypes.cdll.LoadLibrary("/opt/homebrew/lib/libhidapi.dylib")

in /opt/homebrew/Cellar/qmk/0.0.52/libexec/lib/python3.9/site-packages/hid/__init__.py and I can compile the firmware without any problem.

[Bug] ImportError: libtiff.so.5: cannot open shared object file: No such file or directory

Describe the Bug

can't execute qmk -command on arch linux. it produces following output:

% qmk                                        
Error: %s: %s ('ImportError', ImportError('libtiff.so.5: cannot open shared object file: No such file or directory'))
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/qmk_cli/script_qmk.py", line 76, in main
    import qmk.cli  # noqa
  File "/home/malix/qmk_firmware/lib/python/qmk/cli/__init__.py", line 244, in <module>
    __import__(subcommand)
  File "/home/malix/qmk_firmware/lib/python/qmk/cli/painter/__init__.py", line 1, in <module>
    from . import convert_graphics
  File "/home/malix/qmk_firmware/lib/python/qmk/cli/painter/convert_graphics.py", line 7, in <module>
    from qmk.painter import render_header, render_source, render_license, render_bytes, valid_formats
  File "/home/malix/qmk_firmware/lib/python/qmk/painter.py", line 6, in <module>
    from PIL import Image, ImageOps
  File "/usr/lib/python3.10/site-packages/PIL/Image.py", line 100, in <module>
    from . import _imaging as core
ImportError: libtiff.so.5: cannot open shared object file: No such file or directory

using the libtiff and qmk package provided in the repos ( https://archlinux.org/packages/extra/x86_64/libtiff/

installed libtiff is version has following .so files

libtiff /usr/lib/libtiff.so
libtiff /usr/lib/libtiff.so.6
libtiff /usr/lib/libtiff.so.6.0.0
libtiff /usr/lib/libtiffxx.so
libtiff /usr/lib/libtiffxx.so.6
libtiff /usr/lib/libtiffxx.so.6.0.0

Additional Context?

might be off topic, but why does the cli app even need images?

[Bug] No standard setup.py; what's the new way to package qmk_cli?

Describe the Bug

I'm the maintainer of the qmk package for FreeBSD. The main benefit of having a package for the qmk cli is that users can just install the qmk package and get all the dependencies easily at once.

The packaging process of the qmk cli used to be quite easy when the setup.py was present. I'm not sure what's the current recommended way of doing it. Could you document what's the best way to build, stage and install the qmk cli now?

Thanks!

Additional Context?

No response

[Bug] 'qmk --no-color setup' does not chain the extra color args to doctor

Describe the Bug

The result is that the qmk setup logic is correctly without ansi color codes, however the final call to doctor still has color (which looks terrible when run with something like....

import subprocess
from dialog import Dialog

d = Dialog(autowidgetsize=True)
d.set_background_title('QMK Admin')
d.add_persistent_args(['--no-lines', '--no-collapse', '--colors'])

ret = subprocess.Popen("qmk --no-color setup -y", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout
d.programbox(text="Running Setup...", fd=ret.fileno(), height=15, width=70)

(Uses https://pypi.org/project/pythondialog/)

Additional Context

cli.run(doctor_command, capture_output=False)

Only the executable name is inherited, rather than any of the extra global flags.

[Bug] No module named 'qmk.cli.ci.validate_aliases' after fresh install

Describe the Bug

Bug:
After running python3 -m pip install qmk and having the command resolve without errors. Afterwards running qmk setup results in an error message. Same goes for any other qmk command it seems. Any suggestion what might have caused this issue? Please find more additional information below.

System info:
OS: Nobara Linux 39 (KDE Plasma) x86_64
Host: X570 I AORUS PRO WIFI -CF
Kernel: 6.7.6-201.fsync.fc39.x86_64
Shell: bash 5.2.26
DE: Plasma 6.0.2
CPU: AMD Ryzen 7 3700X (16) @ 3.600GHz
GPU: NVIDIA GeForce RTX 3070 Lite Hash Rate
Memory: 7778MiB / 32033MiB
Python3: Python 3.12.2

Error codes:

Warning: Could not import qmk.cli.ci.validate_aliases: ModuleNotFoundError, No module named 'qmk.cli.ci.validate_aliases'
Warning: Could not import qmk.cli.chibios.confmigrate: ModuleNotFoundError, No module named 'qmk.cli.chibios.confmigrate'
Warning: Could not import qmk.cli.compile: ModuleNotFoundError, No module named 'qmk.cli.generate.compilation_database'
Warning: Could not import qmk.cli.format.c: ModuleNotFoundError, No module named 'qmk.cli.format.c'
Warning: Could not import qmk.cli.format.json: ModuleNotFoundError, No module named 'qmk.cli.format.json'
Warning: Could not import qmk.cli.format.python: ModuleNotFoundError, No module named 'qmk.cli.format.python'
Warning: Could not import qmk.cli.format.text: ModuleNotFoundError, No module named 'qmk.cli.format.text'
Warning: Could not import qmk.cli.generate.api: ModuleNotFoundError, No module named 'qmk.cli.generate.api'
Warning: Could not import qmk.cli.generate.autocorrect_data: ModuleNotFoundError, No module named 'qmk.cli.generate.autocorrect_data'
Warning: Could not import qmk.cli.generate.compilation_database: ModuleNotFoundError, No module named 'qmk.cli.generate.compilation_database'
Warning: Could not import qmk.cli.generate.config_h: ModuleNotFoundError, No module named 'qmk.cli.generate.config_h'
Warning: Could not import qmk.cli.generate.develop_pr_list: ModuleNotFoundError, No module named 'qmk.cli.generate.develop_pr_list'
Warning: Could not import qmk.cli.generate.dfu_header: ModuleNotFoundError, No module named 'qmk.cli.generate.dfu_header'
Warning: Could not import qmk.cli.generate.docs: ModuleNotFoundError, No module named 'qmk.cli.generate.docs'
Warning: Could not import qmk.cli.generate.info_json: ModuleNotFoundError, No module named 'qmk.cli.generate.info_json'
Warning: Could not import qmk.cli.generate.keyboard_c: ModuleNotFoundError, No module named 'qmk.cli.generate.keyboard_c'
Warning: Could not import qmk.cli.generate.keyboard_h: ModuleNotFoundError, No module named 'qmk.cli.generate.keyboard_h'
Warning: Could not import qmk.cli.generate.keycodes: ModuleNotFoundError, No module named 'qmk.cli.generate.keycodes'
Warning: Could not import qmk.cli.generate.keycodes_tests: ModuleNotFoundError, No module named 'qmk.cli.generate.keycodes_tests'
Warning: Could not import qmk.cli.generate.make_dependencies: ModuleNotFoundError, No module named 'qmk.cli.generate.make_dependencies'
Warning: Could not import qmk.cli.generate.rgb_breathe_table: ModuleNotFoundError, No module named 'qmk.cli.generate.rgb_breathe_table'
Warning: Could not import qmk.cli.generate.rules_mk: ModuleNotFoundError, No module named 'qmk.cli.generate.rules_mk'
Warning: Could not import qmk.cli.generate.version_h: ModuleNotFoundError, No module named 'qmk.cli.generate.version_h'
Warning: Could not import qmk.cli.git.submodule: ModuleNotFoundError, No module named 'qmk.cli.git.submodule'
Warning: Could not import qmk.cli.import.kbfirmware: ModuleNotFoundError, No module named 'qmk.cli.import.kbfirmware'
Warning: Could not import qmk.cli.import.keyboard: ModuleNotFoundError, No module named 'qmk.cli.import.keyboard'
Warning: Could not import qmk.cli.import.keymap: ModuleNotFoundError, No module named 'qmk.cli.import.keymap'
Warning: Could not import qmk.cli.list.keyboards: ModuleNotFoundError, No module named 'qmk.cli.list.keyboards'
Warning: Could not import qmk.cli.list.keymaps: ModuleNotFoundError, No module named 'qmk.cli.list.keymaps'
Warning: Could not import qmk.cli.list.layouts: ModuleNotFoundError, No module named 'qmk.cli.list.layouts'
Warning: Could not import qmk.cli.new.keyboard: ModuleNotFoundError, No module named 'qmk.cli.new.keyboard'
Warning: Could not import qmk.cli.new.keymap: ModuleNotFoundError, No module named 'qmk.cli.new.keymap'
Ψ Found qmk_firmware at /home/seth/Documents/qmk_firmware.
Warning: Could not import qmk.cli.ci.validate_aliases: ModuleNotFoundError, No module named 'qmk.cli.ci.validate_aliases'
Warning: Could not import qmk.cli.chibios.confmigrate: ModuleNotFoundError, No module named 'qmk.cli.chibios.confmigrate'
Warning: Could not import qmk.cli.compile: ModuleNotFoundError, No module named 'qmk.cli.generate.compilation_database'
Warning: Could not import qmk.cli.format.c: ModuleNotFoundError, No module named 'qmk.cli.format.c'
Warning: Could not import qmk.cli.format.json: ModuleNotFoundError, No module named 'qmk.cli.format.json'
Warning: Could not import qmk.cli.format.python: ModuleNotFoundError, No module named 'qmk.cli.format.python'
Warning: Could not import qmk.cli.format.text: ModuleNotFoundError, No module named 'qmk.cli.format.text'
Warning: Could not import qmk.cli.generate.api: ModuleNotFoundError, No module named 'qmk.cli.generate.api'
Warning: Could not import qmk.cli.generate.autocorrect_data: ModuleNotFoundError, No module named 'qmk.cli.generate.autocorrect_data'
Warning: Could not import qmk.cli.generate.compilation_database: ModuleNotFoundError, No module named 'qmk.cli.generate.compilation_database'
Warning: Could not import qmk.cli.generate.config_h: ModuleNotFoundError, No module named 'qmk.cli.generate.config_h'
Warning: Could not import qmk.cli.generate.develop_pr_list: ModuleNotFoundError, No module named 'qmk.cli.generate.develop_pr_list'
Warning: Could not import qmk.cli.generate.dfu_header: ModuleNotFoundError, No module named 'qmk.cli.generate.dfu_header'
Warning: Could not import qmk.cli.generate.docs: ModuleNotFoundError, No module named 'qmk.cli.generate.docs'
Warning: Could not import qmk.cli.generate.info_json: ModuleNotFoundError, No module named 'qmk.cli.generate.info_json'
Warning: Could not import qmk.cli.generate.keyboard_c: ModuleNotFoundError, No module named 'qmk.cli.generate.keyboard_c'
Warning: Could not import qmk.cli.generate.keyboard_h: ModuleNotFoundError, No module named 'qmk.cli.generate.keyboard_h'
Warning: Could not import qmk.cli.generate.keycodes: ModuleNotFoundError, No module named 'qmk.cli.generate.keycodes'
Warning: Could not import qmk.cli.generate.keycodes_tests: ModuleNotFoundError, No module named 'qmk.cli.generate.keycodes_tests'
Warning: Could not import qmk.cli.generate.make_dependencies: ModuleNotFoundError, No module named 'qmk.cli.generate.make_dependencies'
Warning: Could not import qmk.cli.generate.rgb_breathe_table: ModuleNotFoundError, No module named 'qmk.cli.generate.rgb_breathe_table'
Warning: Could not import qmk.cli.generate.rules_mk: ModuleNotFoundError, No module named 'qmk.cli.generate.rules_mk'
Warning: Could not import qmk.cli.generate.version_h: ModuleNotFoundError, No module named 'qmk.cli.generate.version_h'
Warning: Could not import qmk.cli.git.submodule: ModuleNotFoundError, No module named 'qmk.cli.git.submodule'
Warning: Could not import qmk.cli.import.kbfirmware: ModuleNotFoundError, No module named 'qmk.cli.import.kbfirmware'
Warning: Could not import qmk.cli.import.keyboard: ModuleNotFoundError, No module named 'qmk.cli.import.keyboard'
Warning: Could not import qmk.cli.import.keymap: ModuleNotFoundError, No module named 'qmk.cli.import.keymap'
Warning: Could not import qmk.cli.list.keyboards: ModuleNotFoundError, No module named 'qmk.cli.list.keyboards'
Warning: Could not import qmk.cli.list.keymaps: ModuleNotFoundError, No module named 'qmk.cli.list.keymaps'
Warning: Could not import qmk.cli.list.layouts: ModuleNotFoundError, No module named 'qmk.cli.list.layouts'
Warning: Could not import qmk.cli.new.keyboard: ModuleNotFoundError, No module named 'qmk.cli.new.keyboard'
Warning: Could not import qmk.cli.new.keymap: ModuleNotFoundError, No module named 'qmk.cli.new.keymap'
usage: qmk [-h] [-v] [--datetime-fmt DATETIME_FMT] [--log-fmt LOG_FMT] [--log-file-fmt LOG_FILE_FMT]
           [--log-file-level {debug,info,warning,error,critical}] [--log-file LOG_FILE] [--color] [--no-color] [--unicode]
           [--no-unicode] [-V] [--interactive] [--config-file CONFIG_FILE]
           {config,clone,console,env,setup,c2json,cd,clean,find,flash,info,json2c,lint,via2json} ...
qmk: error: argument {config,clone,console,env,setup,c2json,cd,clean,find,flash,info,json2c,lint,via2json}: invalid choice: 'doctor' (choose from 'config', 'clone', 'console', 'env', 'setup', 'bux', 'c2json', 'cd', 'clean', 'docs', 'find', 'flash', 'hello', 'info', 'json2c', 'license-check', 'lint', 'kle2json', 'mass-compile', 'migrate', 'pytest', 'via2json')```

### Additional Context?

_No response_

qmk setup fails when QMK_HOME has capital letters in the path

qmk setup fails when QMK_HOME has capital letters in the path
OS: macos catalina - case insensitive filesystem

➜ ~ export QMK_HOME='~/Developer'
➜ ~ qmk setup Error: /Users/hapi/Developer is too old or not set up correctly!
Please update it or remove it completely before continuing.
`

[Bug] Doesn't clone qmk/qmk_firmware with proxy while http.proxy and http.proxy are set

Describe the Bug

I need to visit Github with a proxy, I have set http.proxy and https.proxy. But It seems that qmk cli is not using my proxy, so it just hangs after I answer “y” to “Would you like to clone qmk/qmk_firmware to /home/...../qmk_firmware? [y/n]”.

~ qmk setup
☒ Could not find qmk_firmware!
Would you like to clone qmk/qmk_firmware to /home/chihhao-su/qmk_firmware? [y/n] y
正複製到 '/home/chihhao-su/qmk_firmware'...

Additional Context?

Version: qmk-1.1.5-py2.py3-none-any.whl

[Bug] qmk setup -H <path> ignores <path> but still uses user.qmk_home read from .config/qmk/qmk.ini

Describe the Bug

Context

This is running on Xubuntu 22.04, using qmk gotten using:

python3 -m pip install qmk

I'm using the instructions found here: https://github.com/zsa/qmk_firmware/#building:~:text=head%20to%20the%20Newbs%20guide%20from which is based upon QMK, and thus I found the defect originating from QMK and not those instructions, and not specific to the zsa/qmk_firmware keyboard(s).

Steps to reproduce

Execute qmk setup zsa/qmk_firmware --yes -b firmware22 -H qmk_firmware

And then .config/qmk/qmk.ini gets written with:

[user]
qmk_home = /path/to/my/current/working/directory/qmk_firmware

Then move your home directory to a new disk such that the /path/to/my/current/working/directory/ is or should be considered to be no longer valid. This occurred due to a disk failure whereby I had to move some links around such with the net effect that readlink -f $HOME before the outage is now different from what it was prior to the previous invocation of qmk setup ... above.

Cd into the new directory where we wish to have the qmk_firmware directory to be installed into, and then again run the qmk setup ... command. Do a ls -l qmk_firmware and be surprised that it does not exist.

Analysis/speculation

After some debugging, realize that the old /path/to/my/current/working/directory/ actually still does exist but notice the readlink -f above: What I think is happening is that the qmk setup command is just reading the user.qmk_home configuration value from the ~/.config/qmk/qmk.ini file which is still stuck on the old /path/to/my/current/working/directory/ value that still does exist but exists on the old harddrive. And if my theory is correct, the defect here is this: I, the user, specified -H qmk_firmware on the qmk setup command line, yet the old value was still read from the .ini file. This is unexpected: I instead expected that the .ini file value of user.qmk_home to be overridden by the value passed to the -H option, which really means to only use the qmk_firmware as the location, which is relative to the current working directory and not the old value found in the ~/.config/qmk/qmk.ini file.

My hackaround

I hack around this via:

./runenv qmk config user.qmk_home=$$(pwd)/qmk_firmware  # <-- because qmk setup ... -H completely ignores the -H option and continues to use ~/.config/qmk/qmk.ini values.
./runenv qmk setup zsa/qmk_firmware --yes -b firmware22 -H qmk_firmware
ls -ld qmk_firmware  # <-- If this gives a no such file or directory error, then the defect is still extant.

Keyboard Used

zsa/qmk_firmware

Link to product page (if applicable)

https://github.com/zsa/qmk_firmware

Operating System

Xubuntu 22.04

qmk doctor Output

Not applicable, IMO, because if my theory is correct, this is a cart-before-the-horse problem between .ini files and command line options, the latter of which should **override** the .ini values.

Is AutoHotKey / Karabiner installed

  • AutoHotKey (Windows)
  • Karabiner (macOS)

Other keyboard-related software installed

No response

Additional Context

No response

Docker issue

Information

  • None of the other issue templates apply

Description

I try to build QMK for a ARM64 architecture using Docker (official images are for amd64 in hub.docker).
During the building of « qmk_cli », using Dockerfile and the command « sudo docker build -t qmkfm/qmk_cli . » an error is raised :

Step 2/5 : ADD dist /tmp/dist
ADD failed: file not found in build context or excluded by .dockerignore: stat dist: file does not exist

There is no « dist(tribution/ant ?) » directory in the source code of qmk_cli.

Where am I wrong ?

Thanks for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.