canic-cli 0.227.0

Canic command line deployment tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
//! Clap command declarations and argument conversion; execution lives in main.

use canic_host::{Error, Network};
use clap::{Args, CommandFactory as _, Parser, Subcommand, ValueEnum};
use std::path::PathBuf;

#[derive(Parser)]
#[command(
    name = "canic",
    version,
    propagate_version = true,
    about = "Manage Canic apps, fleet deployments and Wasm artifacts"
)]
pub(super) struct Cli {
    /// Emit structured JSON on stdout.
    #[arg(long, global = true)]
    pub(super) json: bool,
    #[command(subcommand)]
    pub(super) command: Commands,
}

#[derive(Clone, Copy, ValueEnum)]
pub(super) enum ColorMode {
    Auto,
    Always,
    Never,
}

impl ColorMode {
    pub(super) fn enabled(self, terminal: bool, no_color: bool, dumb: bool) -> bool {
        match self {
            Self::Auto => terminal && !no_color && !dumb,
            Self::Always => true,
            Self::Never => false,
        }
    }
}

#[derive(Subcommand)]
pub(super) enum Commands {
    /// Initialize apps and manage their reusable canister definitions.
    #[command(subcommand)]
    App(AppCommand),
    /// Build or inspect local Wasm artifacts.
    #[command(subcommand)]
    Artifact(ArtifactCommand),
    /// List, deploy and observe fleets, or view a saved fleet report.
    #[command(subcommand)]
    Fleet(FleetCommand),
    /// Show a mainnet wallet's default receive address and public ICP/cycles balances.
    Wallet {
        /// Public owner principal; never an identity name or seed phrase.
        principal: String,
        /// Derive only the receive address locally, without network access.
        #[arg(long)]
        address_only: bool,
    },
}

#[derive(Args)]
pub(super) struct ConfigArgs {
    /// Override the current/direct-child canic.toml catalog.
    #[arg(long, value_name = "PATH")]
    pub(super) config: Option<PathBuf>,
}

impl ConfigArgs {
    pub(super) fn path(&self, app: Option<&str>) -> canic_host::Result<PathBuf> {
        canic_host::resolve_config_path(std::path::Path::new(""), self.config.as_deref(), app)
    }
}

#[derive(Args)]
pub(super) struct FleetScope {
    /// Override the journal (default .canic/apps/APP/fleets/FLEET); without config, .canic.
    #[arg(long)]
    pub(super) state_dir: Option<PathBuf>,
    /// Override the current/direct-child canic.toml catalog.
    #[arg(long)]
    pub(super) config: Option<PathBuf>,
    /// Select an app; required when the config has multiple apps.
    #[arg(long, conflicts_with = "no_config")]
    pub(super) app: Option<String>,
    /// Select a fleet within the app; required when the app has multiple fleets.
    #[arg(long, conflicts_with = "no_config")]
    pub(super) fleet: Option<String>,
    /// Ignore canic.toml and use the legacy .canic journal unless --state-dir is supplied.
    #[arg(long, conflicts_with = "config")]
    pub(super) no_config: bool,
}

#[derive(Subcommand)]
pub(super) enum AppCommand {
    /// Build app canisters from their declared Cargo recipes; deploys nothing.
    Build {
        #[command(flatten)]
        selection: AppConfigArgs,
        /// Build only this app canister's recipe; omit to build all canisters.
        #[arg(long, value_name = "CANISTER")]
        canister: Option<String>,
    },
    /// Define or list reusable app canisters; affects declarations for every fleet.
    #[command(subcommand)]
    Canister(AppCanisterCommand),
    /// Add a fleetless app, creating the config if missing; preserves existing source.
    Init {
        /// Logical application name.
        #[arg(value_name = "APP")]
        name: String,
        #[command(flatten)]
        config: ConfigArgs,
        /// Generate a new standalone source workspace and its config in this directory.
        #[arg(long, value_name = "DIRECTORY", conflicts_with = "config")]
        source: Option<PathBuf>,
        /// Matching local Canic checkout supplying the runtime and greeting contract.
        #[arg(long, value_name = "DIRECTORY", requires = "source")]
        canic_source: Option<PathBuf>,
    },
    /// List apps in the current and direct-child configs; makes no network calls.
    List {
        #[command(flatten)]
        config: ConfigArgs,
    },
}

