docs: add docs for hooks + extensions (#16073)

This commit is contained in:
Abhi
2026-01-07 15:46:44 -05:00
committed by GitHub
parent 4c961df313
commit 17b3eb730a
3 changed files with 79 additions and 5 deletions
+18
View File
@@ -1018,6 +1018,24 @@ const SECRET_PATTERNS = [
];
```
## Packaging as an extension
While project-level hooks are great for specific repositories, you might want to
share your hooks across multiple projects or with other users. You can do this
by packaging your hooks as a [Gemini CLI extension](../extensions/index.md).
Packaging as an extension provides:
- **Easy distribution:** Share hooks via a git repository or GitHub release.
- **Centralized management:** Install, update, and disable hooks using
`gemini extensions` commands.
- **Version control:** Manage hook versions separately from your project code.
- **Variable substitution:** Use `${extensionPath}` and `${process.execPath}`
for portable, cross-platform scripts.
To package hooks as an extension, follow the
[extensions hook documentation](../extensions/index.md#hooks).
## Learn more
- [Hooks Reference](index.md) - Complete API reference and configuration