Universal clipboard formatter — copy content formatted for Teams, Loop, Outlook, ADO, and more.
npx clipboard-cli --help# Install globally
npm install -g clipboard-cli
# Or clone and link
git clone https://github.com/KalebCole/clipboard-cli && cd clipboard-cli
npm install && npm run build && npm link- Windows 10/11 with PowerShell 5.0+
- Node.js 18+
- Copilot CLI (optional — for
+lastand session commands)
⚠️ This is a Windows-only tool. It uses PowerShell and the Windows clipboard API (CF_HTML) for rich-text support. macOS and Linux are not supported.
# 1. Copy last Copilot response, formatted for Teams
clipboard copy teams
# 2. Copy a file, formatted for ADO comments
clipboard copy ado --source docs/design.md
# 3. Pipe from stdin
echo "**hello world**" | clipboard copy loop --stdin
# 4. List available formatters
clipboard formats listclipboard copy teams # Last Copilot response → Teams
clipboard copy loop --source file.md # File → Loop
echo "**hi**" | clipboard copy ado --stdin # Stdin → ADO
clipboard copy outlook # Last response → Outlook
clipboard copy plain # Strip markdown → plain text
clipboard copy raw # Raw markdown passthroughclipboard +last teams # Same as: clipboard copy teams
clipboard +last adoclipboard formats list # All formatters with descriptions
clipboard formats get ado # Details for a specific formatterclipboard session detect # Show current session ID
clipboard session read # Output last assistant responseclipboard doctor # Check PowerShell, clipboard, sessionclipboard schema copy # Show copy command parameters
clipboard schema +last # Show +last parameters| Format | Target Apps | Notes |
|---|---|---|
plain |
Any app | Strips all markdown |
raw |
Markdown editors | Passthrough |
teams |
Microsoft Teams | Clean semantic HTML (no inline styles) |
loop |
Microsoft Loop | Full styled HTML with tables, blockquotes |
outlook |
Outlook email | Email-safe HTML, Segoe UI font wrapper |
ado |
ADO comments/work items | Limited HTML subset, no CSS |
-
Create
src/formatters/<name>.tsimplementing theFormatterinterface:import type { Formatter } from '../types.js'; import { markdownToHtml, stripMarkdown } from '../lib/markdown.js'; const notion: Formatter = { name: 'notion', description: 'Rich text for Notion paste', clipboardFormats: ['HTML Format', 'UnicodeText'], format(markdown) { return { html: markdownToHtml(markdown), plainText: stripMarkdown(markdown) }; }, }; export default notion;
-
Register in
src/formatters/registry.ts:import notion from './notion.js'; const formatters: Formatter[] = [...existing, notion];
-
Build:
npm run build
That's it — clipboard copy notion works immediately.
| Flag | Description | Default |
|---|---|---|
--format <F> |
Output: json, table | json |
--dry-run |
Preview without copying | off |
-v, --verbose |
Details on stderr | off |
-o, --output <path> |
Write to file | stdout |
--no-color |
No ANSI colors | off |
All commands return structured JSON:
{
"status": "success",
"data": {
"format": "teams",
"contentLength": 1234,
"clipboardFormats": ["HTML Format", "UnicodeText"]
},
"metadata": {}
}Errors: { "status": "error", "error": { "code": 3, "type": "validation_error", "message": "..." } }
Exit codes: 0 success · 1 clipboard error · 3 validation · 4 not found · 5 internal
src/
├── cli.ts # Main entry, commander setup
├── types.ts # Formatter interface
├── commands/ # One file per resource (copy, formats, session, doctor, schema)
├── helpers/ # + commands (last)
├── lib/ # Shared utilities (output, errors, clipboard, session, cfhtml, markdown)
└── formatters/ # One file per formatter + registry
npm install # Install dependencies
npm run build # tsc → dist/
npm run dev # tsc --watch
npm test # vitest
npm run lint # tsc --noEmitSee docs/CONTRIBUTING.md.
MIT