keyboard-maestro

Sync Keyboard Maestro macros between chezmoi source files and live macOS state.

1|Updated Aug 6, 2025
One-click install
npx skills add https://github.com/azaidrahman/zaid-sani-dotfiles --skill keyboard-maestro-azaidrahman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: keyboard-maestro
Source: https://github.com/azaidrahman/zaid-sani-dotfiles/tree/main/dot_claude/skills/keyboard-maestro
Command: npx skills add https://github.com/azaidrahman/zaid-sani-dotfiles --skill keyboard-maestro-azaidrahman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing Keyboard Maestro macros as plain files under version control is error-prone: manual imports create duplicate macros under new UIDs, GUI edits drift out of sync with source files, and silent failures occur when the KM Engine is not running. This Skill encodes the exact workflows and pitfalls for keeping macros in the Chezmoi-Managed group synchronized with chezmoi. ## Core Features & Use Cases - Edit-and-apply workflow: Edit a .kmmacros plist in the chezmoi source, run chezmoi apply, and let the run_onchange hook invoke km-apply to delete the old macro by UID and re-import the new one. - GUI edit capture: Run km-export to write live macro XML back into the chezmoi source, stripping churn-prone date fields and refusing to overwrite files with uncommitted git changes. - Live state inspection: Read macro XML, delete, disable, or rename macros via osascript against the Keyboard Maestro AppleScript interface. - Use Case: You tweaked a macro in the Keyboard Maestro Editor and want it committed to your dotfiles repo — run km-export, then chezmoi apply and commit, without losing in-progress source edits. ## Quick Start Ask the assistant to add a new Keyboard Maestro macro to the Chezmoi-Managed group by generating a fresh UID and writing the .kmmacros file in the chezmoi source.

Frequently Asked Questions about keyboard-maestro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit a Keyboard Maestro macro managed by chezmoi?

Edit the macro's XML in the chezmoi source under dot_config/keyboardmaestro/exact_macros, then run chezmoi apply. A run_onchange hook invokes km-apply, which deletes the old macro by UID and re-imports the updated one.

How do I capture Keyboard Maestro GUI edits back into git?

Run km-export to write each Chezmoi-Managed macro's live XML back into the chezmoi source, stripping CreationDate and ModificationDate for clean diffs. It refuses to overwrite files with uncommitted changes unless you pass --force.

Why did importing a .kmmacros file create a duplicate macro?

Keyboard Maestro identifies macros by the UID key inside the plist, not by filename. Manually importing a file with an existing UID creates a duplicate under a new UID instead of replacing it — always let km-apply perform delete-then-import.

Why didn't my macro changes apply after chezmoi apply?

The run_onchange hook silently skips (exit 0) when the Keyboard Maestro Engine is not running, so nothing gets imported. Start Keyboard Maestro and run km-apply manually to catch up.

Can I set a Keyboard Maestro macro's XML directly via AppleScript?

No, the xml property exposed by Keyboard Maestro's AppleScript interface is read-only. Changes only take effect through delete plus import, which is what the km-apply edit flow performs.