mirror of
https://github.com/cline/cline.git
synced 2026-10-30 18:12:49 +08:00
* rename folders * fix examples reorg references * move over files * having agent fixing and validating all examples are still working * fix sidecar paths --------- Co-authored-by: abeatrix <beatrix@cline.bot>
20 lines
642 B
Bash
Executable File
20 lines
642 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Cline Hook: PreToolUse (Require Review)
|
|
# Pauses for review before writing to critical files
|
|
# Copy to ~/.cline/hooks/PreToolUse.sh and chmod +x
|
|
|
|
input=$(cat)
|
|
tool=$(echo "$input" | jq -r '.tool_call.name // ""')
|
|
file=$(echo "$input" | jq -r '.tool_call.input.filePath // ""')
|
|
|
|
# Require review for critical files
|
|
if [ "$tool" = "editor" ] || [ "$tool" = "write_file" ]; then
|
|
if [[ $file =~ (package\.json|tsconfig|\.env|secrets|config\.(ts|js)|\.cline) ]]; then
|
|
jq -n --arg file "$file" '{review: true, context: "This will modify a critical file: \($file)"}'
|
|
exit 0
|
|
fi
|
|
fi
|
|
|
|
# Allow everything else
|
|
echo '{}'
|