| name | export-import-commands |
| description | Export CopyQ Custom Commands to a versionable `.ini` bundle and import them on another machine or after a reinstall. Use when the user wants to back up their CopyQ commands, sync between workstations, or ship a curated bundle as part of a dotfiles repo. |
Export / Import CopyQ Commands
CopyQ stores commands in ~/.config/copyq/copyq-commands.ini (or inline within copyq.conf depending on version). Direct file copy works but is fragile across versions — prefer the official export/import path.
Export all commands
GUI: Preferences → Commands → Save Commands… → save as .ini.
CLI:
copyq exportCommands > ~/copyq-commands.ini
This produces a single .ini snippet with one [Commands] section. Safe to commit to a dotfiles repo.
Export a single command
exportCommands dumps all of them. To slice a single command, parse the resulting .ini and keep only the matching N\ block plus a size=1 line. Or use the GUI: Preferences → Commands → select one → right-click → Export….
Import
GUI: Preferences → Commands → Load Commands… → pick the .ini. Appends to existing commands; duplicates are not deduped.
CLI:
copyq loadCommands "$(cat ~/copyq-commands.ini)"
To replace rather than append: clear existing first via the GUI (select all → delete), or via:
copyq eval -- '
var n = commands().length;
setCommands([]);
'
copyq loadCommands "$(cat ~/copyq-commands.ini)"
Versioning workflow
Recommended dotfiles layout:
~/repos/dotfiles/copyq/
├── commands.ini # canonical bundle
└── README.md
Sync workflow:
copyq exportCommands > ~/repos/dotfiles/copyq/commands.ini
cd ~/repos/dotfiles && git add copyq && git commit -m "Update CopyQ commands"
copyq loadCommands "$(cat ~/repos/dotfiles/copyq/commands.ini)"
What gets exported
- All Custom Commands (Automatic, In-Menu, Global Shortcut, Display).
- Their full body, matchers, shortcuts, icons, and ordering.
What does NOT get exported
- General preferences (history depth, tray behaviour, theme) — those live in
copyq.conf.
- Tab contents (clipboard history items).
- Pinned items.
To back those up too, also copy ~/.config/copyq/copyq.conf and (if needed) the per-tab data files in ~/.local/share/copyq/.
Safe round-trip test
After authoring or modifying commands, verify export/import works before relying on the bundle:
copyq exportCommands > /tmp/before.ini
copyq eval -- 'setCommands([])'
copyq loadCommands "$(cat /tmp/before.ini)"
copyq exportCommands > /tmp/after.ini
diff /tmp/before.ini /tmp/after.ini
If diff shows substantive differences, the bundle has fields CopyQ silently dropped on import — usually due to version skew. Pin the CopyQ version across machines to avoid this.