| 40 | /// Install agent hooks for turn-level recording. |
| 41 | #[derive(Debug, Args)] |
| 42 | pub struct Enable { |
| 43 | /// Which agent to install hooks for. |
| 44 | /// |
| 45 | /// If not specified, auto-detects which agent is present in the |
| 46 | /// repository (looks for `.claude/`, `.gemini/`, etc.). |
| 47 | #[arg(long, value_name = "NAME")] |
| 48 | agent: Option<String>, |
| 49 | |
| 50 | /// Force reinstall hooks even if already installed. |
| 51 | /// |
| 52 | /// Removes existing Atomic hooks before installing new ones. |
| 53 | /// Non-Atomic hooks in the agent's config are preserved. |
| 54 | #[arg(short, long)] |
| 55 | force: bool, |
| 56 | |
| 57 | /// Install hooks for all detected agents. |
| 58 | /// |
| 59 | /// If multiple agents are detected (e.g., both Claude Code and |
| 60 | /// Gemini CLI are configured), install hooks for all of them. |
| 61 | #[arg(long)] |
| 62 | all: bool, |
| 63 | |
| 64 | /// Install hooks globally (~/.claude/settings.json). |
| 65 | /// |
| 66 | /// Global hooks fire for every Claude Code session regardless of |
| 67 | /// project. This is the recommended way to enable Atomic tracking — |
| 68 | /// install once, works everywhere that has a `.atomic/` directory. |
| 69 | #[arg(short, long)] |
| 70 | global: bool, |
| 71 | |
| 72 | /// Install hooks from an integration-supplied manifest file. |
| 73 | /// |
| 74 | /// The manifest (shipped by an integration package such as atomic-codex) |
| 75 | /// names its own target settings file and the hook commands to register, |
| 76 | /// and is merged in idempotently — preserving non-Atomic hooks. Because the |
| 77 | /// definitions live in the integration repo, updating an agent's hook |
| 78 | /// wiring never requires rebuilding `atomic`. When set, `--agent`/`--global` |
| 79 | /// are not needed; the manifest is self-describing. |
| 80 | #[arg(long, value_name = "FILE")] |
| 81 | hooks: Option<std::path::PathBuf>, |
| 82 | } |
| 83 | |
| 84 | impl Enable { |
| 85 | /// Create a default instance for testing. |
no outgoing calls