Lightweight clipboard tools for Windows that complement Microsoft's built-in clip command.
Microsoft's clip command only supports writing to clipboard (stdin → clipboard). These tools provide the missing functionality:
- cget: Read text from clipboard and output to stdout (clipboard → stdout)
- cset: Write text from stdin to clipboard (stdin → clipboard, with Unicode support)
- 🚀 Lightweight: ~23KB each, no dependencies
- 🔤 Unicode Support: Automatic encoding detection (UTF-8/Shift_JIS)
- 🔄 Bidirectional: Complete clipboard read/write functionality
- 🖥️ Windows Native: Uses Windows API directly
- 📦 Single Executable: No runtime dependencies required
Download pre-built executables from Releases
# Requirements: GCC (MinGW-w64)
winget install BrechtSanders.WinLibs.POSIX.UCRT
# Build
gcc -O2 -s -static src/cget.c -o cget.exe
gcc -O2 -s -static src/cset.c -o cset.exe# Read from clipboard
cget
# Write to clipboard
echo "Hello World" | cset
# Save clipboard to file
cget > output.txt
# Load file to clipboard
type file.txt | cset# Process clipboard content and return
cget | findstr "keyword" | cset
# Combine with Microsoft clip
echo "data" | clip # Using Microsoft's clip
cget | cset # Round-trip processing
# Directory listing to clipboard
dir | cset# Show help
cget --help
cset -h
cget /?| Command | Direction | Notes |
|---|---|---|
clip |
stdin → clipboard | Microsoft official |
cset |
stdin → clipboard | Equivalent with Unicode support |
cget |
clipboard → stdout | Missing functionality (provided here) |
0: Success (text output)1: Cannot open clipboard2: No text data
0: Success1: Memory allocation failed2: No stdin input3: Character conversion failed4: Cannot open clipboard5-7: Clipboard operation failed
- Language: C (Windows API)
- Compiler: GCC (MinGW-w64)
- Size: ~23KB each
- Dependencies: None (static linking)
- Windows Support: Windows XP and later
- Encoding: Automatic detection (UTF-8/Shift_JIS/ANSI)
MIT License - see LICENSE file
Copyright (c) 2025 thrashem
Pull requests welcome! Please ensure:
- Code follows existing style
- Windows compatibility maintained
- No external dependencies added