一键导入
clipboard
Use when copy/paste doesn't work over mosh/SSH, or clipboard not syncing between local and remote, or setting up terminal remoting with gclpr or OSC 52
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when copy/paste doesn't work over mosh/SSH, or clipboard not syncing between local and remote, or setting up terminal remoting with gclpr or OSC 52
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use on any NixOS host (devbox on Hetzner, cloudbox on GCP) when SSH connection fails, host key mismatch, NixOS issues, CPU/IO contention (high load), or verifying the host is properly configured
Launch headless opencode sessions from CLI. Use when you need to start a new opencode session in the background to work on a task in parallel, or when spawning work on a specific directory.
How to apply configuration changes to NixOS hosts (devbox, cloudbox). Use when you need to rebuild the system, apply home-manager changes, or recover from issues.
Use when setting up or rotating PagerDuty MCP auth for OpenCode on macOS Keychain or cloudbox sops, or when debugging missing PagerDuty tools.
Use when setting up or rotating Rollbar MCP auth for OpenCode on macOS Keychain or cloudbox sops, when triaging a Rollbar error paged via PagerDuty, or when debugging missing Rollbar tools.
Documents the OpenCode agent set — what each does, when to use it, and why the others were cut. Use when questioning agent choices or considering adding/removing agents.
| name | clipboard |
| description | Use when copy/paste doesn't work over mosh/SSH, or clipboard not syncing between local and remote, or setting up terminal remoting with gclpr or OSC 52 |
We use two mechanisms for syncing the clipboard between the remote devbox/cloudbox and the local macOS environment:
Copy: nvim yank → gclpr copy → TCP :2850 (signed) → SSH tunnel → macOS gclpr server → pbcopy
Paste: nvim paste → gclpr paste → TCP :2850 (signed) → SSH tunnel → macOS gclpr server → pbpaste → response
The gclpr server runs locally on macOS via launchd (gclpr-server agent) and listens on port 2850 (default). It uses NaCl key-pair authentication — authorized public keys are listed in ~/.gclpr/trusted.
SSH tunnels carry the gclpr traffic from the remote host back to macOS. The devbox-tunnel and cloudbox-tunnel SSH configurations include a RemoteForward:
RemoteForward 2850 127.0.0.1:2850
This forwards port 2850 on the remote host to port 2850 on the local macOS machine.
assets/tmux/extra.conf)tmux is configured to pipe copy-mode selections to gclpr, and also accept OSC 52 from apps as a fallback:
if-shell 'test -f ~/.gclpr/key' 'set -s copy-command "gclpr copy"' # Remote hosts only
set -s set-clipboard on # Accept OSC 52 from apps (fallback)
set -gq allow-passthrough on # tmux 3.3+ passthrough support
set -as terminal-features ',xterm-256color:clipboard' # Ms capability
The if-shell guard ensures the copy-command is only set on remote hosts that have the gclpr client key. On macOS, tmux uses pbcopy natively.
assets/nvim/lua/user/settings.lua)Neovim automatically detects if gclpr is available on the remote host (via the gclpr executable and the active tunnel port). If so, it uses it for clipboard operations. Otherwise, it falls back to OSC 52.
-- WHEN to use clipboard (sync unnamed register with +)
vim.opt.clipboard = "unnamedplus"
Preferences → General → Selection → Enable "Applications in terminal may access clipboard"
gclpr uses NaCl key-pair authentication:
~/.gclpr/key, 64 bytes): Deployed to remote hosts via sops-nix activation script~/.gclpr/key.pub, 32 bytes): Deployed to remote hosts via home.file~/.gclpr/trusted, macOS only): Contains hex-encoded public keys, managed by home.file on DarwinOn the remote machine (devbox/cloudbox):
echo "test-gclpr" | gclpr copy
# Cmd+V locally should paste "test-gclpr"
# To test paste:
# Copy "hello-from-mac" on macOS, then run:
gclpr paste
# Should output "hello-from-mac"
echo "café résumé 日本語 🎉" | gclpr copy
gclpr paste
# Should output "café résumé 日本語 🎉" with all characters intact
ssh devbox
printf '\033]52;c;%s\007' "$(printf 'test-raw' | base64 | tr -d '\n')"
# Cmd+V locally should paste "test-raw"
# In tmux, enter copy mode, select text, and hit Enter (or y)
# Cmd+V locally should paste the selected text via gclpr copy
"Connection refused" when running gclpr copy:
ssh -N devbox-tunnel). Ensure it hasn't died.netstat -tulpn | grep 2850launchctl list | grep gclpr or lsof -i :2850 on macOS."authentication failed" or "bad signature":
ls -la ~/.gclpr/key (should be 64 bytes, mode 400)xxd ~/.gclpr/key.pub on remote with the hex in ~/.gclpr/trusted on macOSnix run home-manager -- switch --flake .#dev on remotePort Conflicts: If port 2850 is already in use on either end, the tunnel will fail to bind. Check for stale SSH sessions holding the port.
If nvim yanks don't reach clipboard (when gclpr is inactive):
Check that vim.opt.clipboard = "unnamedplus" is set. Without this, yanks go to the unnamed register, not the + register that OSC 52 uses.
If tmux fallback fails, check:
tmux show -s set-clipboard # Should be: on
tmux info | grep 'Ms:' # Should NOT say [missing]
After changing tmux config: Must restart tmux server, not just detach/attach:
tmux kill-server
When using the gclpr bridge, Neovim and tmux can explicitly request the local clipboard contents via gclpr paste.
When falling back to OSC 52, it is primarily for copy (yank → local clipboard). Pasting from local clipboard into remote nvim typically uses your terminal's paste function (Cmd+V in insert mode, or terminal's paste bracketing).
OSC 52 and gclpr only handle text. For sharing images with a remote opencode session over SSH, use the screenshot-to-remote-opencode helper script, which:
Then paste the path into your opencode session:
Analyze this image: /home/dev/.cache/claude-images/screenshot-20240115-143022-12345.png