Repository navigation
docs(cli): document command hooks (hooks.yaml) - #293
Merged
Merged
Conversation
Add a dedicated Command Hooks page covering the .infer/hooks.yaml / ~/.infer/hooks.yaml feature (inference-gateway/cli#270), which runs user-configured shell commands at agent-loop hook points. The page documents: - where hooks live and the infer init default (enabled: false) - the schema: enabled, hooks[].name/hook/command/timeout - the full hook-point catalog (pre_session, pre_stream, post_stream, pre_tool, post_tool, pre_queue_drain, post_queue_drain, post_session) with post_session as the primary deterministic post-processing point - the authorization model: every command is gated through the existing per-mode bash allow-list; off-list commands are skipped and reported, never run (no new bypass of the secure-by-default model); enabling unattended runs via the allow-list or INFER_TOOLS_BASH_ALLOW_APPEND - the INFER_HOOKS_ENABLED master switch env override - the fire-and-observe hook_command stream event (no conversation feedback) - a post_session CI post-processing example (gofmt, go test, notify) - security notes Wire the page into the nav and sidebar of the VitePress config and add a hooks.yaml row to the Configuration Files reference table in cli.md (mirroring reminders.yaml). Closes #287
4 tasks
Contributor
|
🎉 This PR is included in version 0.6.114 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #287
Adds a dedicated Command Hooks page documenting the
.infer/hooks.yaml/~/.infer/hooks.yamlfeature (inference-gateway/cli#270), which runs user-configured shell commands at agent-loop hook points — the executable sibling of the system reminders shipped in inference-gateway/cli#669.What's added
New page
cli-hooks.md— wired into the nav + sidebar of the VitePress config, covering:.infer/hooks.yaml/ user~/.infer/hooks.yaml, generated byinfer init(defaultenabled: false).enabled,hooks[].name/hooks[].hook/hooks[].command/hooks[].timeout(with theinfer initdefault example).pre_session,pre_stream,post_stream,pre_tool,post_tool,pre_queue_drain,post_queue_drain,post_session), withpost_session("agent finished generating") called out as the primary deterministic post-processing point.tools.bash.mode.<mode>.allow); off-list commands are skipped and reported, never run (no new bypass of the secure-by-default model). Enabling unattended (CI) runs via the allow-list orINFER_TOOLS_BASH_ALLOW_APPEND(e.g.INFER_TOOLS_BASH_ALLOW_APPEND="gofmt.*").INFER_HOOKS_ENABLED=trueenv override.hook_commandstream event (name, exit code, duration, truncated output); output is not fed back into the conversation.post_sessionCI post-processing example —gofmt/go test/notifyhooks with a GitHub Actions env excerpt.cli.md— adds a Configuration Files reference table listing all config files including the newhooks.yamlrow (mirroringreminders.yaml), with a link to the new page.Acceptance criteria
hooks.yaml(schema:enabled,hooks[].name/hook/command/timeout) with theinfer initdefault example.INFER_TOOLS_BASH_ALLOW_APPENDto enable; secure-by-default headless).post_sessionCI post-processing example are documented.hooks.yaml.Verification
bun run build(page renders at/cli-hooks/)prettier --check .markdownlint "**/*.md"