Shapeshift — Paste Anything, Get the Right Code
Detects what's on your clipboard and offers contextual code transforms on paste. No more copy → paste → open tool → paste again → copy → paste back.
How It Works
- Copy anything — JSON, a curl command, a stack trace, a URL, CSV, env lines, or SQL
- Paste into your code file (Ctrl+V / Cmd+V)
- Shapeshift detects the content type and shows a CodeLens suggestion above the pasted block
- Click to transform, or just keep typing to dismiss
What It Detects
| Clipboard Content |
Suggested Transform |
Target Languages |
| JSON blob |
TypeScript interface / Python dataclass / Go struct / Rust struct / Java POJO / C# POCO |
TS, JS, Python, Go, Rust, Java, C# |
curl command |
fetch() or axios call |
TS, JS |
| Stack trace |
Annotate with file:line references |
Any |
| URL |
fetch() or requests.get() |
TS, JS, Python |
| CSV / TSV rows |
Array of arrays or objects |
Any |
KEY=value env lines |
Typed config object |
TS, JS, Python |
| SQL query (with JOINs, GROUP BY, etc.) |
Query builder chain |
Any |
Features
- Heuristic-first detection — fast, deterministic, no API calls for common cases
- Language-aware transforms — same JSON produces a TypeScript interface in
.ts, Python dataclass in .py, Go struct in .go, Rust struct in .rs, Java POJO in .java, C# POCO in .cs
- Multiple suggestions — click the right CodeLens when there are options (e.g., fetch vs axios)
- Diff preview — see the transformed output in a side-by-side diff before applying
- Undo-friendly — paste and transform share a single undo stop. One Cmd+Z reverts everything
- Non-intrusive — suggestions auto-dismiss after configurable timeout or when you start typing
- Per-transform settings — disable any transform type you don't need
- Mute system — dismiss a transform type enough times and it stops suggesting
- LLM fallback (opt-in) — for ambiguous content that heuristics can't identify, with consent prompt and secure API key storage
- SQL support — converts SELECT/INSERT/UPDATE/DELETE with JOINs, GROUP BY, HAVING, ORDER BY, and more
Setup
The extension registers keybindings for Ctrl+V (Windows/Linux) and Cmd+V (macOS) automatically. These override the default paste in editor windows — terminal paste is unaffected.
If you need to customize the keybinding, add to your keybindings.json:
{
"key": "ctrl+v",
"command": "shapeshift.pasteWithDetection",
"when": "editorTextFocus && !terminalFocus"
}
Settings
| Setting |
Default |
Description |
shapeshift.autoDismissMs |
15000 |
Auto-dismiss timeout in ms (0 to disable) |
shapeshift.enableJsonToInterface |
true |
Suggest JSON → typed interface/struct/class |
shapeshift.enableCurlToFetch |
true |
Suggest curl → fetch/axios |
shapeshift.enableStackTraceLinks |
true |
Suggest stack trace annotation |
shapeshift.enableCsvToArray |
true |
Suggest CSV → array |
shapeshift.enableEnvToTyped |
true |
Suggest env → typed config |
shapeshift.enableUrlToFetch |
true |
Suggest URL → fetch |
shapeshift.enableSqlToQueryBuilder |
true |
Suggest SQL → query builder |
shapeshift.enableLlmFallback |
false |
Enable LLM-based detection (sends clipboard to third-party API) |
shapeshift.llmEndpoint |
https://api.anthropic.com/v1/messages |
LLM API endpoint |
shapeshift.llmModel |
claude-3-5-sonnet-20241022 |
LLM model identifier |
shapeshift.llmMaxTokens |
1024 |
Max tokens for LLM response |
shapeshift.muteTransforms |
[] |
Transform types to permanently disable |
Development
npm install
npm run compile
# Press F5 in VS Code to launch Extension Development Host
Running Tests
npm run compile
npm run test:unit
Packaging
npm run package
| |