Skip to main content

GitHub Copilot CLI

Install NebGuard for GitHub Copilot CLI. First check the shared prerequisites: the nebguard binary on your PATH, and Copilot CLI 1.0.83 or newer already installed.

1. Run setup from the repository​

cd your-repository
nebguard setup copilot-cli

Setup merges NebGuard into .github/hooks/nebguard.json and preserves other hook entries. Each repository gets its own content-addressed NebGuard binary. Re-running setup is safe and updates only NebGuard's entries.

2. Enable hooks for headless runs​

Interactive Copilot sessions load repository hooks automatically. Non-interactive prompt mode needs this environment setting:

export GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS=true
copilot -p "your task" --allow-all-tools

Setup prints an ACTION REQUIRED warning when this setting is absent in a non-interactive environment. No hook-trust bypass flag is required.

3. Verify​

Run setup again from the same repository:

nebguard setup copilot-cli

Then start Copilot from that repository and ask it to make a harmless edit. A blocked action appears in Copilot's tool output with the NebGuard reason.

Uninstall​

Run this from the repository whose hook you want to remove:

nebguard uninstall --host copilot-cli

Uninstall removes only NebGuard's entries and that repository's installed binary. Other hooks remain unchanged.

Next steps​