A simple CLI tool built with Bun to make managing Karabiner Elements complex modifications a bit easier, especially when juggling multiple macro pads and foot pedals!
This tool was created to simplify:
- Listing existing complex modifications.
- Adding new complex modifications with device presets and auto-suggested "to" key mappings.
- Monitoring the Karabiner configuration file for live updates.
list
: Displays all active complex modifications from your Karabiner setup.add
: Interactively guides you through adding a new complex modification.- Select from predefined device presets or define a custom device.
- Input your desired "from" key.
- Get an auto-suggested, available "to" key + Hyper modifier combination.
- Auto-generates a rule description.
watch
: Monitors yourkarabiner.json
file for changes and re-lists the modifications in real-time.
I have too many macro pads and foot pedals, and managing their Karabiner complex modifications directly in the JSON file or via the Karabiner Elements UI became cumbersome. This tool streamlines the process, especially for adding new Hyper key mappings quickly.
Enjoy!
- Bun installed on your system.
- Karabiner Elements installed and configured.
-
Clone the repository (or download the files).
-
Navigate to the project directory:
cd karabiner-cli
-
Install dependencies:
bun install
-
(Important) Configuration Path: This script defaults to using the Karabiner configuration file at
/Users/oliy/.config/karabiner/karabiner.json
. If your configuration file is located elsewhere, you'll need to manually edit theKARABINER_CONFIG_PATH
constant at the top of thekarabiner-cli/configManager.ts
file to point to your correctkarabiner.json
path.You'll also need to update the path in the
watch
command inkarabiner-cli/index.ts
if you change it. -
Run commands:
bun run index.ts list bun run index.ts add bun run index.ts watch bun run index.ts --help # To see all commands