Skip to content

Instantly share code, notes, and snippets.

View LxYuan0420's full-sized avatar
✈️
On client travel - responses may be slower

Lik Xun Yuan (Lx) LxYuan0420

✈️
On client travel - responses may be slower
View GitHub Profile
@LxYuan0420
LxYuan0420 / cc-clipboard-alias.sh
Last active February 24, 2026 07:46
A minimalist but powerful Bash/Zsh alias that quickly copies the content of files or directories (Python, MDC, Shell scripts) directly to your clipboard with file headers for easy pasting into editors or ChatGPT prompts. Perfect when you need a fast and straightforward solution without installing any additional packages or dependencies.
# cc: pbcopy on steroids for file or directory
function cc() {
local target="$1"
if [[ -z "$target" ]]; then
echo "Usage: cc <file-or-directory>"
return 1
fi
# Resolve to absolute path