kontext CLI to connect self-serve endpoints and check their health. Install it with Homebrew:
Run
kontext <command> --help to see the options in your installed version.
setup
--token, setup prompts for the API key.
Codex asks you to review new hooks before it runs them. After setup, open
/hooks in Codex 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. After an upgrade, run kontext doctor. If the daemon runs an older binary, run kontext doctor --fix. Your MDM updates MDM-managed endpoints.