Conversation
Add the new CLI hooks guide under docs/cli so it can be linked from the navigation update in the next commit.
Add the new CLI hooks page to the CLI section in docs/docs.json so it appears in the published documentation navigation.
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 69ab972a31
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
docs/cli/hooks.mdx
Outdated
|
|
||
| ## Event types | ||
|
|
||
| These are the event names currently supported by the CLI hooks system: |
There was a problem hiding this comment.
List only hook events that are actually emitted
This section says the listed events are “currently supported,” but several listed events are not emitted by the CLI runtime (for example PermissionRequest, SubagentStart, ConfigChange, and TaskCompleted): in extensions/cli/src/hooks/fireHook.ts there are no emitters for those events, and repo-wide usage shows no other services.hooks.fireEvent(...) call sites outside that helper file. As written, users can configure these events and never see hooks run, so the guide should mark them as planned/schema-only or remove them from the supported table.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 702698a. I updated the guide to list only the events the CLI actually emits today and explicitly marked the extra Claude-compatible event names as reserved/not emitted yet.
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
RomneyDa
left a comment
There was a problem hiding this comment.
See nitpicks. Try to make the tone more concise and remove cruft.
| | `command` | Runs a shell command and sends the event payload to stdin as JSON | Supports `async`, `timeout`, and `statusMessage` | | ||
| | `http` | Sends the event payload to an HTTP endpoint with a `POST` request | Supports custom headers and env var interpolation | | ||
| | `prompt` | Reserved for single-turn LLM hook handling | Not yet implemented | | ||
| | `agent` | Reserved for multi-turn agent hook handling | Not yet implemented | |
There was a problem hiding this comment.
Why include "Not yet implemented" here?
| } | ||
| ``` | ||
|
|
||
| Continue still loads the configured hooks, but it skips executing them while this flag is enabled. |
There was a problem hiding this comment.
Could you remove this last sentence? Loads but doesn't execute doesn't mean much I think
| | Result | Behavior | | ||
| |--------|----------| | ||
| | `0` | Continue normally | | ||
| | `2` | Block the action. `stderr` becomes the feedback shown to the user | |
There was a problem hiding this comment.
change "the user" to "you"
| raise SystemExit(2) | ||
| ``` | ||
|
|
||
| Because the script exits with code `2`, Continue blocks the tool call and shows the error message to the user. |
There was a problem hiding this comment.
Change "the user" to you or just remove.
|
I think this feature wasn't quite ready for documentation yet, actually hadn't been fully implemented so far. Going to close this for now and if we end up fully shipping hooks beyond an experiment will definitely welcome documentation! |
Description
Closes #11221.
This adds a new CLI hooks guide that documents configuration locations, supported hook and event types, blocking behavior, and a couple of end-to-end examples. It also links the page from the CLI docs navigation so the guide shows up in the published sidebar. The change is intentionally small and safe because it only adds documentation plus a single docs navigation entry, with no runtime or config behavior changes.
Checklist
Tests
npx --yes prettier --check --no-config --tab-width 2 --use-tabs false --trailing-comma all --semi true --single-quote false --bracket-spacing true docs/cli/hooks.mdx docs/docs.jsonnpx mintlify broken-linksWhy this is small and safe
Summary by cubic
Adds a CLI Hooks guide covering config precedence, hook and event types, blocking behavior, and two examples. Clarifies which events the CLI emits today vs. reserved Claude-compatible events, and links the page in the CLI docs navigation; fulfills Linear #11221.
Written for commit 702698a. Summary will update on new commits.