Copy files between Yazi and desktop apps. Paste files, save clipboard images, or turn text into a new file.
Yazi 26.8.15+ · MIT
ya pkg add simla33/ucp| Platform | Requirements and verification |
|---|---|
| X11 | xclip. Tested with real Yazi and a private X11 clipboard. |
| Wayland | wl-clipboard. Tested with real Yazi and headless Sway. |
| macOS | osascript/AppKit and pbpaste. |
| Windows | Built-in powershell.exe 5.1. Native tests run in a disposable VM. |
Linux/macOS also need realpath, cp, chmod, and mktemp. Windows needs an interactive desktop and an ACL-capable filesystem. Platform details
Add these entries to your existing [mgr].prepend_keymap in keymap.toml, then restart Yazi:
[mgr]
prepend_keymap = [
{ on = "y", run = "plugin ucp -- copy notify", desc = "Copy to clipboard" },
{ on = "p", run = "plugin ucp -- paste notify", desc = "Paste files, images or text" },
]Only y and p invoke ucp. Native Yazi keys and an optional clipboard bypass
Remove notify for fewer notifications; keep -- when passing multiple arguments. Config locations and options
Paste files · Resolve collisions and save text
Native cuts win. Otherwise, clipboard files, images, then text take priority. With no supported readable clipboard data, ucp uses Yazi's native yank. Text asks for a filename; images use a timestamped name.
| Collision key | Action |
|---|---|
o / O |
Overwrite one / all later collisions. |
c / C |
Create a uniquely named copy, such as note_copy.txt, once / for all later collisions. |
m |
Merge directories, preserving unrelated entries. |
q / Escape |
Skip one item; cancel a text/image save. |
Q |
Stop the remaining file batch. |
Text/image dialogs offer o, c, and q/Escape. In the filename prompt, Enter submits and Ctrl-C cancels.
~/.config/yazi/plugins/ucp.yazi/ucp doctorNo keybinding, no running Yazi, no clipboard payload reads. The report shows helper/session metadata and recognized formats—not paths, environment values, or unknown format names.
Use ucp doctor from PATH or Windows PowerShell · Troubleshooting
Local search results work. Remote files must be downloaded locally before external copy. Flatpak copying has optional portal support.
Transfers are staged, not crash-atomic. Keep any backup named in a recovery warning. Safety and recovery · Tests and verification limits
Update with ya pkg upgrade simla33/ucp, then restart Yazi.
- Alex Cicovic (@acicovic) — macOS multi-file copy and Finder verification in #18, plus argument documentation in #19.
- XYenon and clipboard.yazi — Windows clipboard inspiration. ucp's implementation is independent; no AGPL source was copied.
- boydaihungst/save-clipboard-to-file.yazi — the original paste-to-file implementation.
- grappas/wl-clipboard.yazi — the basis for clipboard copy.
- Ze Huang (@Sutter099) and @Fun10165 — macOS contributions in #9 and #16.
- @VigneshR387 — directory/merge work in #6 and #7.
