Skip to content

Fix update of userspace config when running qmk userspace-add interactively - #26403

Open
zvecr wants to merge 1 commit into
qmk:developfrom
zvecr:fix_userspace_add
Open

Fix update of userspace config when running qmk userspace-add interactively#26403
zvecr wants to merge 1 commit into
qmk:developfrom
zvecr:fix_userspace_add

Conversation

@zvecr

@zvecr zvecr commented Aug 14, 2026

Copy link
Copy Markdown
Member

Description

Currently, if you run qmk userspace-add with no arguments, it will prompt the user for various inputs. In this case, the keyboard/keymap arguments are not known by userspace_add.

The userspace config is updated within the new_keymap call without the potential cli.args.env value. Another attempt to save then happens as part of userspace_add with its own view of the current state, but as the keyboard/keymap args are empty the entry is then missing.

This PR refactors the cli logic into something that is callable with args, instead of the population of a cli object. It also updates the logic so that a save only happens once, and with the correct keyboard/keymap arguments regardless of if they originated from command line or prompt.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@zvecr zvecr added the bug label Aug 14, 2026
@github-actions github-actions Bot added python cli qmk cli command labels Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug cli qmk cli command python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant