euv-cli 0.51.0

Cross-platform CLI tool for the euv native UI framework supporting run, build, check, fmt, doctor, new, and Hyperlane SSE dynamic updates across all supported platforms.
Documentation
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
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
use super::*;

/// CLI target selector covering all 38 concrete euv targets plus target groups (`desktop`, `mobile`, `apple`, `terminal`, `harmony-all`, `wearables`, `miniapps`, `quickapps`, `native`, `all`).
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize, ValueEnum)]
pub enum TargetArg {
    /// Browser WebAssembly target (`wasm32-unknown-unknown`).
    Web,
    /// Android native NDK target (`aarch64-linux-android`).
    Android,
    /// iOS native UIKit/Metal device target (`aarch64-apple-ios`).
    Ios,
    /// iOS Simulator UIKit/Metal target (`aarch64-apple-ios-sim`).
    #[value(name = "ios-sim")]
    IosSim,
    /// iPadOS native UIKit/Metal device target (`aarch64-apple-ios`).
    Ipad,
    /// iPadOS Simulator UIKit/Metal target (`aarch64-apple-ios-sim`).
    #[value(name = "ipad-sim")]
    IpadSim,
    /// macOS native AppKit/Metal target (`aarch64-apple-darwin` / `x86_64-apple-darwin`).
    Macos,
    /// Windows native Win32/D3D12 target (`x86_64-pc-windows-msvc` / `aarch64-pc-windows-msvc`).
    Windows,
    /// Linux native Wayland/X11/Vulkan target (`x86_64-unknown-linux-gnu` / `aarch64-unknown-linux-gnu`).
    Linux,
    /// Interactive PTY Terminal UI target.
    Tui,
    /// Non-interactive static/pipe CLI terminal target.
    Cli,
    /// Google/Samsung Wear OS smartwatch target.
    Wearos,
    /// Apple watchOS smartwatch target.
    Watchos,
    /// Huawei HarmonyOS Watch wearable target.
    #[value(name = "harmony-wearable")]
    HarmonyWearable,
    /// Xiaomi HyperOS / Vela Watch wearable target.
    Vela,
    /// vivo BlueOS Watch smartwatch target (`blueos` / `vivo`).
    #[value(name = "vivo-watch", alias = "blueos", alias = "vivo")]
    VivoWatch,
    /// OPPO ColorOS Watch / Wear OS dual-engine smartwatch target.
    #[value(name = "oppo-watch", alias = "oppo")]
    OppoWatch,
    /// Garmin Connect IQ smartwatch target.
    #[value(name = "garmin")]
    Garmin,
    /// Amazfit Zepp OS smartwatch target.
    #[value(name = "zeppos", alias = "amazfit")]
    Zeppos,
    /// Generic smart wearable target building all supported smartwatch ecosystems.
    Wearable,
    /// HarmonyOS / OpenHarmony multi-form-factor native target (phone/tablet/pc/foldable/tv/car).
    Harmony,
    /// HarmonyOS PC / 2-in-1 desktop native target (`harmony-pc` / `harmony-2in1`).
    #[value(name = "harmony-pc", alias = "harmony-2in1")]
    HarmonyPc,
    /// WeChat Mini-Program target (`wx`).
    Wechat,
    /// Alipay Mini-Program target (`my`).
    Alipay,
    /// Douyin / ByteDance Mini-Program target (`tt`).
    Douyin,
    /// Baidu Smart Mini-Program target (`swan`).
    Baidu,
    /// QQ Mini-Program target (`qq`).
    Qq,
    /// Kuaishou Mini-Program target (`ks`).
    Kuaishou,
    /// JD Mini-Program target (`jd`).
    #[value(name = "jd", alias = "jingdong")]
    Jd,
    /// Xiaohongshu Mini-Program target (`xhs`).
    #[value(name = "xhs", alias = "xiaohongshu")]
    Xhs,
    /// DingTalk Mini-Program target (`dd`).
    #[value(name = "dingtalk", alias = "dd")]
    Dingtalk,
    /// Feishu / Lark Mini-Program target (`tt`).
    #[value(name = "feishu", alias = "lark")]
    Feishu,
    /// Taobao Mini-Program target (`my`).
    #[value(name = "taobao", alias = "tb")]
    Taobao,
    /// Meituan Mini-Program target (`mt`).
    #[value(name = "meituan", alias = "mt")]
    Meituan,
    /// HarmonyOS Atomic Service target (`atomic`).
    #[value(name = "harmony-atomic")]
    HarmonyAtomic,
    /// QuickApp Alliance / Huawei QuickApp unified target.
    Quickapp,
    /// QuickApp Alliance (`@system.*` OEM distribution) target.
    #[value(name = "quickapp-alliance")]
    QuickappAlliance,
    /// Huawei QuickApp (`@system.*` + `@service.*`) target.
    #[value(name = "quickapp-huawei")]
    QuickappHuawei,
    /// Target group expanding to `macos`, `windows`, and `linux`.
    Desktop,
    /// Target group expanding to `android`, `ios`, `ipad`, `ios-sim`, `ipad-sim`, and `harmony`.
    Mobile,
    /// Target group expanding to `macos`, `ios`, `ipad`, `ios-sim`, `ipad-sim`, and `watchos`.
    Apple,
    /// Target group expanding to `tui` and `cli`.
    Terminal,
    /// Target group expanding to `harmony`, `harmony-pc`, `harmony-wearable`, and `harmony-atomic`.
    #[value(name = "harmony-all")]
    HarmonyAll,
    /// Target group expanding to all 9 wearable targets.
    Wearables,
    /// Target group expanding to all 13 Mini-Program targets.
    Miniapps,
    /// Target group expanding to all 3 QuickApp targets.
    Quickapps,
    /// Current host native target.
    Native,
    /// Every supported production euv platform (36 targets).
    All,
}

/// Optional HarmonyOS / OpenHarmony device form factor selector for `euv build --target harmony`.
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum HarmonyFormFactorArg {
    /// HarmonyOS phone device profile.
    #[default]
    Phone,
    /// HarmonyOS tablet device profile.
    Tablet,
    /// HarmonyOS PC / 2-in-1 desktop device profile.
    Pc,
    /// HarmonyOS foldable display device profile.
    Foldable,
    /// HarmonyOS smart TV / Vision device profile.
    Tv,
    /// HarmonyOS automotive / cockpit device profile.
    Car,
    /// HarmonyOS smartwatch wearable device profile.
    Wearable,
}

/// CLI render pipeline mode selector.
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum RenderArg {
    /// Automatically prefer hardware GPU with software fallback.
    Auto,
    /// Deterministic software CPU rasterizer.
    Software,
    /// Native GPU instanced pipeline.
    Hardware,
    /// Hybrid CPU vector + GPU texture compositor.
    Hybrid,
}

/// Target mode for the `euv dev` hot-reload and OTA development server.
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum DevTargetArg {
    /// Build and live-reload all project Markdown documentation pages.
    Docs,
    /// Build and live-reload WebAssembly zero-JS bundles plus Dynamic WASM OTA feed.
    Web,
    /// Watch Rust sources, rebuild, hot-restart the native app, and serve Dynamic WASM OTA updates.
    Native,
    /// Watch Rust sources and relaunch interactive PTY Terminal UI builds.
    Tui,
    /// Watch Rust sources and rerun static/pipe CLI terminal builds.
    Cli,
    /// Watch Rust sources and rebuild HarmonyOS HAP bundles.
    Harmony,
    /// Watch Rust sources and rebuild wearable smartwatch bundles.
    Wearable,
    /// Watch Rust sources and rebuild Mini-Program bundles.
    Miniapp,
    /// Watch Rust sources and rebuild QuickApp bundles.
    Quickapp,
}

/// Project scaffolding template selector for `euv new --template`.
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum ProjectTemplateArg {
    /// Cross-platform native + Web Rust UI application (`src/main.rs` + `src/lib.rs` + `euv.toml`).
    #[default]
    App,
    /// WebAssembly zero-JS browser application (`cdylib` + `wasm-bindgen` entry + `euv.toml`).
    Web,
    /// Hot-updatable Dynamic WASM widget crate exporting `euv_abi_version` and `euv_render`.
    #[value(name = "dynamic-widget")]
    DynamicWidget,
    /// Multi-locale VuePress-style Markdown documentation site configured for `euv docs`.
    Docs,
}

/// Shell type selector for `euv completions <shell>`.
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, ValueEnum)]
pub enum ShellKindArg {
    /// Bourne Again SHell completion script.
    Bash,
    /// Z shell completion function (`_euv`).
    Zsh,
    /// Friendly Interactive Shell completion rules.
    Fish,
    /// PowerShell `Register-ArgumentCompleter` script.
    #[value(name = "powershell", alias = "pwsh")]
    Powershell,
}

/// Subcommands under `euv docs` for building or live-serving project Markdown documentation.
#[derive(Clone, Debug, Eq, PartialEq, Subcommand)]
pub enum DocsAction {
    /// Builds all Markdown files under a project or docs directory into a static or WASM site.
    Build {
        /// Shared source, output, title, base URL, and WASM build flags.
        #[command(flatten)]
        build: DocsBuildArgs,
    },
    /// Builds and serves Markdown documentation with live file-watching and SSE hot reload.
    Dev {
        /// Shared source, output, title, base URL, and WASM build flags.
        #[command(flatten)]
        build: DocsBuildArgs,
        /// Shared dev server bind, poll interval, and smoke-run flags.
        #[command(flatten)]
        server: ServerBindArgs,
    },
}

/// Subcommands under `euv update` for operating the Hyperlane HTTP + SSE dynamic update server and local store.
#[derive(Clone, Debug, Eq, PartialEq, Subcommand)]
pub enum UpdateAction {
    /// Starts the read-only Hyperlane HTTP + SSE dynamic update server backed by the local store directory.
    Serve {
        /// Local update store root directory (`staging/`, `blobs/`, `releases/`, `channels/`, `state/`).
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Host bind address.
        #[arg(long, default_value = DEFAULT_UPDATE_SERVER_HOST)]
        host: String,
        /// TCP listen port (`0` selects an ephemeral port).
        #[arg(long, default_value_t = DEFAULT_UPDATE_SERVER_PORT)]
        port: u16,
        /// Optional external reverse-proxy base URL (e.g. `https://ota.example.com/euv`).
        #[arg(long)]
        proxy_base: Option<String>,
        /// SSE keep-alive heartbeat interval in milliseconds.
        #[arg(long, default_value_t = DEFAULT_UPDATE_HEARTBEAT_MS)]
        heartbeat_ms: u64,
        /// Background channel pointer watcher polling interval in milliseconds.
        #[arg(long, default_value_t = DEFAULT_UPDATE_WATCH_POLL_MS)]
        poll_ms: u64,
        /// Validate store layout and server bind readiness then exit immediately.
        #[arg(long, default_value_t = false)]
        once: bool,
        /// Print the structured server configuration without binding sockets.
        #[arg(long, default_value_t = false)]
        plan: bool,
    },
    /// Stages and SHA-256-verifies a release manifest and its blobs into `staging/<stage_id>/`.
    Stage {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Logical project identifier.
        #[arg(long)]
        project: String,
        /// Release channel name (e.g. `prod`).
        #[arg(long)]
        channel: String,
        /// Unique stage identifier name.
        #[arg(long)]
        stage_id: String,
        /// Path to the draft JSON `ReleaseManifest` file.
        #[arg(long)]
        manifest: PathBuf,
        /// Directory containing built artifact blobs referenced by `manifest`.
        #[arg(long)]
        blobs_dir: PathBuf,
    },
    /// Atomically signs and publishes a staged release with a strictly monotonic sequence number.
    Publish {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Logical project identifier.
        #[arg(long)]
        project: String,
        /// Release channel name.
        #[arg(long)]
        channel: String,
        /// Previously staged directory name under `staging/`.
        #[arg(long)]
        stage_id: String,
        /// Offline HMAC-SHA256 signing secret (or provide `--signing-key-env`).
        #[arg(long)]
        signing_key: Option<String>,
        /// Environment variable name holding the offline signing secret.
        #[arg(long, default_value = ENV_UPDATE_SIGNING_KEY)]
        signing_key_env: String,
    },
    /// Signs a NEW monotonic release pointing back to a historical release's verified blobs (never replaying old manifests).
    Rollback {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Logical project identifier.
        #[arg(long)]
        project: String,
        /// Release channel name.
        #[arg(long)]
        channel: String,
        /// Historical release sequence whose verified artifacts should be restored.
        #[arg(long)]
        to_release: u64,
        /// Offline HMAC-SHA256 signing secret (or provide `--signing-key-env`).
        #[arg(long)]
        signing_key: Option<String>,
        /// Environment variable name holding the offline signing secret.
        #[arg(long, default_value = ENV_UPDATE_SIGNING_KEY)]
        signing_key_env: String,
    },
    /// Inspects active channel pointers, release counts, and content-addressed blob inventory in a local update store.
    Status {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Optional project filter.
        #[arg(long)]
        project: Option<String>,
        /// Optional channel filter.
        #[arg(long)]
        channel: Option<String>,
    },
    /// Builds, verifies, signs, and atomically publishes a live hot-update release from a `.json` UI spec, `.wasm` binary, or inline `--title` in one command.
    Push {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Logical project identifier.
        #[arg(long, default_value = DEFAULT_UPDATE_PROJECT)]
        project: String,
        /// Release channel name.
        #[arg(long, default_value = DEFAULT_UPDATE_CHANNEL)]
        channel: String,
        /// Optional target route path to update (defaults to `"/dynamic-panel"` when neither `--route` nor `--slot` is specified).
        #[arg(long)]
        route: Option<String>,
        /// Optional component slot identifier to update (defaults to `"promo_banner"` when neither `--route` nor `--slot` is specified).
        #[arg(long)]
        slot: Option<String>,
        /// Path to a JSON `DynamicNodeSpec` or compiled `.wasm` artifact file.
        #[arg(long)]
        file: Option<PathBuf>,
        /// Optional inline card title generating a ready-to-push declarative or WASM update.
        #[arg(long)]
        title: Option<String>,
        /// Optional body copy paired with `--title` for quick live OTA updates.
        #[arg(long)]
        body: Option<String>,
        /// Generate a genuine `.wasm` module binary when using `--title` instead of declarative JSON.
        #[arg(long, default_value_t = false)]
        wasm_widget: bool,
        /// Optional RGB hex accent color (e.g. `0x16A34A` or `16A34A`) when using `--title`.
        #[arg(long)]
        accent_hex: Option<String>,
        /// Offline HMAC-SHA256 signing secret (or provide `--signing-key-env`).
        #[arg(long)]
        signing_key: Option<String>,
        /// Environment variable name holding the offline signing secret.
        #[arg(long, default_value = ENV_UPDATE_SIGNING_KEY)]
        signing_key_env: String,
    },
    /// Watches a `.json` UI spec or `.wasm` artifact file and automatically pushes signed live hot-update releases whenever it changes.
    Watch {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Logical project identifier.
        #[arg(long, default_value = DEFAULT_UPDATE_PROJECT)]
        project: String,
        /// Release channel name.
        #[arg(long, default_value = DEFAULT_UPDATE_CHANNEL)]
        channel: String,
        /// Optional target route path to update.
        #[arg(long)]
        route: Option<String>,
        /// Optional component slot identifier to update.
        #[arg(long)]
        slot: Option<String>,
        /// Watched `.json` UI spec or `.wasm` binary file path.
        #[arg(long)]
        file: PathBuf,
        /// File polling interval in milliseconds.
        #[arg(long, default_value_t = DEFAULT_UPDATE_WATCH_POLL_MS)]
        poll_ms: u64,
        /// Perform a single verified push then exit immediately.
        #[arg(long, default_value_t = false)]
        once: bool,
        /// Offline HMAC-SHA256 signing secret (or provide `--signing-key-env`).
        #[arg(long)]
        signing_key: Option<String>,
        /// Environment variable name holding the offline signing secret.
        #[arg(long, default_value = ENV_UPDATE_SIGNING_KEY)]
        signing_key_env: String,
    },
    /// Initializes an atomic local OTA update store layout and optional project/channel config.
    Init {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Default logical project identifier.
        #[arg(long, default_value = DEFAULT_UPDATE_PROJECT)]
        project: String,
        /// Default release channel name.
        #[arg(long, default_value = DEFAULT_UPDATE_CHANNEL)]
        channel: String,
        /// Optional explicit signing key (otherwise generates a fresh random hex secret).
        #[arg(long)]
        signing_key: Option<String>,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Generates a cryptographically strong HMAC-SHA256 signing key hex string for OTA releases.
    Keygen {
        /// Number of random entropy bytes to generate (default `32` bytes = 64 hex chars).
        #[arg(long, default_value_t = DEFAULT_KEYGEN_BYTES)]
        bytes: usize,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Compiles a Rust dynamic widget crate to `wasm32-unknown-unknown`, validates ABI exports, and optionally pushes a live OTA release.
    Build {
        /// Optional Cargo package name to build.
        #[arg(short = 'p', long)]
        package: Option<String>,
        /// Optional path to the widget crate directory.
        #[arg(long)]
        path: Option<PathBuf>,
        /// Destination file path for the verified `.wasm` widget binary.
        #[arg(long)]
        out: Option<PathBuf>,
        /// Immediately sign and publish the compiled `.wasm` widget to `--store`.
        #[arg(long, default_value_t = false)]
        push: bool,
        /// Local update store root directory when `--push` is set.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Logical project identifier when `--push` is set.
        #[arg(long, default_value = DEFAULT_UPDATE_PROJECT)]
        project: String,
        /// Release channel name when `--push` is set.
        #[arg(long, default_value = DEFAULT_UPDATE_CHANNEL)]
        channel: String,
        /// Optional target route path when `--push` is set.
        #[arg(long)]
        route: Option<String>,
        /// Optional target slot identifier when `--push` is set.
        #[arg(long)]
        slot: Option<String>,
        /// Offline HMAC-SHA256 signing secret (or provide `--signing-key-env`).
        #[arg(long)]
        signing_key: Option<String>,
        /// Environment variable name holding the offline signing secret.
        #[arg(long, default_value = ENV_UPDATE_SIGNING_KEY)]
        signing_key_env: String,
        /// Compile the dynamic widget crate with `--release`.
        #[arg(long, default_value_t = false)]
        release: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Runs a unified single-command Hyperlane OTA server + live file watcher printing localhost and LAN URLs.
    Dev {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Host bind address.
        #[arg(long, default_value = DEFAULT_UPDATE_SERVER_HOST)]
        host: String,
        /// TCP listen port (`0` selects an ephemeral port).
        #[arg(long, default_value_t = DEFAULT_UPDATE_SERVER_PORT)]
        port: u16,
        /// Optional external reverse-proxy base URL.
        #[arg(long)]
        proxy_base: Option<String>,
        /// Logical project identifier.
        #[arg(long, default_value = DEFAULT_UPDATE_PROJECT)]
        project: String,
        /// Release channel name.
        #[arg(long, default_value = DEFAULT_DEV_UPDATE_CHANNEL)]
        channel: String,
        /// Optional target route path.
        #[arg(long)]
        route: Option<String>,
        /// Optional component slot identifier.
        #[arg(long)]
        slot: Option<String>,
        /// Optional `.json` spec or `.wasm` artifact file watched for automatic live pushes.
        #[arg(long)]
        file: Option<PathBuf>,
        /// Watcher polling interval in milliseconds.
        #[arg(long, default_value_t = DEFAULT_UPDATE_WATCH_POLL_MS)]
        poll_ms: u64,
        /// SSE keep-alive heartbeat interval in milliseconds.
        #[arg(long, default_value_t = DEFAULT_UPDATE_HEARTBEAT_MS)]
        heartbeat_ms: u64,
        /// Offline HMAC-SHA256 signing secret (or provide `--signing-key-env`).
        #[arg(long)]
        signing_key: Option<String>,
        /// Environment variable name holding the offline signing secret.
        #[arg(long, default_value = ENV_UPDATE_SIGNING_KEY)]
        signing_key_env: String,
        /// Validate startup and optional initial push then exit immediately.
        #[arg(long, default_value_t = false)]
        once: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Audits offline HMAC-SHA256 signatures, channel pointers, and SHA-256 integrity of every referenced blob in a store.
    Verify {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Logical project identifier.
        #[arg(long, default_value = DEFAULT_UPDATE_PROJECT)]
        project: String,
        /// Release channel name.
        #[arg(long, default_value = DEFAULT_UPDATE_CHANNEL)]
        channel: String,
        /// Optional specific release sequence to verify (defaults to active release).
        #[arg(long)]
        release: Option<u64>,
        /// Offline HMAC-SHA256 verification secret (or provide `--signing-key-env`).
        #[arg(long)]
        signing_key: Option<String>,
        /// Environment variable name holding the verification secret.
        #[arg(long, default_value = ENV_UPDATE_SIGNING_KEY)]
        signing_key_env: String,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Compares two release sequences showing route, track, and content-addressed blob deltas.
    Diff {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Logical project identifier.
        #[arg(long, default_value = DEFAULT_UPDATE_PROJECT)]
        project: String,
        /// Release channel name.
        #[arg(long, default_value = DEFAULT_UPDATE_CHANNEL)]
        channel: String,
        /// Baseline historical release sequence number.
        #[arg(long)]
        from: u64,
        /// Target release sequence number to compare against `--from`.
        #[arg(long)]
        to: u64,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Garbage-collects unreferenced blobs and stale staging directories while preserving active and recent releases.
    Gc {
        /// Local update store root directory.
        #[arg(long, default_value = DEFAULT_UPDATE_STORE_DIR)]
        store: PathBuf,
        /// Number of most recent releases per channel to preserve.
        #[arg(long, default_value_t = DEFAULT_GC_KEEP)]
        keep: usize,
        /// Report reclaimable files and bytes without deleting anything.
        #[arg(long, default_value_t = false)]
        dry_run: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
}

/// Subcommands under `euv blender` for Blender 4.x/5.x inspection, export, baking, Live-Link sync, and add-on installation.
#[derive(Clone, Debug, Eq, PartialEq, Subcommand)]
pub enum BlenderAction {
    /// Checks local Blender binary, version (4.0+/5.1+), glTF 2.0 exporter, Live-Link add-on, and Blender Lab MCP reachability.
    Doctor {
        /// Optional explicit path to a Blender executable overriding `EUV_BLENDER_BIN` and `PATH`.
        #[arg(long)]
        blender_bin: Option<PathBuf>,
        /// Localhost TCP port probed for the official Blender Lab MCP bridge.
        #[arg(long, default_value_t = DEFAULT_BLENDER_MCP_PORT)]
        mcp_port: u16,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Inspects a `.blend`, `.glb`, `.gltf`, `.euv3d`, or `.obj` file natively in pure Rust with zero Blender installation required.
    Inspect {
        /// Path to the 3D asset file to inspect.
        file: PathBuf,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Imports a `.blend`, `.glb`, `.gltf`, or `.obj` asset into an output directory with optional `.euv3d` compilation.
    Import {
        /// Source `.blend`, `.glb`, `.gltf`, or `.obj` file path.
        input: PathBuf,
        /// Output directory receiving the imported asset, manifest, and optional `.euv3d` archive.
        #[arg(long)]
        out: PathBuf,
        /// Optional explicit path to a Blender executable for `.blend` files.
        #[arg(long)]
        blender_bin: Option<PathBuf>,
        /// Also compile a 64-byte-aligned `.euv3d` package alongside the imported asset.
        #[arg(long, default_value_t = false)]
        bake: bool,
        /// Number of Garland-Heckbert QEM LOD levels when `--bake` is enabled (`1..=4`).
        #[arg(long, default_value_t = DEFAULT_BLENDER_BAKE_LODS)]
        lods: usize,
        /// Enable spatially clustered meshlets when `--bake` is enabled.
        #[arg(long, default_value_t = false)]
        meshlets: bool,
        /// Disable spatially clustered meshlets when `--bake` is enabled.
        #[arg(long, default_value_t = false)]
        no_meshlets: bool,
        /// Enable pre-baked SIMD BVH4 acceleration structures when `--bake` is enabled.
        #[arg(long, default_value_t = false)]
        bvh4: bool,
        /// Disable pre-baked SIMD BVH4 acceleration structures when `--bake` is enabled.
        #[arg(long, default_value_t = false)]
        no_bvh4: bool,
        /// Print the planned import/export steps as JSON without executing.
        #[arg(long, default_value_t = false)]
        plan: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Compiles a `.blend`, `.glb`, `.gltf`, or `.obj` asset into a zero-copy 64-byte-aligned `.euv3d` package.
    Bake {
        /// Source `.blend`, `.glb`, `.gltf`, or `.obj` file path.
        input: PathBuf,
        /// Destination `.euv3d` output file path.
        #[arg(long)]
        out: PathBuf,
        /// Optional explicit path to a Blender executable for `.blend` files.
        #[arg(long)]
        blender_bin: Option<PathBuf>,
        /// Number of Garland-Heckbert QEM LOD levels to bake (`1..=4`).
        #[arg(long, default_value_t = DEFAULT_BLENDER_BAKE_LODS)]
        lods: usize,
        /// Explicitly enable spatially clustered meshlets (enabled by default unless `--no-meshlets` is set).
        #[arg(long, default_value_t = false)]
        meshlets: bool,
        /// Disable spatially clustered meshlets.
        #[arg(long, default_value_t = false)]
        no_meshlets: bool,
        /// Explicitly enable pre-baked SIMD BVH4 trees (enabled by default unless `--no-bvh4` is set).
        #[arg(long, default_value_t = false)]
        bvh4: bool,
        /// Disable pre-baked SIMD BVH4 trees.
        #[arg(long, default_value_t = false)]
        no_bvh4: bool,
        /// Print the planned bake steps as JSON without executing.
        #[arg(long, default_value_t = false)]
        plan: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Watches a 3D source file or directory, auto-baking `.euv3d` updates and streaming Live-Link SSE events.
    Watch {
        /// Source `.blend`, `.glb`, `.gltf`, `.obj` file or directory to watch.
        path: PathBuf,
        /// Output directory receiving compiled `.euv3d` artifacts.
        #[arg(long)]
        out: PathBuf,
        /// Host bind interface for the embedded Live-Link HTTP/SSE server.
        #[arg(long, default_value = DEFAULT_BLENDER_SYNC_HOST)]
        host: String,
        /// TCP port for the embedded Live-Link HTTP/SSE server (`0` selects an ephemeral port).
        #[arg(long, default_value_t = DEFAULT_BLENDER_SYNC_PORT)]
        port: u16,
        /// Optional explicit path to a Blender executable for `.blend` sources.
        #[arg(long)]
        blender_bin: Option<PathBuf>,
        /// Watcher polling interval in milliseconds.
        #[arg(long, default_value_t = DEFAULT_BLENDER_WATCH_POLL_MS)]
        poll_ms: u64,
        /// Number of Garland-Heckbert QEM LOD levels (`1..=4`).
        #[arg(long, default_value_t = DEFAULT_BLENDER_BAKE_LODS)]
        lods: usize,
        /// Execute one bake and Live-Link readiness check then exit immediately.
        #[arg(long, default_value_t = false)]
        once: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Runs the Hyperlane HTTP+SSE Live-Link daemon receiving fast JSON deltas and selective `.glb` hot-swaps.
    LiveSync {
        /// Host bind interface.
        #[arg(long, default_value = DEFAULT_BLENDER_SYNC_HOST)]
        host: String,
        /// TCP listen port (default `9877`, avoiding Blender Lab MCP port `9876`; `0` selects an ephemeral port).
        #[arg(long, default_value_t = DEFAULT_BLENDER_SYNC_PORT)]
        port: u16,
        /// Optional directory mirroring uploaded `.glb` / `.euv3d` assets to disk.
        #[arg(long)]
        out_dir: Option<PathBuf>,
        /// SSE keep-alive heartbeat interval in milliseconds.
        #[arg(long, default_value_t = DEFAULT_BLENDER_HEARTBEAT_MS)]
        heartbeat_ms: u64,
        /// Validate listener startup and exit immediately.
        #[arg(long, default_value_t = false)]
        once: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Installs or prints the production Blender 4.x/5.x `euv_live_link.py` Live-Link add-on.
    AddonInstall {
        /// Explicit output file or directory path for `euv_live_link.py`.
        #[arg(long)]
        out: Option<PathBuf>,
        /// Print raw `euv_live_link.py` Python source directly to stdout without writing to disk.
        #[arg(long, default_value_t = false)]
        print: bool,
        /// Emit machine-readable JSON installation metadata (ignored when `--print` is set).
        #[arg(long, default_value_t = false)]
        json: bool,
    },
}

/// Top-level `euv` CLI subcommands.
#[derive(Clone, Debug, Eq, PartialEq, Subcommand)]
pub enum Commands {
    /// Runs an euv application for a target platform and render mode, with optional `--watch` hot reload.
    Run {
        /// Target platform to launch.
        #[arg(long, value_enum, default_value_t = TargetArg::Native)]
        target: TargetArg,
        /// Optional HarmonyOS form factor (`phone`, `tablet`, `pc`, `foldable`, `tv`, `car`, `wearable`).
        #[arg(long, value_enum, default_value_t = HarmonyFormFactorArg::Phone)]
        form_factor: HarmonyFormFactorArg,
        /// Rendering pipeline mode.
        #[arg(long, value_enum, default_value_t = RenderArg::Auto)]
        render: RenderArg,
        /// Build and run in release mode.
        #[arg(long, default_value_t = false)]
        release: bool,
        /// Optional Cargo package name to run.
        #[arg(short = 'p', long)]
        package: Option<String>,
        /// Enable file-watching hot reload and live OTA update serving.
        #[arg(short = 'w', long, default_value_t = false)]
        watch: bool,
        /// HTTP hot-reload/OTA port when `--watch` is enabled.
        #[arg(long, default_value_t = 8080)]
        port: u16,
        /// Print the execution plan without spawning Cargo.
        #[arg(long, default_value_t = false)]
        plan: bool,
        /// Stream child process output directly to the terminal (defaults to `true` for interactive/TTY ergonomics).
        #[arg(long, default_value_t = true, num_args = 0..=1, default_missing_value = "true")]
        stream: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Starts the hot-reload and Dynamic WASM OTA development server for Web, Native, Docs, Terminal, Harmony, Wearable, MiniApp, or QuickApp.
    Dev {
        /// Development pipeline target (`web`, `native`, `docs`, `tui`, `cli`, `harmony`, `wearable`, `miniapp`, `quickapp`).
        #[arg(long, value_enum, default_value_t = DevTargetArg::Web)]
        target: DevTargetArg,
        /// Rendering pipeline mode default.
        #[arg(long, value_enum, default_value_t = RenderArg::Auto)]
        render: RenderArg,
        /// Build and serve in release mode when rebuilding Web or Native targets.
        #[arg(long, default_value_t = false)]
        release: bool,
        /// Optional project root directory to watch (defaults to current directory).
        #[arg(long)]
        path: Option<PathBuf>,
        /// Optional output directory for built bundles.
        #[arg(long)]
        out: Option<PathBuf>,
        /// Optional Cargo package name to rebuild on changes.
        #[arg(short = 'p', long)]
        package: Option<String>,
        /// Shared dev server bind, poll interval, and smoke-run flags.
        #[command(flatten)]
        server: ServerBindArgs,
        /// Enable live Dynamic WASM OTA manifest + `.wasm` hot-update endpoint (`--ota=false` disables).
        #[arg(long, default_value_t = true, num_args = 0..=1, default_missing_value = "true")]
        ota: bool,
        /// Enable sub-second hot-OTA widget/spec live swapping without restarting the host app.
        #[arg(long, default_value_t = false)]
        hot_ota: bool,
        /// Watch a dynamic widget crate or declarative JSON spec path for automatic v1 OTA hot pushes.
        #[arg(long)]
        watch_ota: Option<PathBuf>,
        /// Emit `Cross-Origin-Opener-Policy` and `Cross-Origin-Embedder-Policy` headers for SharedArrayBuffer / WASM threads.
        #[arg(long, default_value_t = false)]
        coop_coep: bool,
        /// Logical project identifier used by the embedded v1 OTA server.
        #[arg(long, default_value = DEFAULT_UPDATE_PROJECT)]
        project: String,
        /// Release channel name used by the embedded v1 OTA server.
        #[arg(long, default_value = DEFAULT_DEV_UPDATE_CHANNEL)]
        channel: String,
        /// Optional HMAC-SHA256 signing secret for the embedded v1 OTA server.
        #[arg(long)]
        signing_key: Option<String>,
        /// File watcher debounce interval in milliseconds before starting a rebuild.
        #[arg(long, default_value_t = DEFAULT_DEV_DEBOUNCE_MS)]
        debounce_ms: u64,
        /// Print the structured dev server plan without spawning processes.
        #[arg(long, default_value_t = false)]
        plan: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Manages the Hyperlane HTTP + SSE dynamic update server and atomic local release store (`serve`, `stage`, `publish`, `rollback`, `status`, `push`, `watch`, `init`, `keygen`, `build`, `dev`, `verify`, `diff`, `gc`).
    Update {
        /// Dynamic update server or store management subcommand.
        #[command(subcommand)]
        action: UpdateAction,
    },
    /// Builds or live-serves a static or multi-locale WASM documentation site from project `.md` files.
    Docs {
        /// Optional `build` or `dev` subcommand (defaults to building all project `.md` files).
        #[command(subcommand)]
        action: Option<DocsAction>,
        /// Shared source, output, title, base URL, and WASM flags.
        #[command(flatten)]
        build: DocsBuildArgs,
        /// Enable live watch and SSE hot-reload dev server directly from `euv docs --watch`.
        #[arg(short = 'w', long, default_value_t = false)]
        watch: bool,
        /// Shared dev server bind, poll interval, and smoke-run flags when `--watch` is active.
        #[command(flatten)]
        server: ServerBindArgs,
    },
    /// Builds native, mobile, simulator, terminal, wearable, HarmonyOS, Mini-Program, QuickApp, or Web bundles for one, multiple, or all targets.
    Build {
        /// Target platform(s) or group(s) (repeatable and comma-separated, e.g. `--target web,android,macos`).
        #[arg(long, value_enum, value_delimiter = ',', action = ArgAction::Append)]
        target: Vec<TargetArg>,
        /// Shorthand for `--target all` across every supported production platform.
        #[arg(long, default_value_t = false)]
        all: bool,
        /// Print the target readiness table for the current host and exit without building.
        #[arg(long, default_value_t = false)]
        list_targets: bool,
        /// Optional Cargo package name to build.
        #[arg(short = 'p', long)]
        package: Option<String>,
        /// Optional output directory for packaged artifacts.
        #[arg(long)]
        out_dir: Option<PathBuf>,
        /// Optional exact output file path (e.g. APK path for single-file artifacts).
        #[arg(long)]
        out_file: Option<PathBuf>,
        /// Optional archive file path (`.tar.gz` or `.zip`) packing the staged output directory.
        #[arg(long)]
        archive: Option<PathBuf>,
        /// Optional asset URL base prefix for Web bundles (e.g. `./` or `/euv/`).
        #[arg(long)]
        base: Option<String>,
        /// Skip targets whose required host OS or SDK toolchain is unavailable instead of aborting.
        #[arg(long, default_value_t = false)]
        skip_unavailable: bool,
        /// Execute independent target builds in parallel across worker threads.
        #[arg(long, default_value_t = false)]
        parallel: bool,
        /// Maximum concurrent target build jobs when `--parallel` is active.
        #[arg(short = 'j', long)]
        jobs: Option<usize>,
        /// Emit a deterministic SHA-256 `euv-release.json` artifact inventory after building.
        #[arg(long, default_value_t = false)]
        manifest: bool,
        /// Verify generated bundle integrity, SHA-256 manifest, zero-JS rules, and release AI-schema stripping.
        #[arg(long, default_value_t = false)]
        verify: bool,
        /// Emit raw `.wasm` + icons + `build-plan.json` without running `wasm-bindgen-cli`.
        #[arg(long, default_value_t = false)]
        raw_wasm: bool,
        /// Skip optional binaryen `wasm-opt` size optimization on Web builds.
        #[arg(long, default_value_t = false)]
        skip_wasm_opt: bool,
        /// Build all compiled theme variants (`default` + `theme-*` features) for Web targets.
        #[arg(long, default_value_t = false)]
        theme_variants: bool,
        /// Skip automatic simulator/emulator launch after mobile builds.
        #[arg(long, default_value_t = false)]
        no_launch: bool,
        /// Install the built mobile/wearable/Harmony bundle onto a connected device or emulator.
        #[arg(long, default_value_t = false)]
        install: bool,
        /// Run a headless smoke verification (`--headless --software`) after building native binaries.
        #[arg(long, default_value_t = false)]
        smoke: bool,
        /// Include the `euv` CLI binary alongside the app binary in desktop bundles.
        #[arg(long, default_value_t = false)]
        include_cli: bool,
        /// Explicit semantic version override (defaults to workspace `Cargo.toml` version).
        #[arg(long)]
        version: Option<String>,
        /// Target native ABIs (repeatable/comma-separated, e.g. `--abi arm64-v8a,x86_64`).
        #[arg(long, value_delimiter = ',', action = ArgAction::Append)]
        abi: Vec<String>,
        /// Additional Cargo feature flags to enable (repeatable/comma-separated).
        #[arg(long, value_delimiter = ',', action = ArgAction::Append)]
        features: Vec<String>,
        /// Optional device or simulator identifier for `--install` or launch steps.
        #[arg(long)]
        device: Option<String>,
        /// Optional custom PNG icon source path replacing the default euv brand mark.
        #[arg(long)]
        icon: Option<PathBuf>,
        /// Optional HarmonyOS device form factor (`phone`, `tablet`, `pc`, `foldable`, `tv`, `car`, `wearable`).
        #[arg(long, value_enum, default_value_t = HarmonyFormFactorArg::Phone)]
        form_factor: HarmonyFormFactorArg,
        /// Rendering pipeline mode override (defaults to `hardware` on Apple mobile/watch targets and `auto` elsewhere).
        #[arg(long, value_enum)]
        render: Option<RenderArg>,
        /// Enable release optimization profile.
        #[arg(long, default_value_t = false)]
        release: bool,
        /// Print structured JSON build plans without executing.
        #[arg(long, default_value_t = false)]
        plan: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Checks Rust compilation across one, multiple, or all cross-platform targets.
    Check {
        /// Check all supported platform targets in sequence.
        #[arg(long, default_value_t = false)]
        all_targets: bool,
        /// Target platform(s) or group(s) to check (repeatable and comma-separated).
        #[arg(long, value_enum, value_delimiter = ',', action = ArgAction::Append)]
        target: Vec<TargetArg>,
        /// Treat Rust compiler warnings as errors (`RUSTFLAGS="-D warnings"`).
        #[arg(long, default_value_t = false)]
        deny_warnings: bool,
        /// Optional Cargo package name(s) to check (repeatable and comma-separated).
        #[arg(short = 'p', long, value_delimiter = ',', action = ArgAction::Append)]
        package: Vec<String>,
        /// Print the planned commands without running Cargo.
        #[arg(long, default_value_t = false)]
        plan: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Runs unified `crate-cli` text/Rust formatting first, then normalizes indentation inside all `euv` macro blocks (`view!`, `style!`, etc.).
    Fmt {
        /// Verify formatting without modifying files.
        #[arg(long, default_value_t = false)]
        check: bool,
        /// Optional root directory or file path (defaults to current directory).
        #[arg(long)]
        path: Option<PathBuf>,
        /// Format only `euv` procedural macro bodies without invoking `crate-cli` or `cargo fmt`.
        #[arg(long, default_value_t = false)]
        macros_only: bool,
    },
    /// Inspects installed Rust targets, SDKs, and cross-platform tooling readiness.
    Doctor {
        /// Automatically install missing `rustup` targets applicable to this host OS.
        #[arg(long, default_value_t = false)]
        fix: bool,
        /// Display the expanded per-target readiness matrix and install hints.
        #[arg(long, default_value_t = false)]
        targets: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Scaffolds a new cross-platform euv native project using keyless `style!` and `view!`.
    New {
        /// Name of the new project directory and crate.
        name: String,
        /// Optional parent directory (defaults to current working directory).
        #[arg(long)]
        path: Option<PathBuf>,
        /// Project template preset (`app`, `web`, `dynamic-widget`, `docs`).
        #[arg(long, value_enum, default_value_t = ProjectTemplateArg::App)]
        template: ProjectTemplateArg,
        /// Optional reverse-DNS mobile/desktop bundle identifier (e.g. `com.example.myapp`).
        #[arg(long)]
        bundle_id: Option<String>,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Displays the per-target buildability matrix and required SDKs for the current host.
    Targets {
        /// Optional target or group filter(s) (repeatable and comma-separated).
        #[arg(long, value_enum, value_delimiter = ',', action = ArgAction::Append)]
        target: Vec<TargetArg>,
        /// Show only targets that are ready to build on the current host.
        #[arg(long, default_value_t = false)]
        ready_only: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Cleans generated bundles (`dist/`), mobile host caches, icon caches, and stale OTA staging directories.
    Clean {
        /// Also invoke `cargo clean` for the current workspace or project.
        #[arg(long, default_value_t = false)]
        all: bool,
        /// Optional project root directory (defaults to current working directory).
        #[arg(long)]
        path: Option<PathBuf>,
        /// Preview directories and bytes to reclaim without deleting files.
        #[arg(long, default_value_t = false)]
        dry_run: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Generates shell tab-completion scripts (`bash`, `zsh`, `fish`, `powershell`) for all `euv` subcommands and targets.
    Completions {
        /// Target shell dialect.
        #[arg(value_enum)]
        shell: ShellKindArg,
    },
    /// Queries a live `DevAutomationBridge` for AI Schema / 9-rule layout anomalies or audits a local `dist/` artifact directory.
    Inspect {
        /// Live `DevAutomationBridge` base HTTP URL.
        #[arg(long, default_value = DEFAULT_INSPECT_URL)]
        url: String,
        /// Local build output directory to audit (`euv-release.json`, SHA-256 integrity, zero-JS check, sizes).
        #[arg(long)]
        dist: Option<PathBuf>,
        /// Focus output on 9-rule layout anomalies returned by the live automation bridge.
        #[arg(long, default_value_t = false)]
        anomalies: bool,
        /// Emit machine-readable JSON output.
        #[arg(long, default_value_t = false)]
        json: bool,
    },
    /// Manages Blender 4.x/5.x asset inspection, headless glTF import, `.euv3d` baking, Live-Link SSE sync, and add-on installation.
    Blender {
        /// Blender toolchain subcommand to run.
        #[command(subcommand)]
        action: BlenderAction,
    },
}