Documentation
¶
Overview ¶
Package block_dangerous_commands implements the ctx system block-dangerous-commands subcommand.
It provides a regex safety net that catches dangerous command patterns such as mid-command sudo, git push, and binary installs that the deny-list cannot express.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmd ¶
Cmd returns the "ctx system block-dangerous-commands" subcommand.
Returns:
- *cobra.Command: Configured block-dangerous-commands subcommand
func Run ¶
Run executes the block-dangerous-commands hook logic.
Reads a hook input from stdin, checks the command against dangerous patterns (mid-command sudo, git push, cp/mv to bin), and emits a block response if matched.
Parameters:
- cmd: Cobra command for output
- stdin: standard input for hook JSON
Returns:
- error: Always nil (hook errors are non-fatal)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.