Skip to content

Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)

Python
356 B
Raw Blame
"""Best-effort text copy for the diagnostic command."""

import pyperclip


class ClipboardUnavailable(Exception):
    """The current desktop cannot accept clipboard text."""


def copy_text(text: str) -> None:
    try:
        pyperclip.copy(text)
    except (pyperclip.PyperclipException, OSError) as error:
        raise ClipboardUnavailable from error