Skip to main content

heddle_cli_args/cli/cli_args/
commands_integration.rs

1// SPDX-License-Identifier: Apache-2.0
2//! Harness integration command definitions.
3
4use clap::Subcommand;
5
6#[derive(Subcommand, Clone, Debug)]
7pub enum IntegrationCommands {
8    /// List Heddle-managed harness integrations.
9    List,
10
11    /// Install harness integrations.
12    Install(IntegrationInstallArgs),
13
14    /// Verify installed harness integrations.
15    Doctor,
16
17    /// Uninstall harness integrations.
18    Uninstall(IntegrationTargetArgs),
19
20    /// Rewrite Heddle-managed integrations in place.
21    Upgrade(IntegrationTargetArgs),
22
23    /// Internal relay invoked by installed hooks/plugins.
24    #[command(hide = true)]
25    Relay(IntegrationRelayArgs),
26
27    /// Fast identity-cursor write. Prefer the argv fast path in `main`.
28    #[command(hide = true)]
29    Stamp(IntegrationStampArgs),
30}
31
32#[derive(Clone, Debug, clap::Args)]
33pub struct IntegrationInstallArgs {
34    /// Harness names to install (`codex`, `claude-code`, `opencode`). Empty means detected set.
35    pub harnesses: Vec<String>,
36
37    /// Install scope (`repo` or `user`).
38    #[arg(
39        long,
40        visible_alias = "harness-install-scope",
41        default_value = "repo",
42        value_parser = ["repo", "user"]
43    )]
44    pub scope: String,
45
46    /// Overwrite Heddle-managed entries when needed.
47    #[arg(long)]
48    pub force: bool,
49
50    /// Bake the absolute path of the running heddle binary into the hook commands
51    /// instead of the default PATH-relative `heddle`. Useful when pinning to a
52    /// specific build (e.g. on a multi-version host).
53    #[arg(long)]
54    pub absolute_path: bool,
55}
56
57#[derive(Clone, Debug, clap::Args)]
58pub struct IntegrationTargetArgs {
59    /// Harness names to target. Empty means all Heddle-managed harnesses.
60    pub harnesses: Vec<String>,
61}
62
63#[derive(Clone, Debug, clap::Args)]
64pub struct IntegrationRelayArgs {
65    /// Harness name.
66    pub harness: String,
67
68    /// Event name.
69    pub event: String,
70}
71
72#[derive(Clone, Debug, clap::Args)]
73pub struct IntegrationStampArgs {
74    /// Harness name (`claude-code`, `codex`, `opencode`, `pi`).
75    pub harness: String,
76
77    /// Existing StatusLine command to run after the cursor write.
78    #[arg(long)]
79    pub chain: Option<String>,
80}