Skip to main content

cli/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
28#[derive(Clone, Debug, clap::Args)]
29pub struct IntegrationInstallArgs {
30    /// Harness names to install (`codex`, `claude-code`, `opencode`). Empty means detected set.
31    pub harnesses: Vec<String>,
32
33    /// Install scope (`repo` or `user`).
34    #[arg(
35        long,
36        visible_alias = "harness-install-scope",
37        default_value = "repo",
38        value_parser = ["repo", "user"]
39    )]
40    pub scope: String,
41
42    /// Overwrite Heddle-managed entries when needed.
43    #[arg(long)]
44    pub force: bool,
45
46    /// Bake the absolute path of the running heddle binary into the hook commands
47    /// instead of the default PATH-relative `heddle`. Useful when pinning to a
48    /// specific build (e.g. on a multi-version host).
49    #[arg(long)]
50    pub absolute_path: bool,
51}
52
53#[derive(Clone, Debug, clap::Args)]
54pub struct IntegrationTargetArgs {
55    /// Harness names to target. Empty means all Heddle-managed harnesses.
56    pub harnesses: Vec<String>,
57}
58
59#[derive(Clone, Debug, clap::Args)]
60pub struct IntegrationRelayArgs {
61    /// Harness name.
62    pub harness: String,
63
64    /// Event name.
65    pub event: String,
66}