#[derive(Args)]
pub(super) struct AppConfigArgs {
    #[command(flatten)]
    pub(super) config: ConfigArgs,
    /// Select an app; required when the config has multiple apps.
    #[arg(long)]
    pub(super) app: Option<String>,
}

#[derive(Subcommand)]
pub(super) enum AppCanisterCommand {
    /// Add a shared definition; deploys nothing and grants no management authority.
    Add {
        #[arg(value_name = "CANISTER")]
        name: String,
        #[command(flatten)]
        selection: AppConfigArgs,
        /// Application role, independent of controllers.
        #[arg(long)]
        role: Option<String>,
        /// Parent definition in this app; does not grant control or permission to spawn.
        #[arg(long, value_name = "CANISTER")]
        parent: Option<String>,
        /// Wasm input relative to the config file; planning retains the exact bytes.
        #[arg(long, value_name = "WASM_FILE")]
        wasm: Option<PathBuf>,
        /// Workspace manifest relative to the config file, for app build.
        #[arg(long, requires_all = ["package", "wasm"])]
        manifest: Option<PathBuf>,
        /// Cargo package producing this canister's Wasm.
        #[arg(long, requires = "manifest")]
        package: Option<String>,
        /// Native command codec target in the same package, built by app build.
        #[arg(long, requires = "package")]
        client: Option<String>,
    },
    /// List shared app definitions; no network or journal access.
    List {
        #[command(flatten)]
        selection: AppConfigArgs,
    },
}

#[derive(Subcommand)]
pub(super) enum ArtifactCommand {
    /// Build an application Wasm using the locked Cargo graph.
    Build {
        #[arg(long, default_value = "Cargo.toml")]
        manifest: PathBuf,
        /// Cargo package to compile; independent of app/fleet declarations.
        #[arg(long, value_name = "PACKAGE")]
        package: String,
        #[arg(long, value_delimiter = ',')]
        features: Vec<String>,
        /// Atomically write the built Wasm here, replacing a previous build input.
        #[arg(long, value_name = "WASM_FILE")]
        output: Option<PathBuf>,
    },
    /// Report the SHA-256 and size of a local Wasm file; no network calls.
    Inspect {
        #[arg(value_name = "WASM_FILE")]
        wasm: PathBuf,
    },
}

#[derive(Subcommand)]
pub(super) enum FleetCommand {
    /// Review exact optional Auth configuration and revocation approvals.
    #[command(subcommand)]
    Auth(FleetAuthCommand),
    /// Inspect publications or plan exact removal/restoration; no network calls.
    #[command(subcommand)]
    Artifact(FleetArtifactCommand),
    /// Cancel an unsubmitted whole-fleet approval; retain its evidence and release its slots.
    Cancel {
        #[command(flatten)]
        scope: FleetScope,
        #[arg(value_name = "OPERATION")]
        digest: String,
    },
    /// Bind existing canister IDs or list this fleet's app-defined slots; local config only.
    #[command(subcommand)]
    Canister(CanisterCommand),
    /// Add a fleet using the app's definitions, with no existing IDs; deploys nothing.
    #[command(mut_arg("network", |arg| arg.required(true)))]
    Init {
        /// New fleet name within the selected app.
        #[arg(value_name = "FLEET")]
        name: String,
        /// Select an existing app; required when the config has multiple apps.
        #[arg(long)]
        app: Option<String>,
        #[command(flatten)]
        config: ConfigArgs,
        #[command(flatten)]
        network: NetworkArgs,
    },
    /// List configured fleets across apps; use --app to filter. Makes no network calls.
    List {
        #[command(flatten)]
        config: ConfigArgs,
        /// Filter declarations by application name.
        #[arg(long)]
        app: Option<String>,
    },
    /// Compare two explicit mainnet subnet candidates; partial evidence exits 1.
    CompareSubnets {
        #[command(flatten)]
        selection: CanisterConfigArgs,
        #[arg(value_name = "LEFT_SUBNET_ID")]
        left: String,
        #[arg(value_name = "RIGHT_SUBNET_ID")]
        right: String,
    },
    /// Observe configured mainnet canister placements; no journals or deployment effects.
    Placements {
        #[command(flatten)]
        selection: CanisterConfigArgs,
    },
    /// Plan deployment, maintenance or publication, or preview a configured shard pool.
    #[command(mut_arg("icp_bin", |arg| arg.conflicts_with("controller")))]
    Plan {
        #[command(flatten)]
        scope: FleetScope,
        /// App-defined slot for deployment or artifact publication; repeats reuse its plan.
        #[arg(long, value_name = "SLOT", conflicts_with = "no_config")]
        canister: Option<String>,
        /// Local Wasm input; omit for a named canister with an app-defined Wasm path.
        #[arg(long, value_name = "WASM_FILE")]
        wasm: Option<PathBuf>,
        #[command(flatten)]
        network: Box<NetworkArgs>,
        /// Controller principal to bind into this exact plan.
        #[arg(
            long,
            value_name = "PRINCIPAL",
            required_unless_present = "identity",
            conflicts_with = "identity"
        )]
        controller: Option<String>,
        /// Read this signer's public principal and bind it as the controller; signs nothing.
        #[arg(long, required_unless_present = "controller")]
        identity: Option<String>,
        #[command(flatten)]
        signer: SignerArgs,
        /// Existing canister to upgrade, preserving its principal.
        #[arg(long, value_name = "PRINCIPAL", requires = "previous_module")]
        target: Option<String>,
        /// Certified module hash from the previous deployment receipt.
        #[arg(long, requires = "target")]
        previous_module: Option<String>,
        /// Exact reviewed Root module for child management, Store bootstrap or publication.
        #[arg(long, value_name = "SHA256", requires = "canister")]
        root_module: Option<String>,
        /// Exact initialization or upgrade frame to retain in a Store-backed child plan.
        #[arg(long, value_name = "FILE", requires_all = ["canister", "root_module", "release"])]
        install_args: Option<PathBuf>,
        /// Exact Blob maintenance attempt; selected Root must include its optional blob feature.
        #[arg(long, requires_all = ["target", "install_args"], value_parser = clap::value_parser!(u64).range(1..))]
        blob_attempt: Option<u64>,
        #[command(flatten)]
        publication: Box<PublicationArgs>,
        /// Optional future Unix seconds for Root's child dispatch; default is ready once approved.
        /// Reopening a slot keeps its original schedule.
        #[arg(long, value_name = "UNIX_SECONDS")]
        execute_at: Option<u64>,
        /// Total creation debit ceiling including fees: fleet defaults to 3T/4T for one/two apps, plus 1T for Store; single creation 1T, upgrade zero.
        #[arg(long, value_parser = clap::value_parser!(u64).range(0..=5_000_000_000_000))]
        cycles: Option<u64>,
    },
    /// Approve this exact digest and apply or resume its original signed attempts.
    Apply {
        #[command(flatten)]
        scope: FleetScope,
        #[arg(value_name = "OPERATION")]
        digest: String,
        #[arg(long)]
        identity: String,
        #[command(flatten)]
        signer: SignerArgs,
    },
    /// Explicitly activate the original Blob upgrade after verified closed reopening.
    Activate {
        #[command(flatten)]
        scope: FleetScope,
        #[arg(value_name = "OPERATION")]
        digest: String,
        #[arg(long)]
        identity: String,
        #[command(flatten)]
        signer: SignerArgs,
    },
    /// Observe an original app call or reconcile a Root approval without renewing authority.
    Reconcile {
        #[command(flatten)]
        scope: FleetScope,
        #[arg(value_name = "OPERATION")]
        digest: String,
        #[arg(long)]
        identity: String,
        #[command(flatten)]
        signer: SignerArgs,
    },
    /// Inspect local retained progress; makes no network calls.
    Status {
        #[command(flatten)]
        scope: FleetScope,
        /// Original operation digest retained in this fleet journal.
        #[arg(value_name = "OPERATION")]
        digest: String,
    },
    /// Observe the selected fleet; optionally save, serve or watch its report.
    #[command(group(clap::ArgGroup::new("viewer").args(["open", "serve", "watch"]).multiple(true)))]
    Show {
        #[command(flatten)]
        scope: FleetScope,
        /// ANSI colours in fleet terminal output; auto honours NO_COLOR and TERM=dumb.
        #[arg(long, value_enum, default_value_t = ColorMode::Auto)]
        color: ColorMode,

        /// Include code hashes, network bindings and timer diagnostics in terminal output.
        #[arg(long)]
        details: bool,
        /// Include this mainnet wallet's public default-account balances and receive address.
        #[arg(long, value_name = "PRINCIPAL")]
        wallet: Option<String>,
        /// Read a known profile manager's public journal and observe its reported worker.
        #[arg(long)]
        manager: Vec<String>,
        /// Show a declared application route ENTRY:WORKER between known targets (not an on-chain observation).
        #[arg(long, value_name = "ENTRY:WORKER")]
        link: Vec<String>,
        /// Write a new HTML report; existing files are preserved. No signed requests are exported.
        #[arg(long)]
        html: Option<PathBuf>,
        /// Serve a fresh report on localhost and launch the default browser; Ctrl-C stops the viewer.
        #[arg(long)]
        open: bool,
        /// Serve on localhost without opening a browser; Ctrl-C stops the viewer.
        #[arg(long)]
        serve: bool,
        /// Refresh the localhost view continuously; add --open to launch a browser.
        #[arg(long)]
        watch: bool,
        /// Local viewer port; zero selects a free port.
        #[arg(long, default_value_t = 8787, requires = "viewer")]
        port: u16,
    },
    /// Serve one saved HTML snapshot at a localhost URL; Ctrl-C stops the viewer.
    View {
        /// Saved HTML snapshot file, not a fleet name or live deployment.
        #[arg(value_name = "REPORT_HTML")]
        report: PathBuf,
        #[arg(long, default_value_t = 8787)]
        port: u16,
        /// Also launch the default browser.
        #[arg(long)]
        open: bool,
    },
    /// Execute an app-owned command directly as the selected user; retain uncertain outcomes.
    Call {
        #[command(flatten)]
        selection: CanisterConfigArgs,
        /// Override the selected fleet's application-call journal.
        #[arg(long)]
        state_dir: Option<PathBuf>,
        /// Select an app definition with a built native command codec.
        #[arg(long)]
        canister: String,
        /// User identity; being a controller grants no application permission.
        #[arg(long)]
        identity: String,
        #[command(flatten)]
        signer: SignerArgs,
        /// Named command and arguments interpreted by the application's codec.
        #[arg(required = true, num_args = 1..)]
        command: Vec<String>,
    },
}

#[derive(Args)]
pub(super) struct CanisterConfigArgs {
    #[command(flatten)]
    pub(super) config: ConfigArgs,
    /// Select an app; required when the config has multiple apps.
    #[arg(long)]
    pub(super) app: Option<String>,
    /// Select a fleet within the app; required when the app has multiple fleets.
    #[arg(long)]
    pub(super) fleet: Option<String>,
}

#[derive(Subcommand)]
pub(super) enum CanisterCommand {
    /// Bind an app-defined slot to an existing ID for observation; does not verify control.
    Bind {
        /// Existing app canister definition.
        #[arg(value_name = "SLOT")]
        name: String,
        /// Existing canister to observe on this fleet's network; does not verify control or deploy.
        #[arg(long, value_name = "PRINCIPAL")]
        id: String,
        #[command(flatten)]
        selection: CanisterConfigArgs,
    },
    /// List local slots and explicitly configured IDs; does not inspect deployments or journals.
    List {
        #[command(flatten)]
        selection: CanisterConfigArgs,
    },
}

impl FleetCommand {
    pub(super) fn scope(&self) -> Option<&FleetScope> {
        match self {
            Self::Plan { scope, .. }
            | Self::Cancel { scope, .. }
            | Self::Apply { scope, .. }
            | Self::Activate { scope, .. }
            | Self::Reconcile { scope, .. }
            | Self::Status { scope, .. }
            | Self::Show { scope, .. } => Some(scope),
            Self::CompareSubnets { .. }
            | Self::Call { .. }
            | Self::Artifact(_)
            | Self::Auth(_)
            | Self::Placements { .. }
            | Self::Canister(_)
            | Self::Init { .. }
            | Self::List { .. }
            | Self::View { .. } => None,
        }
    }
}

#[derive(Subcommand)]
pub(super) enum FleetAuthCommand {
    /// Retain the fleet's exact Auth grant; sends nothing.
    Plan {
        #[command(flatten)]
        selection: CanisterConfigArgs,
        #[arg(long)]
        state_dir: Option<PathBuf>,
        /// Named receiver slot. Required when several grants are declared.
        #[arg(long)]
        receiver: Option<String>,
        /// Actual sole Root controller; this approval grants no application permission.
        #[arg(long)]
        controller: String,
    },
    /// Retain terminal revocation of an original Auth configuration approval.
    PlanRevocation {
        #[arg(value_name = "CONFIGURATION_OPERATION")]
        operation: String,
        #[command(flatten)]
        selection: CanisterConfigArgs,
        #[arg(long)]
        state_dir: Option<PathBuf>,
    },
}

#[derive(Subcommand)]
pub(super) enum FleetArtifactCommand {
    /// List local publication approvals and validated completion; not the live Store catalog.
    List {
        #[command(flatten)]
        selection: CanisterConfigArgs,
        /// Override the selected fleet's journal directory.
        #[arg(long)]
        state_dir: Option<PathBuf>,
        /// Show operation IDs and original Wasm, Root and Store bindings.
        #[arg(long)]
        details: bool,
    },
    /// Plan exact removal from an independent publication; sends nothing.
    PlanRemoval {
        #[command(flatten)]
        selection: CanisterConfigArgs,
        #[arg(long)]
        state_dir: Option<PathBuf>,
        /// Original standalone publication approval.
        #[arg(value_name = "PUBLICATION_OPERATION")]
        operation: String,
        /// Delete published content or cancel an incomplete upload.
        #[arg(long, value_enum)]
        action: RemovalAction,
    },
    /// Plan same-content restoration after the original removal settles and expires; sends nothing.
    PlanRestoration {
        #[command(flatten)]
        selection: CanisterConfigArgs,
        #[arg(long)]
        state_dir: Option<PathBuf>,
        /// Original removal approval with its successful retained reply.
        #[arg(value_name = "REMOVAL_OPERATION")]
        operation: String,
    },
}

#[derive(Clone, Copy, ValueEnum)]
pub(super) enum RemovalAction {
    Cancel,
    Delete,
}

pub(super) fn checkout() -> Option<PathBuf> {
    let source = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
        .parent()?
        .parent()?;
    source
        .join("crates/canic-cli/Cargo.toml")
        .is_file()
        .then(|| source.to_owned())
}

