Skip to content

Instantly share code, notes, and snippets.

@agritheory
Last active December 23, 2024 18:04
Show Gist options
  • Save agritheory/b0513d723c099a254326248ef37b788e to your computer and use it in GitHub Desktop.
Save agritheory/b0513d723c099a254326248ef37b788e to your computer and use it in GitHub Desktop.
clip-claude() {
local base_dir="${1:-.}" # Use current directory if no directory specified
local pattern="${2:-*/*.ts}" # Default to */*.ts if no pattern specified
(
find "$base_dir" -type f -name "$pattern" | sort | while read -r file; do
echo "// File: $file"
cat "$file" 2>/dev/null || echo "File not found: $file"
done
) | clip.exe
}
@agritheory
Copy link
Author

Use default (current dir, /.ts)

clip-claude

Specify a different directory

clip-claude ./src

Specify a custom pattern

clip-claude . "*.js"

Fully specified

clip-claude ./project "**/types.ts"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment