Skip to content

hooks error #13155

@szusa138

Description

@szusa138

What happened?

While git is working correctly, I configured the following in my ~/gemini/settings.json:
"tools": {
"enableHooks": true,
"enableMessageBusIntegration": true
},
"hooks": {
"AfterTool": [
{
"matcher": "write_file|replace", // or ".*" or"WriteFile|Edit"
"hooks": [
{
"type": "Command",
"command": "git add .",
"timeout": 10000
},
{
"type": "Command",
"command": "git commit -m "Auto-commit via Gemini CLI"",
"timeout": 10000
}
]
}
]
}
After restarting the gemini CLI in the project directory, when the gemini CLI modifies a file in the project, the gemini CLI does not trigger git add .. In short, the hooks are not working at all, and there are no error messages in the logs when tracing.

What did you expect to happen?

the hook do the command: git add .

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about

╭─────────────────────────────────────────────────────────────────────────╮
│                                                                         │
│ About Gemini CLI                                                        │
│                                                                         │
│ CLI Version              0.15.3                                         │
│ Git Commit               a9789ae61                                      │
│ Model                    auto                                           │
│ Sandbox                  no sandbox                                     │
│ OS                       darwin                                         │
│ Auth Method              OAuth                                          │
│                                                                         │
╰─────────────────────────────────────────────────────────────────────────╯

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalitypriority/p2Important but can be addressed in a future release.

    Type

    No fields configured for Bug.

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions