opencode-paste-as-filePaste clipboard content into opencode as a file reference.
1
18
近 7 天 5
25.6
生态多维模型
3 个月前
2026-05-21
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-paste-as-file@0.1.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-paste-as-file@0.1.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-paste-as-fileopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Paste clipboard text into opencode as a file reference.
The plugin reads your clipboard, writes it to .opencode/pasted/, and appends an @file reference to the current prompt.
Install
Add the TUI plugin to your tui.json:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": [
[
"opencode-paste-as-file",
{
"keybinds": ["<leader>v"],
"dir": ".opencode/pasted"
}
]
]
}
Restart opencode after changing plugin config.
Usage
Run Paste as file from the command palette, or use the configured keybinding.
With the default opencode leader key, <leader>v is:
ctrl+x v
The inserted prompt text looks like:
@.opencode/pasted/paste-2026-05-20T12-00-00-000Z.txt
Options
type Options = {
dir?: string
keybinds?: string[]
}
dir: directory where pasted files are written. Defaults to.opencode/pasted.keybinds: TUI keybindings for the action. Defaults to["<leader>v"].
Clipboard Support
- macOS:
pbpaste - Windows: PowerShell
Get-Clipboard - Linux: tries
wl-paste, thenxclip, thenxsel
Git Ignore
Add this to your project .gitignore:
.opencode/pasted/