kdeps-tools-clipboard_copy
v1.0.0Copy text to the user's system clipboard (pbcopy on macOS, xclip or xsel on Linux, clip on Windows). Use when the user asks to copy something. Returns {copied, tool}; copied is false when text is empty.
set tools / shelf tools
LLM context: ~71 tokens when loaded (prompt or tool definition)
Where it runs
Part of the tools set, used in workflow and agent mode. What the model is told about each built-in tool: its description, usage notes and parameters. kdeps runs the tool itself.
- the agent loop builds the request
- the tool definitions are sent to the modeltools/clipboard_copy
- the model calls a tool
- kdeps runs it
- the result goes back to the model
Loaded by: kdeps (agent loop), /update, /settings, kdeps run, kdeps install, kdeps list, kdeps uninstall, kdeps update
In the code: kdeps (agent loop)agent.RegisterBuiltinToolsagent.definedAs
Install
A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.
Pin a version with kdeps install tools/clipboard_copy@<version>.
Contents
Copy text to the user's system clipboard (pbcopy on macOS, xclip or xsel on Linux, clip on Windows). Use when the user asks to copy something. Returns {copied, tool}; copied is false when text is empty.
- category
- system
- outputFormat
- json
| Parameter | Type | Description |
|---|---|---|
| text | string | The text to copy. |
Python script (declared in YAML, no Go code)
import json, subprocess, sys
text = str(json.loads(sys.argv[1]).get("text") or "")
if not text:
print(json.dumps({"copied": False, "tool": ""}))
sys.exit(0)
for argv in (["pbcopy"], ["xclip", "-selection", "clipboard"], ["xsel", "--clipboard", "--input"], ["clip"]):
try:
subprocess.run(argv, input=text.encode("utf-8"), check=True, capture_output=True, timeout=10)
except (OSError, subprocess.SubprocessError):
continue
print(json.dumps({"copied": True, "tool": argv[0]}))
sys.exit(0)
sys.exit("no clipboard command found (tried pbcopy, xclip, xsel, clip)")
version: 1.0.0
category: system
description: "Copy text to the user's system clipboard (pbcopy on macOS, xclip or xsel on Linux, clip on Windows). Use when the user asks to copy something. Returns {copied, tool}; copied is false when text is empty."
outputFormat: json
parameters:
text:
type: string
description: The text to copy.
python:
script: |
import json, subprocess, sys
text = str(json.loads(sys.argv[1]).get("text") or "")
if not text:
print(json.dumps({"copied": False, "tool": ""}))
sys.exit(0)
for argv in (["pbcopy"], ["xclip", "-selection", "clipboard"], ["xsel", "--clipboard", "--input"], ["clip"]):
try:
subprocess.run(argv, input=text.encode("utf-8"), check=True, capture_output=True, timeout=10)
except (OSError, subprocess.SubprocessError):
continue
print(json.dumps({"copied": True, "tool": argv[0]}))
sys.exit(0)
sys.exit("no clipboard command found (tried pbcopy, xclip, xsel, clip)")
Versions
| Version | Published | Status |
|---|---|---|
| 1.0.0 | 10/24/2026 | active |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 1.0.0
- Published
- 10/24/2026