Cursor · HooksFlujo de trabajo
Confirm git push
Asks for your approval before pushing.
by Prompt Studio
hooksbeforeShellExecution
License: MITView original
Contents
Where it goes: .cursor/hooks.json
{
"version": 1,
"hooks": {
"beforeShellExecution": [
{
"command": "bash -c 'jq -r .command | grep -Eiq -e \"git push\" && echo \"{\\\"permission\\\":\\\"ask\\\",\\\"userMessage\\\":\\\"Confirma antes de hacer push\\\",\\\"agentMessage\\\":\\\"Confirma antes de hacer push\\\"}\" || echo \"{\\\"permission\\\":\\\"allow\\\"}\"'"
}
]
}
}
More in Hooks
Block dangerous commands
Stops rm -rf, git push --force and similar before they run.
Protect .env
Prevents the agent from reading files with secrets.
Format on edit
Runs Prettier on every file the agent edits.
Lint on stop
Runs the linter when the agent finishes its turn.
Notify when done
Desktop notification when the agent finishes (macOS).
Command log
Saves every agent command to .cursor/audit.log.