pub(super) fn default_signer() -> PathBuf {
    checkout().map_or_else(
        || PathBuf::from("icp"),
        |source| source.join(".tools/ic/bin/icp"),
    )
}

#[derive(Args)]
pub(super) struct SignerArgs {
    /// Override the checkout signer or the registry installation's icp on PATH.
    #[arg(long, default_value_os_t = default_signer(), hide_default_value = true)]
    pub(super) icp_bin: PathBuf,
}

#[derive(Clone, Copy, ValueEnum)]
pub(super) enum NetworkName {
    Ic,
    Local,
}

#[derive(Args, Clone)]
pub(super) struct NetworkArgs {
    /// Explicit network; planning otherwise uses the selected fleet's binding.
    #[arg(long, value_enum)]
    pub(super) network: Option<NetworkName>,
    /// Local replica URL; --network local requires all four trust inputs.
    #[arg(long, required_if_eq("network", "local"))]
    pub(super) url: Option<String>,
    /// Local replica root key as hex.
    #[arg(long, required_if_eq("network", "local"))]
    pub(super) root_key: Option<String>,
    /// Independently obtained local root-subnet principal.
    #[arg(long, required_if_eq("network", "local"))]
    pub(super) root_subnet: Option<String>,
    /// Local routing canister principal.
    #[arg(long, required_if_eq("network", "local"))]
    pub(super) routing_canister: Option<String>,
}

impl NetworkArgs {
    pub(super) fn into_network(self) -> canic_host::Result<Network> {
        match self.network {
            Some(NetworkName::Ic)
                if self.url.is_none()
                    && self.root_key.is_none()
                    && self.root_subnet.is_none()
                    && self.routing_canister.is_none() =>
            {
                Ok(Network::Mainnet)
            }
            Some(NetworkName::Local) => Ok(Network::Local {
                root_subnet: self.root_subnet,
                url: self
                    .url
                    .ok_or_else(|| Error::Invalid("local URL required".into()))?,
                root_key: self
                    .root_key
                    .ok_or_else(|| Error::Invalid("local root key required".into()))?,
                routing_canister: self
                    .routing_canister
                    .ok_or_else(|| Error::Invalid("local routing canister required".into()))?,
            }),
            None => Err(Error::Invalid(
                "select --network ic or --network local explicitly".into(),
            )),
            _ => Err(Error::Invalid(
                "mainnet uses its fixed URL and compiled trust root".into(),
            )),
        }
    }
}

pub(super) fn help_command() -> clap::Command {
    fn banner(command: clap::Command) -> clap::Command {
        command
            .display_order(None)
            .help_template(concat!(
                "Canic ",
                env!("CARGO_PKG_VERSION"),
                " : {about-with-newline}\n{usage-heading} {usage}\n\n{all-args}{after-help}"
            ))
            .mut_subcommands(banner)
    }
    banner(Cli::command())
}

#[derive(Args)]
pub(super) struct PublicationArgs {
    /// Publish this named canister's artifact only; does not install or deploy it.
    #[arg(long, value_name = "VERSION", requires_all = ["canister", "root_module", "store", "store_module"], conflicts_with_all = ["target", "previous_module", "execute_at", "cycles"])]
    pub(super) publish_version: Option<String>,
    /// Deploy the exact release from this completed publication operation.
    #[arg(long, value_name = "PUBLICATION_OPERATION", requires_all = ["canister", "root_module"], conflicts_with = "publish_version")]
    pub(super) release: Option<String>,
    /// Existing bound wasm-store slot under the same Root as the artifact.
    #[arg(long, value_name = "SLOT", requires = "publish_version")]
    pub(super) store: Option<String>,
    /// Exact reviewed Store executable; publication requires Root's sole control.
    #[arg(long, value_name = "SHA256", requires = "publish_version")]
    pub(super) store_module: Option<String>,
}