harn_cli/cli/pack.rs
1use std::path::PathBuf;
2
3use clap::Args;
4
5#[derive(Debug, Args)]
6#[command(arg_required_else_help = true)]
7pub struct PackArgs {
8 /// Entrypoint `.harn` file to pack. Transitive imports under the
9 /// entrypoint's directory are bundled alongside it.
10 pub entrypoint: PathBuf,
11
12 /// Output `.harnpack` path. Defaults to the entrypoint stem with
13 /// the `.harnpack` extension next to the entrypoint.
14 #[arg(long, value_name = "PATH")]
15 pub out: Option<PathBuf>,
16
17 /// Read an existing `.harnpack` and re-emit it under the v2
18 /// manifest, preserving the prior bundle's id, name, version,
19 /// triggers, workflow graph, and prompt capsules. The new
20 /// `<entrypoint>` argument supplies the transitive-modules /
21 /// SBOM payload that v1 lacked.
22 #[arg(long, value_name = "OLD_BUNDLE")]
23 pub upgrade: Option<PathBuf>,
24
25 /// Mark the bundle as unsigned. Signing lands in E6.3; today this
26 /// flag is documentary so scripts can opt into the future
27 /// `--sign`/`--unsigned` split without breaking.
28 #[arg(long, default_value_t = false)]
29 pub unsigned: bool,
30
31 /// Emit a `JsonEnvelope` summary instead of a human-readable
32 /// one-liner. Schema: `harn --json-schemas --command pack`.
33 #[arg(long, default_value_t = false)]
34 pub json: bool,
35}