kontext CLI to connect self-serve endpoints and check their health. Install it with Homebrew:
brew install kontext) gets each release a few hours later; update it with brew upgrade kontext.
Run
kontext <command> --help to see the options in your installed version.
setup
--token, setup prompts for the API key.
Codex runs new hooks only after you trust them. After setup, run
codex, open /hooks and trust the Kontext hooks.
You can rerun setup at any time. A new API key for the same workspace replaces the stored key and restarts the daemon. An API key for another workspace switches the endpoint to that workspace.
On an MDM-managed endpoint, setup detects the managed package and asks before removing it. Decline and update the endpoint through your MDM.
The kontext setup --uninstall command removes the daemon, hooks and stored configuration. It removes every stored API key from your keychain. The endpoint keeps its identity so later setup uses the same endpoint. Local data and logs remain under ~/Library/Application Support/Kontext and ~/Library/Logs/Kontext. Run brew uninstall kontext to remove the remaining kontext binary.
whoami
none (workspace key) as the person. See API keys for the two key types.
doctor
See Troubleshooting for each doctor result.
report
hooks
kontext setup also installs and removes these hooks. These commands leave the daemon running unchanged.
What Kontext installs lists every file these commands touch.
claude managed-settings
template command prints managed settings containing Kontext hooks. The validate [path] command checks that the file contains them. Without a path, it checks /Library/Application Support/ClaudeCode/managed-settings.json. Both commands accept --kontext-binary <path> for an executable outside /usr/local/bin/kontext.
Version and updates
--version option prints the version and source revision. The cask updates itself: the daemon checks a few minutes after it starts and every six hours, upgrades through Homebrew, and restarts on the new version. kontext doctor shows the update source and the last check. For the homebrew-core formula, run brew upgrade kontext. If the daemon runs an older binary, run kontext doctor --fix. Your MDM updates MDM-managed endpoints.