diff --git a/docs/cline-cli/cli-reference.mdx b/docs/cline-cli/cli-reference.mdx index 3e97a33aea..71be64f8af 100644 --- a/docs/cline-cli/cli-reference.mdx +++ b/docs/cline-cli/cli-reference.mdx @@ -278,6 +278,29 @@ TASK SETTINGS mode Starting mode (act/plan) + hooks_enabled + Enable or disable hooks for the task (true/false) + +HOOKS INTEGRATION + Hooks let you inject custom logic into Cline's workflow at key moments. + They can validate operations before they execute, monitor tool usage, + and shape AI decisions. This allows you to integrate hooks into + automated workflows, CI/CD pipelines, and headless task execution. + + Enable hooks for a task: + + cline "prompt" -s hooks_enabled=true + + Configure hooks globally: + + cline config set hooks-enabled=true + cline config get hooks-enabled + + Note: Hooks in the CLI are only supported on macOS and Linux. + + For complete hooks documentation, see: + + NOTES & EXAMPLES The cline task send and cline task new commands support reading from stdin, enabling powerful pipeline compositions: diff --git a/docs/cline-cli/overview.mdx b/docs/cline-cli/overview.mdx index e63ed92428..c9bea9d07e 100644 --- a/docs/cline-cli/overview.mdx +++ b/docs/cline-cli/overview.mdx @@ -57,6 +57,20 @@ During installation, you'll authenticate and configure your preferred provider u - Create GitLab pipelines that generate migration scripts from schema changes - Build Jenkins jobs that use Cline to analyze test failures and suggest fixes +## Hooks integration + +[Hooks](/features/hooks/index) let you inject custom logic into Cline's workflow to validate operations and enforce policies. You can enable hooks when running tasks from the command line: + +```bash +# Enable hooks for a task +cline "What does this repo do?" -s hooks_enabled=true + +# Configure hooks globally via CLI +cline config set hooks-enabled=true +``` + +This allows you to integrate hooks into automated workflows, CI/CD pipelines, and headless task execution for consistent enforcement across all environments. + ## Learn more diff --git a/docs/features/hooks/index.mdx b/docs/features/hooks/index.mdx index 0760e11ceb..e7506b8953 100644 --- a/docs/features/hooks/index.mdx +++ b/docs/features/hooks/index.mdx @@ -137,10 +137,30 @@ The key is combining hooks with external tools. A hook can be the glue between C -## Related Features +## CLI support + +Hooks are also available in the [Cline CLI](/cline-cli/overview). You can enable or disable hooks when running tasks from the command line: + +```bash +# Enable hooks for a task +cline "What does this repo do?" -s hooks_enabled=true + +# Configure hooks globally via CLI +cline config set hooks-enabled=true +cline config get hooks-enabled +``` + +This allows you to integrate hooks into automated workflows, CI/CD pipelines, and headless task execution. + + +Hooks in the CLI are only supported on macOS and Linux. Windows support is not yet available. + + +## Related features Hooks complement other Cline features: - [Cline Rules](/features/cline-rules) define high-level guidance that hooks can enforce - [Checkpoints](/features/checkpoints) let you roll back changes if a hook didn't catch an issue - [Auto-Approve](/features/auto-approve) works well with hooks as safety nets for automated operations +- [Cline CLI](/cline-cli/overview) enables hooks in terminal-based and automated workflows