//! A shadow of `aube.usage.kdl` in usage's vocabulary, generated by
//! `cargo run -p xtask -- gen-shadow`.
//!
//! Do not edit: regenerate it. It exists to be compiled and parsed against, so
//! that the parser can be measured at a real CLI's scale rather than a toy one.
#![allow(dead_code, unused_imports)]

use usage_derive::{Args, Cli, Subcommands, ValueEnum};

/// Bootstrap aube's cached node-gyp and print the executable path.
#[derive(Args)]
#[usage(effect = "write")]
pub struct NodeGypBootstrapArgs {
    #[usage(arg, name = "PROJECT_DIR")]
    pub project_dir: ::std::string::String,
}

/// Get a package's public or restricted status.
#[derive(Args)]
#[usage(effect = "read")]
pub struct AccessGetStatusArgs {
    /// Package name.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
}

/// Get package visibility status.
#[derive(Args)]
#[usage(effect = "read")]
pub struct AccessGetArgs {
    #[usage(subcommand)]
    pub command: AccessGetCommands,
}

#[derive(Subcommands)]
pub enum AccessGetCommands {
    /// Get a package's public or restricted status.
    #[usage(name = "status")]
    Status(Box<AccessGetStatusArgs>),
}

/// Grant a team read-only or read-write access to a package.
#[derive(Args)]
#[usage(effect = "write")]
pub struct AccessGrantArgs {
    /// `read-only` or `read-write`.
    #[usage(arg, name = "PERMISSIONS")]
    pub permissions: ::std::string::String,
    /// Team in `@scope:team` form.
    #[usage(arg, name = "TEAM")]
    pub team: ::std::string::String,
    /// Package name.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
}

/// List collaborators for a package, optionally filtering to one user.
#[derive(Args)]
#[usage(effect = "read")]
pub struct AccessListCollaboratorsArgs {
    /// Package name.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
    /// Optional user name.
    #[usage(arg, name = "USER")]
    pub user: ::std::option::Option<::std::string::String>,
}

/// List packages visible to the current user or an optional entity.
#[derive(Args)]
#[usage(effect = "read")]
pub struct AccessListPackagesArgs {
    /// User, `@organization`, or `@scope:team`.
    #[usage(arg, name = "ENTITY")]
    pub entity: ::std::option::Option<::std::string::String>,
}

/// List packages visible to a user, organization, or team.
#[derive(Args)]
#[usage(effect = "read")]
pub struct AccessListArgs {
    #[usage(subcommand)]
    pub command: AccessListCommands,
}

#[derive(Subcommands)]
pub enum AccessListCommands {
    /// List collaborators for a package, optionally filtering to one user.
    #[usage(name = "collaborators")]
    Collaborators(Box<AccessListCollaboratorsArgs>),
    /// List packages visible to the current user or an optional entity.
    #[usage(name = "packages")]
    Packages(Box<AccessListPackagesArgs>),
}

/// Alias for `list packages`.
#[derive(Args)]
#[usage(effect = "read")]
pub struct AccessLsArgs {
    #[usage(
        arg,
        name = "ENTITIES",
        help = "User, `@organization`, or `@scope:team`. Also accepts pnpm's `packages [ENTITY]` compatibility form. Accepted forms are `aube access ls [ENTITY]` and `aube access ls packages [ENTITY]`.",
        long_help = "User, `@organization`, or `@scope:team`. Also accepts pnpm's\n`packages [ENTITY]` compatibility form. Accepted forms are\n`aube access ls [ENTITY]` and `aube access ls packages [ENTITY]`.",
        var_max = 2
    )]
    pub entities: ::std::vec::Vec<::std::string::String>,
}

/// Revoke a team's access to a package.
#[derive(Args)]
#[usage(effect = "destructive")]
pub struct AccessRevokeArgs {
    /// Team in `@scope:team` form.
    #[usage(arg, name = "TEAM")]
    pub team: ::std::string::String,
    /// Package name.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
}

/// Set package visibility or a publish MFA requirement.
#[derive(Args)]
#[usage(effect = "write")]
pub struct AccessSetArgs {
    /// `status=public|private|restricted` or `mfa=none|publish|automation`.
    #[usage(arg, name = "SETTING")]
    pub setting: ::std::string::String,
    /// Package name.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
}

/// Manage package access and visibility on the registry
#[derive(Args)]
#[usage(effect = "read")]
pub struct AccessArgs {
    /// Emit registry responses as JSON when the subcommand has a result.
    #[usage(long = "json")]
    pub json: bool,
    /// One-time password from a 2FA authenticator; sent as `npm-otp`.
    #[usage(long = "otp", value_name = "OTP")]
    pub otp: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(subcommand)]
    pub command: AccessCommands,
}

#[derive(Subcommands)]
pub enum AccessCommands {
    /// Get package visibility status.
    #[usage(name = "get")]
    Get(Box<AccessGetArgs>),
    /// Grant a team read-only or read-write access to a package.
    #[usage(name = "grant")]
    Grant(Box<AccessGrantArgs>),
    /// List packages visible to a user, organization, or team.
    #[usage(name = "list")]
    List(Box<AccessListArgs>),
    /// Alias for `list packages`.
    #[usage(name = "ls")]
    Ls(Box<AccessLsArgs>),
    /// Revoke a team's access to a package.
    #[usage(name = "revoke")]
    Revoke(Box<AccessRevokeArgs>),
    /// Set package visibility or a publish MFA requirement.
    #[usage(name = "set")]
    Set(Box<AccessSetArgs>),
}

/// Emit shell activation code for runtime tool shims
#[derive(Args)]
#[usage(effect = "write")]
pub struct ActivateArgs {
    /// Shell to emit activation code for
    #[usage(arg, name = "SHELL")]
    pub shell: ::std::string::String,
}

/// Add a dependency
#[derive(Args)]
#[usage(effect = "write")]
pub struct AddArgs {
    /// Add as dev dependency
    #[usage(long = "save-dev", short = 'D')]
    pub save_dev: bool,
    /// Pin the exact resolved version (no `^` prefix)
    #[usage(long = "save-exact", short = 'E')]
    pub save_exact: bool,
    /// Install the package globally.
    ///
    /// Installs into the aube/pnpm global directory and links its binaries into the global bin directory. Mirrors `pnpm add -g`.
    #[usage(long = "global", short = 'g')]
    pub global: bool,
    /// Add as optional dependency
    #[usage(long = "save-optional", short = 'O')]
    pub save_optional: bool,
    /// Pre-approve a dependency's lifecycle scripts as part of the add.
    ///
    /// Writes `allowBuilds: { <pkg>: true }` into the workspace yaml (or `package.json#aube.allowBuilds`) before the install runs, so the named package's `preinstall` / `install` / `postinstall` scripts execute on this invocation. Repeatable — pass the flag once per package. Mirrors `pnpm add --allow-build=<pkg>`.
    ///
    /// Conflicts with `--no-save`, which only snapshots `package.json` and the lockfile and would leave an orphaned approval in the workspace yaml on restore. Also conflicts with `--deny-build` for the same package name.
    #[usage(
        long = "allow-build",
        conflicts = "--no-save",
        require_equals,
        value_name = "PKG",
        var
    )]
    pub allow_build: ::std::vec::Vec<::std::string::String>,
    #[usage(
        help = "Bypass the similar-name, new-name, and [`lowDownloadThreshold`] confirm prompts / refusals for this invocation.",
        long_help = "Bypass the similar-name, new-name, and [`lowDownloadThreshold`]\nconfirm prompts / refusals for this invocation.\n\n`aube add` looks up each candidate's weekly download count and\nprompts (interactive) or fails (CI) when the count is below\n[`lowDownloadThreshold`], resembles a top-100,000 npm package,\nor is newer than [`minimumPackageAge`]. The flag is intended\nfor cases where you've already verified the package out-of-band.\nIt does not affect the OSV malicious-package check, which remains\na hard block.",
        long = "allow-low-downloads"
    )]
    pub allow_low_downloads: bool,
    /// Allow every dependency's lifecycle scripts to run.
    ///
    /// Bypasses the `allowBuilds` allowlist for this invocation. Do not use in CI. Mirrors pnpm's `--dangerously-allow-all-builds`.
    #[usage(long = "dangerously-allow-all-builds")]
    pub dangerously_allow_all_builds: bool,
    /// Mark a dependency's lifecycle scripts as reviewed and denied.
    ///
    /// Writes `allowBuilds: { <pkg>: false }` into the workspace yaml (or `package.json#aube.allowBuilds`) before the install runs, so the named package's lifecycle scripts stay skipped without tripping `strictDepBuilds=true`. Repeatable — pass the flag once per package.
    ///
    /// Conflicts with `--no-save`, which only snapshots `package.json` and the lockfile and would leave an orphaned denial in the workspace yaml on restore. Also conflicts with `--allow-build` for the same package name and with `--dangerously-allow-all-builds`.
    #[usage(
        long = "deny-build",
        conflicts("--no-save", "--dangerously-allow-all-builds"),
        require_equals,
        value_name = "PKG",
        var
    )]
    pub deny_build: ::std::vec::Vec<::std::string::String>,
    /// Skip root and approved dependency lifecycle scripts.
    #[usage(long = "ignore-scripts", hide)]
    pub ignore_scripts: bool,
    /// Install without persisting the dependency to `package.json`.
    ///
    /// Snapshots `package.json` and the lockfile, links the named packages into `node_modules`, and then restores both files — so the dependency is usable for the current process but the project's committed state is untouched.
    ///
    /// Handy for one-off experiments and for scripts that install a tool transiently. Mirrors `pnpm add --no-save`. Conflicts with `-g`/`--global`, which has to persist the install to its global manifest.
    #[usage(long = "no-save", conflicts = "--global")]
    pub no_save: bool,
    /// Inverse of `--save-workspace-protocol`.
    ///
    /// Forces the manifest specifier into a registry-style spec (`^<version>`) for this invocation, even when `linkWorkspacePackages` matched a local sibling. The install pipeline still prefers the local workspace copy at resolve time — this flag only controls what's written to `package.json`. Mirrors `pnpm add --no-save-workspace-protocol`.
    #[usage(
        long = "no-save-workspace-protocol",
        overrides = "--save-workspace-protocol"
    )]
    pub no_save_workspace_protocol: bool,
    /// Save the new dependency into the workspace's default catalog.
    ///
    /// Writes `catalog:` into `package.json` and seeds/upserts the resolved range under `catalog:` in the workspace yaml. Mirrors `pnpm add --save-catalog`.
    ///
    /// Workspace and aliased specs (`workspace:*`, `npm:`, `jsr:`) are never catalogized — the manifest gets the original spec and the catalog yaml is left alone. If the package is already in the target catalog, the existing entry is preserved (never overwritten); the manifest then gets `catalog:` only when the existing entry is compatible with the user's range.
    ///
    /// Conflicts with `--no-save`: catalog mutations write to the workspace yaml, which the `--no-save` restore path doesn't snapshot — combining the two would silently leave an orphaned catalog entry behind.
    #[usage(long = "save-catalog", conflicts("--save-catalog-name", "--no-save"))]
    pub save_catalog: bool,
    /// Save the new dependency into a *named* catalog.
    ///
    /// Writes the entry to `catalogs.<name>` in the workspace yaml and `catalog:<name>` into `package.json`. Same workspace/alias exclusions and `--no-save` conflict as `--save-catalog`. Mirrors `pnpm add --save-catalog-name=<name>`.
    #[usage(
        long = "save-catalog-name",
        conflicts = "--no-save",
        value_name = "NAME"
    )]
    pub save_catalog_name: ::std::option::Option<::std::string::String>,
    #[usage(
        help = "Add as a peer dependency (written to `peerDependencies` in package.json).",
        long_help = "Add as a peer dependency (written to `peerDependencies` in\npackage.json).\n\nBy convention you usually pair this with `--save-dev` so the\npeer is also installed for local development; that's what pnpm\ndoes.",
        long = "save-peer",
        conflicts = "--save-optional"
    )]
    pub save_peer: bool,
    #[usage(
        help = "Force the manifest specifier into `workspace:` form for this invocation, overriding `saveWorkspaceProtocol` from the workspace yaml / `.npmrc` / env.",
        long_help = "Force the manifest specifier into `workspace:` form for this\ninvocation, overriding `saveWorkspaceProtocol` from the\nworkspace yaml / `.npmrc` / env.\n\nOnly meaningful when `linkWorkspacePackages` (or a workspace\nsibling already exists for the named package). With this flag\nthe entry written to `package.json` is `workspace:^` (rolling)\nor `workspace:^<version>` (pinned), depending on the resolved\n`saveWorkspaceProtocol` value.",
        long = "save-workspace-protocol",
        overrides = "--no-save-workspace-protocol"
    )]
    pub save_workspace_protocol: bool,
    /// Add the dependency to the workspace root's `package.json`.
    ///
    /// Applies regardless of the current working directory: walks up from cwd looking for `aube-workspace.yaml`, `pnpm-workspace.yaml`, or a `package.json` with a `workspaces` field and runs the add against that directory.
    #[usage(long = "workspace", short = 'w', conflicts = "--global")]
    pub workspace: bool,
    /// Allow `add` to run in a workspace root.
    ///
    /// By default aube refuses to add dependencies to the root `package.json` of a workspace (a directory containing `aube-workspace.yaml`, `pnpm-workspace.yaml`, or a `package.json` with a `workspaces` field) because deps added there end up shared by every package and usually reflect a mistake. Pass this flag to opt in. Mirrors `pnpm add -W`.
    #[usage(long = "ignore-workspace-root-check", short = 'W')]
    pub ignore_workspace_root_check: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Package(s) to add
    #[usage(arg, name = "PACKAGES")]
    pub packages: ::std::vec::Vec<::std::string::String>,
}

/// Approve ignored dependency build scripts.
///
/// Writes entries under `allowBuilds` in `aube-workspace.yaml` (or `pnpm-workspace.yaml` if present).
#[derive(Args)]
#[usage(effect = "write")]
pub struct ApproveBuildsArgs {
    /// Approve every pending ignored build without prompting.
    #[usage(long = "all")]
    pub all: bool,
    /// Operate on globally-installed packages instead of the current project.
    #[usage(long = "global", short = 'g')]
    pub global: bool,
    /// Packages to approve directly, skipping the picker.
    ///
    /// Each name must match a currently-ignored build. Unknown names are rejected so a typo cannot silently no-op.
    #[usage(arg, name = "PKG")]
    pub pkg: ::std::vec::Vec<::std::string::String>,
}

/// Check installed packages against the registry advisory DB
#[derive(Args)]
#[usage(effect = "read")]
pub struct AuditArgs {
    /// Only print advisories at or above this severity.
    ///
    /// One of: `info`, `low`, `moderate`, `high`, `critical`. Defaults to `audit.level` (or legacy `auditLevel`), then `low`.
    #[usage(long = "audit-level", value_name = "AUDIT_LEVEL", value_enum)]
    pub audit_level: ::std::option::Option<AuditAuditLevelValue>,
    /// Only audit `devDependencies`.
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// Fix advisories.
    ///
    /// Bare `--fix` writes package.json overrides for backwards compatibility. `--fix=update` refreshes the lockfile without writing overrides.
    #[usage(
        long = "fix",
        value_optional,
        default_missing = "override",
        value_name = "FIX",
        value_enum
    )]
    pub fix: ::std::option::Option<AuditFixValue>,
    /// Drop advisories whose ID matches one of these values.
    ///
    /// Matches against the numeric npm advisory `id`, `github_advisory_id` (`GHSA-…`), and any entry in `cves[]` (case-insensitive). Repeatable; comma-separated values are also accepted.
    #[usage(long = "ignore", delimiter = ',', value_name = "ID", var)]
    pub ignore: ::std::vec::Vec<::std::string::String>,
    /// Use exit code 0 if the registry responds with an error.
    ///
    /// Useful when audit checks run in CI and the registry has a hiccup.
    #[usage(long = "ignore-registry-errors")]
    pub ignore_registry_errors: bool,
    /// Drop advisories that have no non-vulnerable upgrade.
    ///
    /// Filters out advisories for which no non-vulnerable version is available in the package's packument. Same "best non-vulnerable" logic as `--fix`: an advisory is kept only when an upgrade path exists.
    #[usage(long = "ignore-unfixable")]
    pub ignore_unfixable: bool,
    /// Pick which advisories to fix interactively.
    #[usage(long = "interactive", short = 'i')]
    pub interactive: bool,
    /// Emit the report as JSON (pnpm-compatible shape) instead of a table.
    #[usage(long = "json")]
    pub json: bool,
    /// Skip `optionalDependencies`.
    #[usage(long = "no-optional")]
    pub no_optional: bool,
    /// Only audit `dependencies` and `optionalDependencies`.
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
}

#[derive(ValueEnum)]
pub enum AuditAuditLevelValue {
    #[usage(name = "info")]
    Info,
    #[usage(name = "low")]
    Low,
    #[usage(name = "moderate")]
    Moderate,
    #[usage(name = "high")]
    High,
    #[usage(name = "critical")]
    Critical,
}

#[derive(ValueEnum)]
pub enum AuditFixValue {
    /// Refresh the lockfile to patched versions allowed by existing ranges.
    #[usage(name = "update")]
    Update,
    /// Write package.json overrides that force patched versions.
    #[usage(name = "override")]
    Override,
}

/// Print the path to `node_modules/.bin`
#[derive(Args)]
#[usage(effect = "read")]
pub struct BinArgs {
    /// Print the global bin directory instead of the project's
    #[usage(long = "global", short = 'g', conflicts = "--workspace-root")]
    pub global: bool,
    #[usage(
        help = "Print the workspace-root bin directory instead of the current package's.",
        long_help = "Print the workspace-root bin directory instead of the current\npackage's.\n\nMirrors `pnpm bin -w`: from a sub-package, resolves the enclosing\nworkspace root and prints its `node_modules/.bin`. No-op when no\nworkspace root exists above cwd (single-project install), so the\nflag is safe to leave in shell aliases.",
        long = "workspace-root",
        long = "workspace",
        short = 'w'
    )]
    pub workspace_root: bool,
}

/// Open package bug tracker URLs
#[derive(Args)]
#[usage(
    after_long_help = "Examples:\n\n  $ aube bugs\n\n  $ aube bugs react\n\n  $ aube issues react react-dom\n",
    effect = "read"
)]
pub struct BugsArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Packages to open bug trackers for. Defaults to the current project.
    #[usage(arg, name = "PACKAGES")]
    pub packages: ::std::vec::Vec<::std::string::String>,
}

/// Delete metadata cache for the specified package(s).
///
/// Supports glob patterns; matches against the package name (e.g. `lodash`, `@babel/*`).
#[derive(Args)]
#[usage(effect = "write")]
pub struct CacheDeleteArgs {
    /// One or more package name patterns.
    ///
    /// Glob metacharacters (`*`, `?`, `[...]`) are supported.
    #[usage(arg, name = "PATTERNS", required)]
    pub patterns: ::std::vec::Vec<::std::string::String>,
}

/// List the available packages in the metadata cache.
///
/// Optional glob filters narrow the result; with no filter every cached package is listed.
#[derive(Args)]
#[usage(effect = "read")]
pub struct CacheListArgs {
    /// Optional glob patterns to filter the listing.
    ///
    /// With no patterns, every cached package is printed.
    #[usage(arg, name = "PATTERNS")]
    pub patterns: ::std::vec::Vec<::std::string::String>,
}

/// List configured registries from the project + user `.npmrc`.
///
/// Aube stores all packuments in a single flat directory (unlike pnpm's per-host layout), so this prints the registries you're currently configured to talk to rather than the registries that happen to be in the cache.
#[derive(Args)]
#[usage(effect = "read")]
pub struct CacheListRegistriesArgs {}

/// Print the directory used for metadata and policy caches.
#[derive(Args)]
#[usage(effect = "read")]
pub struct CachePathArgs {}

/// Remove stale extracted primer files from the metadata cache.
#[derive(Args)]
#[usage(effect = "write")]
pub struct CachePruneArgs {
    /// Minimum age in days before an old primer file is removed.
    #[usage(long = "age-days", value_name = "AGE_DAYS", default = "30")]
    pub age_days: ::std::option::Option<::std::string::String>,
    /// Do not actually delete anything.
    #[usage(long = "dry-run")]
    pub dry_run: bool,
}

/// View the cached metadata for a single package.
///
/// Prints a summary (versions, dist-tags, ETag, fetched-at) by default; `--json` dumps the raw cache file.
#[derive(Args)]
#[usage(effect = "read")]
pub struct CacheViewArgs {
    /// Dump the raw on-disk cache JSON instead of a summary.
    #[usage(long = "json")]
    pub json: bool,
    /// Package name (scoped names like `@babel/core` are accepted).
    #[usage(arg, name = "NAME")]
    pub name: ::std::string::String,
}

/// Inspect and manage the packument metadata cache
#[derive(Args)]
#[usage(effect = "read")]
pub struct CacheArgs {
    #[usage(subcommand)]
    pub command: CacheCommands,
}

#[derive(Subcommands)]
pub enum CacheCommands {
    /// Delete metadata cache for the specified package(s).
    #[usage(name = "delete")]
    Delete(Box<CacheDeleteArgs>),
    /// List the available packages in the metadata cache.
    #[usage(name = "list")]
    List(Box<CacheListArgs>),
    /// List configured registries from the project + user `.npmrc`.
    #[usage(name = "list-registries")]
    ListRegistries(Box<CacheListRegistriesArgs>),
    /// Print the directory used for metadata and policy caches.
    #[usage(name = "path")]
    Path(Box<CachePathArgs>),
    /// Remove stale extracted primer files from the metadata cache.
    #[usage(name = "prune")]
    Prune(Box<CachePruneArgs>),
    /// View the cached metadata for a single package.
    #[usage(name = "view")]
    View(Box<CacheViewArgs>),
}

/// Print a file from the global store by integrity or hex hash
#[derive(Args)]
#[usage(effect = "read")]
pub struct CatFileArgs {
    /// File hash to look up.
    ///
    /// Accepts `sha512-<base64>` (pnpm integrity format) or a raw hex CAS digest.
    #[usage(arg, name = "HASH")]
    pub hash: ::std::string::String,
}

/// Print the cached package index JSON for `<name>@<version>`
#[derive(Args)]
#[usage(effect = "read")]
pub struct CatIndexArgs {
    #[usage(
        arg,
        name = "PACKAGE",
        help = "Package to inspect, in `name@version` form (e.g. `lodash@4.17.21`, `@babel/core@7.26.0`).",
        long_help = "Package to inspect, in `name@version` form (e.g. `lodash@4.17.21`,\n`@babel/core@7.26.0`).\n\nAn exact version is required — ranges and dist-tags aren't\nresolved here."
    )]
    pub package: ::std::string::String,
}

/// Verify installed packages can resolve their declared deps.
///
/// Walks the `node_modules/` symlink tree and confirms every dependency in each `package.json` resolves to a real entry.
#[derive(Args)]
#[usage(effect = "read")]
pub struct CheckArgs {
    /// Emit a JSON report instead of the human-readable list.
    #[usage(long = "json")]
    pub json: bool,
}

/// Clean install: delete node_modules, then install with frozen lockfile.
///
/// Use in CI to guarantee a reproducible install from the committed lockfile.
#[derive(Args)]
#[usage(effect = "write")]
pub struct CiArgs {
    /// Skip lifecycle scripts (no-op; aube already skips by default)
    #[usage(long = "ignore-scripts")]
    pub ignore_scripts: bool,
    /// Skip optionalDependencies; don't install optional native modules
    #[usage(long = "no-optional")]
    pub no_optional: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
}

/// Remove `node_modules` across every workspace project.
///
/// `--lockfile` / `-l` also deletes lockfiles. A `clean` script in the root `package.json` overrides the built-in.
#[derive(Args)]
#[usage(effect = "write")]
pub struct CleanArgs {
    /// Also remove lockfiles at the workspace root.
    ///
    /// Targets `aube-lock.yaml`, `pnpm-lock.yaml`, `package-lock.json`, `npm-shrinkwrap.json`, `yarn.lock`, and `bun.lock`.
    #[usage(long = "lockfile", short = 'l')]
    pub lockfile: bool,
}

/// Generate shell completions (bash, zsh, fish)
#[derive(Args)]
#[usage(effect = "read")]
pub struct CompletionArgs {
    /// The shell to generate completions for (bash, zsh, fish)
    #[usage(arg, name = "SHELL")]
    pub shell: ::std::string::String,
}

/// Delete a key from aube config or the selected `.npmrc` file
#[derive(Args)]
#[usage(effect = "destructive")]
pub struct ConfigDeleteArgs {
    /// Shortcut for `--location project`.
    #[usage(long = "local", conflicts = "--location")]
    pub local: bool,
    /// Which config location to act on.
    ///
    /// Defaults to `user`. Delete sweeps both aube's own config (`~/.config/aube/config.toml` at user-scope, `<cwd>/.config/aube/config.toml` at project-scope) and the matching `.npmrc`, so the call works regardless of which file the value was originally written to.
    #[usage(
        long = "location",
        value_name = "LOCATION",
        value_enum,
        default = "user"
    )]
    pub location: ::std::option::Option<ConfigDeleteLocationValue>,
    /// The setting key.
    ///
    /// Accepts either a pnpm canonical name (e.g. `autoInstallPeers`) or an `.npmrc` alias (e.g. `auto-install-peers`).
    #[usage(arg, name = "KEY")]
    pub key: ::std::string::String,
}

#[derive(ValueEnum)]
pub enum ConfigDeleteLocationValue {
    /// User config (`~/.config/aube/config.toml` for known aube settings, `~/.npmrc` for registry/auth and unknown keys)
    #[usage(name = "user")]
    User,
    /// `<cwd>/.npmrc`
    #[usage(name = "project")]
    Project,
    /// Alias for `user` — aube has no separate global config file.
    #[usage(name = "global")]
    Global,
}

/// Explain a known setting, including defaults and supported config sources
#[derive(Args)]
#[usage(effect = "read")]
pub struct ConfigExplainArgs {
    /// Setting key, `.npmrc` alias, env var, workspace YAML key, or CLI flag.
    #[usage(arg, name = "KEY")]
    pub key: ::std::string::String,
}

/// Search known settings by name, source key, or description
#[derive(Args)]
#[usage(effect = "read")]
pub struct ConfigFindArgs {
    /// Words to search for.
    #[usage(arg, name = "QUERY", required)]
    pub query: ::std::vec::Vec<::std::string::String>,
}

/// Print the effective value of a key
#[derive(Args)]
#[usage(effect = "read")]
pub struct ConfigGetArgs {
    /// Emit the value as JSON.
    ///
    /// Matches `pnpm config get --json`: a missing key renders as `undefined`, a found value is JSON-encoded.
    #[usage(long = "json")]
    pub json: bool,
    /// Shortcut for `--location project`.
    #[usage(long = "local", conflicts = "--location")]
    pub local: bool,
    /// Which config location(s) to read.
    ///
    /// Defaults to `merged` — the last-write-wins view of user aube config, `~/.npmrc`, then `./.npmrc`, matching what install actually sees. Use `user` or `project` to restrict the lookup.
    #[usage(
        long = "location",
        value_name = "LOCATION",
        value_enum,
        default = "merged"
    )]
    pub location: ::std::option::Option<ConfigGetLocationValue>,
    /// The setting key.
    ///
    /// Accepts either a pnpm canonical name (e.g. `autoInstallPeers`) or an `.npmrc` alias (e.g. `auto-install-peers`).
    #[usage(arg, name = "KEY")]
    pub key: ::std::string::String,
}

#[derive(ValueEnum)]
pub enum ConfigGetLocationValue {
    /// Merge `~/.npmrc`, user aube config, and project `.npmrc`, last-write-wins (same precedence install uses).
    #[usage(name = "merged")]
    Merged,
    /// Only user config (`~/.config/aube/config.toml` + `~/.npmrc`)
    #[usage(name = "user")]
    User,
    /// Only `<cwd>/.npmrc`
    #[usage(name = "project")]
    Project,
    /// Alias for `user`.
    #[usage(name = "global")]
    Global,
}

/// Print every key/value from aube config and selected `.npmrc` file(s)
#[derive(Args)]
#[usage(effect = "read")]
pub struct ConfigListArgs {
    /// Also list settings that have no value set.
    ///
    /// Renders one row per setting in `settings.toml`, with the default and description shown for unset entries.
    ///
    /// Only valid with `--location merged` (the default), since a per-file view can't distinguish "not set anywhere" from "set in the other file" and would render misleading defaults.
    #[usage(long = "all")]
    pub all: bool,
    /// Emit all entries as a JSON object keyed by setting name.
    ///
    /// Matches `pnpm config list --json`. Honors `--all` and `--location` the same way the default text output does.
    #[usage(long = "json")]
    pub json: bool,
    /// Shortcut for `--location project`.
    ///
    /// Conflicts with `--all` since `--all` only makes sense against the merged view — see the `--all` docs for why.
    #[usage(long = "local", conflicts("--location", "--all"))]
    pub local: bool,
    /// Which config location(s) to list.
    ///
    /// `merged` (default) walks `~/.npmrc`, user aube config, then the project's `.npmrc` with last-write-wins precedence, matching how install reads config.
    #[usage(long = "location", value_name = "LOCATION", value_enum)]
    pub location: ::std::option::Option<ConfigListLocationValue>,
}

#[derive(ValueEnum)]
pub enum ConfigListLocationValue {
    /// Merge `~/.npmrc`, user aube config, and project `.npmrc`, last-write-wins (same precedence install uses).
    #[usage(name = "merged")]
    Merged,
    /// Only user config (`~/.config/aube/config.toml` + `~/.npmrc`)
    #[usage(name = "user")]
    User,
    /// Only `<cwd>/.npmrc`
    #[usage(name = "project")]
    Project,
    /// Alias for `user`.
    #[usage(name = "global")]
    Global,
}

/// Write a key=value pair to aube config or the selected `.npmrc` file
#[derive(Args)]
#[usage(effect = "write")]
pub struct ConfigSetArgs {
    /// Shortcut for `--location project`.
    #[usage(long = "local", conflicts = "--location")]
    pub local: bool,
    /// Which config location to write to.
    ///
    /// Defaults to `user`. Writes land in `.npmrc` for the npm-shared surface — per-host auth/cert templates, scoped registries, and settings tagged `npmShared = true` in the settings registry (`registry`, `proxy` / `https-proxy`, `engine-strict`, `ignore-scripts`, etc.) — so npm and yarn read the same value. Aube-only and pnpm-only settings, plus unknown keys, land in aube's own config (`~/.config/aube/config.toml` at user scope, `<cwd>/.config/aube/config.toml` at project scope) where sibling tools don't see them.
    ///
    /// Dotted writes for aube map settings (`allowBuilds.<pkg>`, `overrides.<pkg>`, …) edit one entry at a time. At project scope (`--local`) they land in `pnpm-workspace.yaml#<map>.<entry>` or `package.json#aube.<map>.<entry>` if no workspace yaml exists, the same place install reads from. User-scope dotted writes for these maps error: aube only reads them per project.
    #[usage(
        long = "location",
        value_name = "LOCATION",
        value_enum,
        default = "user"
    )]
    pub location: ::std::option::Option<ConfigSetLocationValue>,
    /// Setting key (canonical name or `.npmrc` alias).
    #[usage(arg, name = "KEY")]
    pub key: ::std::string::String,
    /// Value to write. Stored verbatim after `key=`.
    #[usage(arg, name = "VALUE")]
    pub value: ::std::string::String,
}

#[derive(ValueEnum)]
pub enum ConfigSetLocationValue {
    /// User config (`~/.config/aube/config.toml` for known aube settings, `~/.npmrc` for registry/auth and unknown keys)
    #[usage(name = "user")]
    User,
    /// `<cwd>/.npmrc`
    #[usage(name = "project")]
    Project,
    /// Alias for `user` — aube has no separate global config file.
    #[usage(name = "global")]
    Global,
}

/// Browse known settings in an interactive terminal UI
#[derive(Args)]
#[usage(effect = "write")]
pub struct ConfigTuiArgs {}

/// Read and write settings in `.npmrc`
#[derive(Args)]
#[usage(effect = "read")]
pub struct ConfigArgs {
    /// Also list settings that have no value set.
    ///
    /// Renders one row per setting in `settings.toml`, with the default and description shown for unset entries.
    ///
    /// Only valid with `--location merged` (the default), since a per-file view can't distinguish "not set anywhere" from "set in the other file" and would render misleading defaults.
    #[usage(long = "all")]
    pub all: bool,
    /// Emit all entries as a JSON object keyed by setting name.
    ///
    /// Matches `pnpm config list --json`. Honors `--all` and `--location` the same way the default text output does.
    #[usage(long = "json")]
    pub json: bool,
    /// Shortcut for `--location project`.
    ///
    /// Conflicts with `--all` since `--all` only makes sense against the merged view — see the `--all` docs for why.
    #[usage(long = "local", conflicts("--location", "--all"))]
    pub local: bool,
    /// Which config location(s) to list.
    ///
    /// `merged` (default) walks `~/.npmrc`, user aube config, then the project's `.npmrc` with last-write-wins precedence, matching how install reads config.
    #[usage(long = "location", value_name = "LOCATION", value_enum)]
    pub location: ::std::option::Option<ConfigLocationValue>,
    #[usage(subcommand)]
    pub command: ::std::option::Option<ConfigCommands>,
}

#[derive(ValueEnum)]
pub enum ConfigLocationValue {
    /// Merge `~/.npmrc`, user aube config, and project `.npmrc`, last-write-wins (same precedence install uses).
    #[usage(name = "merged")]
    Merged,
    /// Only user config (`~/.config/aube/config.toml` + `~/.npmrc`)
    #[usage(name = "user")]
    User,
    /// Only `<cwd>/.npmrc`
    #[usage(name = "project")]
    Project,
    /// Alias for `user`.
    #[usage(name = "global")]
    Global,
}

#[derive(Subcommands)]
pub enum ConfigCommands {
    /// Delete a key from aube config or the selected `.npmrc` file
    #[usage(name = "delete", alias("rm", "remove", "unset"))]
    Delete(Box<ConfigDeleteArgs>),
    /// Explain a known setting, including defaults and supported config sources
    #[usage(name = "explain")]
    Explain(Box<ConfigExplainArgs>),
    /// Search known settings by name, source key, or description
    #[usage(name = "find", alias = "search")]
    Find(Box<ConfigFindArgs>),
    /// Print the effective value of a key
    #[usage(name = "get")]
    Get(Box<ConfigGetArgs>),
    /// Print every key/value from aube config and selected `.npmrc` file(s)
    #[usage(name = "list", alias = "ls")]
    List(Box<ConfigListArgs>),
    /// Write a key=value pair to aube config or the selected `.npmrc` file
    #[usage(name = "set")]
    Set(Box<ConfigSetArgs>),
    /// Browse known settings in an interactive terminal UI
    #[usage(name = "tui")]
    Tui(Box<ConfigTuiArgs>),
}

/// Scaffold a project from a `create-*` starter kit (via dlx)
#[derive(Args)]
pub struct CreateArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "PARAMS",
        help = "Template package name followed by any args to pass through to the scaffold binary.",
        long_help = "Template package name followed by any args to pass through to\nthe scaffold binary.\n\nThe first positional is the template; the rest are forwarded\nverbatim to `create-<template>`.",
        double_dash = "automatic"
    )]
    pub params: ::std::vec::Vec<::std::string::String>,
}

/// Re-resolve the lockfile to collapse duplicate versions
#[derive(Args)]
#[usage(effect = "write")]
pub struct DedupeArgs {
    /// Check whether dedupe would change the lockfile; don't write anything.
    ///
    /// Exits non-zero when dedupe would make changes — useful in CI.
    #[usage(long = "check")]
    pub check: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
}

/// Deploy a workspace package into a target directory with deps inlined
#[derive(Args)]
#[usage(effect = "write")]
pub struct DeployArgs {
    /// Install only `devDependencies`.
    ///
    /// Implemented by stripping `dependencies` and `optionalDependencies` from the deployed `package.json` before install runs.
    #[usage(long = "dev", short = 'D', conflicts("--prod", "--no-prod"))]
    pub dev: bool,
    /// Skip `optionalDependencies`
    #[usage(long = "no-optional")]
    pub no_optional: bool,
    /// Install only production dependencies (default).
    ///
    /// Accepted for pnpm compatibility.
    #[usage(long = "prod", long = "production", short = 'P')]
    pub prod: bool,
    /// Deploy every dependency kind (production + dev + optional).
    ///
    /// Opts out of the implicit `--prod` deploy default. Useful when a deployed package needs its devDependencies at runtime (test harnesses, build-step deploys). Combine with `--no-optional` to drop optionals while keeping prod + dev. Mutually exclusive with `--prod` and `--dev`.
    #[usage(long = "no-prod", conflicts("--prod", "--dev"))]
    pub no_prod: bool,
    /// Fail if any metadata or tarball isn't already in the local cache.
    ///
    /// Never hits the network. Useful in multi-stage Dockerfiles where an earlier `aube install` already populated the store: deploy then reproduces a prod-only tree without re-fetching anything.
    #[usage(long = "offline", conflicts = "--prefer-offline")]
    pub offline: bool,
    /// Prefer cached metadata over revalidation; only hit the network on a miss.
    #[usage(long = "prefer-offline", conflicts = "--offline")]
    pub prefer_offline: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Target directory to deploy into.
    ///
    /// Must be empty or not yet exist.
    #[usage(arg, name = "TARGET")]
    pub target: ::std::string::String,
}

/// Mark published versions of a package as deprecated on the registry
#[derive(Args)]
#[usage(effect = "write")]
pub struct DeprecateArgs {
    /// Don't PUT anything — print which versions would be touched and exit.
    #[usage(long = "dry-run")]
    pub dry_run: bool,
    /// One-time password from a 2FA authenticator; sent as `npm-otp`.
    #[usage(long = "otp", value_name = "CODE")]
    pub otp: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Package spec: `name`, `name@version`, or `name@<range>`.
    ///
    /// Omitting the version deprecates every published version.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
    /// Deprecation message shown to installers.
    ///
    /// Pass an empty string to clear an existing deprecation (or use `aube undeprecate`).
    #[usage(arg, name = "MESSAGE")]
    pub message: ::std::string::String,
}

/// Report deprecated packages in the resolved dependency graph
#[derive(Args)]
#[usage(effect = "read")]
pub struct DeprecationsArgs {
    /// Exit with a non-zero status if any deprecations are found.
    #[usage(long = "exit-code")]
    pub exit_code: bool,
    /// Emit JSON instead of the default text layout.
    #[usage(long = "json")]
    pub json: bool,
    /// Include transitive dependencies as well as direct ones.
    #[usage(long = "transitive")]
    pub transitive: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
}

/// Show critical path / starvation / per-pkg lifecycle from a saved trace.
#[derive(Args)]
#[usage(effect = "read")]
pub struct DiagAnalyzeArgs {
    /// Trace JSONL
    #[usage(arg, name = "PATH")]
    pub path: ::std::string::String,
}

/// Diff two diag JSONL traces and surface per-operation regressions.
#[derive(Args)]
#[usage(effect = "read")]
pub struct DiagCompareArgs {
    /// Minimum |Δsum_ms| to surface (default 50)
    #[usage(long = "min-delta-ms", value_name = "MIN_DELTA_MS", default = "50")]
    pub min_delta_ms: ::std::option::Option<::std::string::String>,
    /// Minimum |%change| to surface (default 10)
    #[usage(long = "min-pct", value_name = "MIN_PCT", default = "10")]
    pub min_pct: ::std::option::Option<::std::string::String>,
    /// Baseline trace
    #[usage(arg, name = "A")]
    pub a: ::std::string::String,
    /// Comparison trace
    #[usage(arg, name = "B")]
    pub b: ::std::string::String,
}

/// Diagnostic trace analysis (compare/analyze JSONL traces)
#[derive(Args)]
#[usage(effect = "read")]
pub struct DiagArgs {
    #[usage(subcommand)]
    pub command: DiagCommands,
}

#[derive(Subcommands)]
pub enum DiagCommands {
    /// Show critical path / starvation / per-pkg lifecycle from a saved trace.
    #[usage(name = "analyze")]
    Analyze(Box<DiagAnalyzeArgs>),
    /// Diff two diag JSONL traces and surface per-operation regressions.
    #[usage(name = "compare")]
    Compare(Box<DiagCompareArgs>),
}

/// Add or update a dist-tag on a package.
///
/// Spec must include a concrete version: `aube dist-tag add react@18.2.0 stable`. The tag argument defaults to `latest`.
#[derive(Args)]
#[usage(effect = "write")]
pub struct DistTagAddArgs {
    /// One-time password from a 2FA authenticator; sent as `npm-otp`.
    #[usage(long = "otp", value_name = "OTP")]
    pub otp: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "SPEC",
        help = "Package spec in `name@version` form (exact version required, ranges and tags aren't resolved here).",
        long_help = "Package spec in `name@version` form (exact version required,\nranges and tags aren't resolved here)."
    )]
    pub spec: ::std::string::String,
    /// Tag to create or update. Defaults to `latest`.
    #[usage(arg, name = "TAG")]
    pub tag: ::std::option::Option<::std::string::String>,
}

/// List every dist-tag for a package.
///
/// Reads the package name from `./package.json` when no argument is given.
#[derive(Args)]
#[usage(effect = "read")]
pub struct DistTagLsArgs {
    /// Package name (no version).
    ///
    /// Defaults to the current project's `package.json` `name` field.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::option::Option<::std::string::String>,
}

/// Remove a dist-tag from a package.
#[derive(Args)]
#[usage(effect = "destructive")]
pub struct DistTagRmArgs {
    /// One-time password from a 2FA authenticator; sent as `npm-otp`.
    #[usage(long = "otp", value_name = "OTP")]
    pub otp: ::std::option::Option<::std::string::String>,
    /// Package name (no version).
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
    /// Tag to remove.
    #[usage(arg, name = "TAG")]
    pub tag: ::std::string::String,
}

/// Manage package distribution tags on the registry
#[derive(Args)]
#[usage(effect = "read")]
pub struct DistTagArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(subcommand)]
    pub command: DistTagCommands,
}

#[derive(Subcommands)]
pub enum DistTagCommands {
    /// Add or update a dist-tag on a package.
    #[usage(name = "add")]
    Add(Box<DistTagAddArgs>),
    /// List every dist-tag for a package.
    #[usage(name = "ls")]
    Ls(Box<DistTagLsArgs>),
    /// Remove a dist-tag from a package.
    #[usage(name = "rm", alias = "remove")]
    Rm(Box<DistTagRmArgs>),
}

/// Fetch a package into a throwaway environment and run its binary
#[derive(Args)]
pub struct DlxArgs {
    /// Run the assembled command line through `sh -c`.
    ///
    /// `<scratch>/node_modules/.bin` is prepended to `PATH`. Use this for pipelines, redirects, or env expansion (`aube dlx -p cowsay -c 'cowsay hello | tr a-z A-Z'`). Mirrors `pnpm dlx --shell-mode`.
    #[usage(long = "shell-mode", short = 'c')]
    pub shell_mode: bool,
    /// Install a specific package (repeatable).
    ///
    /// Overrides inferring from the command.
    #[usage(long = "package", short = 'p', value_name = "PACKAGE", var)]
    pub package: ::std::vec::Vec<::std::string::String>,
    #[usage(
        help = "Allow named packages to run lifecycle scripts during the transient install. Use `--allow-build=<pkg>`.",
        long_help = "Allow named packages to run lifecycle scripts during the\ntransient install. Use `--allow-build=<pkg>`.\n\nRepeatable — pass once per package. The named package's\n`preinstall` / `install` / `postinstall` scripts execute during\nthe transient install. Requires the equals form\n(`--allow-build=<pkg>`); space-separated forms are rejected.\nMirrors pnpm's `pnpm dlx --allow-build=<pkg>` compatibility\nsurface while keeping dlx scripts skipped unless explicitly\napproved.",
        long = "allow-build",
        require_equals,
        value_name = "PKG",
        var
    )]
    pub allow_build: ::std::vec::Vec<::std::string::String>,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    #[usage(
        arg,
        name = "PARAMS",
        help = "Command (binary) to run, followed by arguments to pass through to it.",
        long_help = "Command (binary) to run, followed by arguments to pass through to\nit.\n\nThe first positional is the command; the rest are forwarded\nverbatim to the binary. Without `--package`, a local\n`node_modules/.bin/<command>` wins when present; otherwise dlx\ninstalls into a throwaway project. Under `--shell-mode`/`-c` the\npositionals are joined and evaluated by `sh -c` instead of\nlooked up directly.",
        double_dash = "automatic"
    )]
    pub params: ::std::vec::Vec<::std::string::String>,
}

/// Run broad install-health diagnostics
#[derive(Args)]
#[usage(effect = "read")]
pub struct DoctorArgs {
    /// Emit a machine-readable JSON report instead of the grouped text.
    #[usage(long = "json", short = 'J')]
    pub json: bool,
}

/// Execute a locally installed binary
#[derive(Args)]
pub struct ExecArgs {
    /// Continue recursive execution after a command fails.
    ///
    /// Parsed for pnpm compatibility; aube currently stops on the first failure.
    #[usage(long = "no-bail")]
    pub no_bail: bool,
    /// Skip auto-install check
    #[usage(long = "no-install")]
    pub no_install: bool,
    /// Disable topological sorting (default is on).
    ///
    /// Without this, recursive execs visit packages in a deps-first order. Pass this to fall back to raw workspace-listing order.
    #[usage(long = "no-sort", overrides = "--sort")]
    pub no_sort: bool,
    /// Run recursive workspace executions concurrently.
    #[usage(long = "parallel")]
    pub parallel: bool,
    /// Write a recursive exec summary file.
    ///
    /// Parsed for pnpm compatibility.
    #[usage(long = "report-summary")]
    pub report_summary: bool,
    /// Hide the `<package>: ` label on parallel-exec output lines.
    ///
    /// Lines are still piped (clean line breaks even with concurrent children) but the source package isn't named on each line. Sequential execs ignore this flag.
    #[usage(long = "reporter-hide-prefix")]
    pub reporter_hide_prefix: bool,
    /// Resume recursive execution starting at this package name.
    ///
    /// Packages before the named one in the post-sort, post-reverse order are skipped. Errors if the name isn't in the matched set.
    #[usage(long = "resume-from", value_name = "PACKAGE")]
    pub resume_from: ::std::option::Option<::std::string::String>,
    /// Reverse the recursive execution order (after topo sort).
    #[usage(long = "reverse")]
    pub reverse: bool,
    /// Run the command through `sh -c`.
    #[usage(long = "shell-mode", short = 'c')]
    pub shell_mode: bool,
    /// Sort recursive packages topologically (this is the default).
    ///
    /// Pass to override an earlier `--no-sort` on the same invocation.
    #[usage(long = "sort", overrides = "--no-sort")]
    pub sort: bool,
    /// Cap the number of recursive packages running at once.
    ///
    /// Setting this implicitly enables parallel mode at width `N`. `0` means "use the available CPU count". Without this flag, `--parallel` stays unbounded.
    #[usage(long = "workspace-concurrency", value_name = "N")]
    pub workspace_concurrency: ::std::option::Option<::std::string::String>,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Binary name
    #[usage(arg, name = "BIN")]
    pub bin: ::std::string::String,
    /// Arguments to pass to the binary
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Download lockfile dependencies into the store without linking node_modules
#[derive(Args)]
#[usage(effect = "write")]
pub struct FetchArgs {
    /// Only fetch devDependencies
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// Only fetch production + optional dependencies (skip devDependencies)
    #[usage(long = "prod", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
}

/// List packages whose cached index references a given file hash
#[derive(Args)]
#[usage(effect = "read")]
pub struct FindHashArgs {
    /// Emit machine-readable JSON instead of a plain text listing.
    ///
    /// Output is an array of `{ "name", "version", "path" }` objects.
    #[usage(long = "json")]
    pub json: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Hash to look up.
    ///
    /// Accepts `sha512-<base64>` (pnpm integrity format) or a raw hex CAS digest.
    #[usage(arg, name = "HASH")]
    pub hash: ::std::string::String,
}

/// Alias for `config get` (hidden; prefer `config get`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct GetArgs {
    /// Emit the value as JSON.
    ///
    /// Matches `pnpm config get --json`: a missing key renders as `undefined`, a found value is JSON-encoded.
    #[usage(long = "json")]
    pub json: bool,
    /// Shortcut for `--location project`.
    #[usage(long = "local", conflicts = "--location")]
    pub local: bool,
    /// Which config location(s) to read.
    ///
    /// Defaults to `merged` — the last-write-wins view of user aube config, `~/.npmrc`, then `./.npmrc`, matching what install actually sees. Use `user` or `project` to restrict the lookup.
    #[usage(
        long = "location",
        value_name = "LOCATION",
        value_enum,
        default = "merged"
    )]
    pub location: ::std::option::Option<GetLocationValue>,
    /// The setting key.
    ///
    /// Accepts either a pnpm canonical name (e.g. `autoInstallPeers`) or an `.npmrc` alias (e.g. `auto-install-peers`).
    #[usage(arg, name = "KEY")]
    pub key: ::std::string::String,
}

#[derive(ValueEnum)]
pub enum GetLocationValue {
    /// Merge `~/.npmrc`, user aube config, and project `.npmrc`, last-write-wins (same precedence install uses).
    #[usage(name = "merged")]
    Merged,
    /// Only user config (`~/.config/aube/config.toml` + `~/.npmrc`)
    #[usage(name = "user")]
    User,
    /// Only `<cwd>/.npmrc`
    #[usage(name = "project")]
    Project,
    /// Alias for `user`.
    #[usage(name = "global")]
    Global,
}

/// Print packages whose install scripts were skipped by `pnpm.allowBuilds`
#[derive(Args)]
#[usage(effect = "read")]
pub struct IgnoredBuildsArgs {
    /// Operate on globally-installed packages instead of the current project.
    #[usage(long = "global", short = 'g')]
    pub global: bool,
}

/// Convert a supported lockfile into aube-lock.yaml
#[derive(Args)]
#[usage(effect = "write")]
pub struct ImportArgs {
    /// Overwrite an existing aube-lock.yaml
    #[usage(long = "force")]
    pub force: bool,
    /// Skip lifecycle scripts when the follow-up install runs.
    ///
    /// Accepted for compatibility — `aube import` today only writes the lockfile and does not chain into install, so this is a no-op, kept so wrappers that already pass it keep working.
    #[usage(long = "ignore-scripts", hide)]
    pub ignore_scripts: bool,
    #[usage(
        help = "Write only the converted lockfile and skip linking `node_modules` afterwards.",
        long_help = "Write only the converted lockfile and skip linking\n`node_modules` afterwards.\n\n`aube import` already exits without touching `node_modules`\ntoday, so this flag is a no-op kept for compatibility — CI\nscripts that pass `--lockfile-only` keep working without\ncomplaint.",
        long = "lockfile-only"
    )]
    pub lockfile_only: bool,
}

/// Create a `package.json` in the current directory
#[derive(Args)]
#[usage(effect = "write")]
pub struct InitArgs {
    /// Create a `package.json` with only the bare minimum of required fields
    #[usage(long = "bare")]
    pub bare: bool,
    /// Pin the project to the current aube version.
    ///
    /// Adds a `packageManager` field to `package.json`.
    #[usage(long = "init-package-manager")]
    pub init_package_manager: bool,
    /// Set the module system for the package. Defaults to `commonjs`.
    #[usage(long = "init-type", value_name = "commonjs|module")]
    pub init_type: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
}

/// Install all dependencies
#[derive(Args)]
#[usage(effect = "write")]
pub struct InstallArgs {
    /// Install only devDependencies
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// Skip devDependencies; install only production deps
    #[usage(long = "prod", long = "production", short = 'P')]
    pub prod: bool,
    /// Allow every dependency's lifecycle scripts to run.
    ///
    /// Bypasses the `allowBuilds` allowlist. Do not use in CI.
    #[usage(long = "dangerously-allow-all-builds")]
    pub dangerously_allow_all_builds: bool,
    #[usage(
        help = "Resolve and report what would happen without writing the lockfile or linking node_modules.",
        long_help = "Resolve and report what would happen without writing the lockfile\nor linking node_modules.",
        long = "dry-run",
        conflicts = "--lockfile-only"
    )]
    pub dry_run: bool,
    /// Re-resolve lockfile entries whose spec drifted from package.json.
    ///
    /// Leaves everything else pinned at its locked version. Unchanged specs keep their existing version and integrity hash; only drifted entries (and any new transitives they pull in) get re-resolved.
    #[usage(
        long = "fix-lockfile",
        conflicts(
            "--frozen-lockfile",
            "--no-frozen-lockfile",
            "--prefer-frozen-lockfile"
        )
    )]
    pub fix_lockfile: bool,
    /// Force reinstall, ignoring lockfile/state freshness.
    ///
    /// Bypasses the `node_modules/.aube-state` freshness check and re-resolves the lockfile even when nothing has drifted. Mirrors pnpm's `install --force`.
    #[usage(long = "force")]
    pub force: bool,
    /// Add a global pnpmfile that runs before the local one.
    ///
    /// Mirrors pnpm's `--global-pnpmfile <path>`. Relative paths resolve against the project root. The global hook runs first and the local hook (if any) runs second, so local mutations win on conflicts — matching pnpm's composition order.
    #[usage(
        long = "global-pnpmfile",
        conflicts = "--ignore-pnpmfile",
        value_name = "PATH"
    )]
    pub global_pnpmfile: ::std::option::Option<::std::string::String>,
    /// Skip running `.pnpmfile.mjs` / `.pnpmfile.cjs` hooks for this install
    #[usage(long = "ignore-pnpmfile")]
    pub ignore_pnpmfile: bool,
    /// Skip lifecycle scripts (no-op; aube already skips by default)
    #[usage(long = "ignore-scripts")]
    pub ignore_scripts: bool,
    /// Read and write the lockfile in the given directory.
    ///
    /// Instead of placing the lockfile alongside `package.json`, the project becomes an importer keyed by its relative path from the lockfile directory. Mirrors pnpm's `--lockfile-dir`.
    #[usage(long = "lockfile-dir", value_name = "PATH")]
    pub lockfile_dir: ::std::option::Option<::std::string::String>,
    #[usage(
        help = "Resolve dependencies and write the lockfile, but don't link `node_modules`.",
        long_help = "Resolve dependencies and write the lockfile, but don't link\n`node_modules`.\n\nUseful for CI workflows that only update the lockfile.",
        long = "lockfile-only",
        conflicts = "--frozen-lockfile"
    )]
    pub lockfile_only: bool,
    /// Merge per-branch lockfiles into the main `aube-lock.yaml`.
    ///
    /// Combines every `aube-lock.<branch>.yaml` file in the project into `aube-lock.yaml` and deletes the branch files. Companion to `gitBranchLockfile`. When `mergeGitBranchLockfilesBranchPattern` is set in `pnpm-workspace.yaml`, this happens automatically on matching branches; the flag forces it regardless.
    #[usage(long = "merge-git-branch-lockfiles")]
    pub merge_git_branch_lockfiles: bool,
    /// Cap concurrent tarball downloads.
    ///
    /// Overrides `network-concurrency` from `.npmrc` / `aube-workspace.yaml` when set. Falls back to an auto-scaled default of worker count x3, clamped to 16-64.
    #[usage(long = "network-concurrency", value_name = "N")]
    pub network_concurrency: ::std::option::Option<::std::string::String>,
    /// Skip optionalDependencies; don't install optional native modules
    #[usage(long = "no-optional")]
    pub no_optional: bool,
    /// Inverse of `--side-effects-cache`.
    #[usage(long = "no-side-effects-cache", overrides = "--side-effects-cache")]
    pub no_side_effects_cache: bool,
    /// Inverse of `--verify-store-integrity`.
    ///
    /// Skips the SHA-512 verify step for every tarball aube pulls into the store during this install.
    #[usage(
        long = "no-verify-store-integrity",
        overrides = "--verify-store-integrity"
    )]
    pub no_verify_store_integrity: bool,
    /// Which layout to materialize `node_modules/` as.
    ///
    /// `isolated` (default) uses pnpm's `.aube/`-backed symlink tree; `hoisted` builds an npm-style flat tree with conflict nesting. Overrides `node-linker` / `nodeLinker` from `.npmrc` / `aube-workspace.yaml` when set. `pnp` is not supported.
    #[usage(long = "node-linker", value_name = "MODE")]
    pub node_linker: ::std::option::Option<::std::string::String>,
    /// Fail if any metadata or tarball isn't already in the local cache.
    ///
    /// Never hits the network.
    #[usage(long = "offline", conflicts = "--prefer-offline")]
    pub offline: bool,
    #[usage(
        help = "How to import package files from the global store into the virtual store.",
        long_help = "How to import package files from the global store into the\nvirtual store.\n\nOne of `auto` (default: detect the fastest strategy),\n`hardlink`, `copy`, `clone` (reflink; falls back to copy\npending strict enforcement), or `clone-or-copy` (reflink with\na copy fallback). Overrides `package-import-method` /\n`packageImportMethod` from `.npmrc` / `aube-workspace.yaml`\nwhen set.",
        long = "package-import-method",
        value_name = "METHOD"
    )]
    pub package_import_method: ::std::option::Option<::std::string::String>,
    /// Override the local pnpmfile location.
    ///
    /// Mirrors pnpm's `--pnpmfile <path>`. Relative paths resolve against the project root; absolute paths are used as-is. Wins over `pnpmfilePath` from `pnpm-workspace.yaml`. A typo (target missing) is a hard miss with a warning rather than a silent fallback to the default.
    #[usage(
        long = "pnpmfile",
        conflicts = "--ignore-pnpmfile",
        value_name = "PATH"
    )]
    pub pnpmfile: ::std::option::Option<::std::string::String>,
    /// Prefer cached metadata over revalidation; only hit the network on a miss.
    #[usage(long = "prefer-offline", conflicts = "--offline")]
    pub prefer_offline: bool,
    /// Selectively hoist matching transitive deps to the root node_modules.
    ///
    /// Repeatable; comma-separated values are also accepted.
    #[usage(
        long = "public-hoist-pattern",
        delimiter = ',',
        value_name = "GLOB",
        var
    )]
    pub public_hoist_pattern: ::std::vec::Vec<::std::string::String>,
    /// How to resolve version ranges.
    ///
    /// `highest` (pnpm's classic behavior) or `time-based` (pick the lowest satisfying direct dep and constrain transitives by a publish-date cutoff). Accepts pnpm's aliases `time` and `lowest-direct`. When omitted, falls back to the `resolution-mode` key in `.npmrc` / `aube-workspace.yaml`.
    #[usage(long = "resolution-mode", value_name = "MODE")]
    pub resolution_mode: ::std::option::Option<::std::string::String>,
    #[usage(
        help = "Hoist every non-local transitive dep to the top-level `node_modules/`.",
        long_help = "Hoist every non-local transitive dep to the top-level\n`node_modules/`.\n\nOverrides `shamefully-hoist` / `shamefullyHoist` from\n`.npmrc` / `aube-workspace.yaml` when set.",
        long = "shamefully-hoist"
    )]
    pub shamefully_hoist: bool,
    /// Cache post-build side effects for dependency packages.
    ///
    /// Defaults to on and only applies to packages allowed by `allowBuilds` / `onlyBuiltDependencies`. Pair with `--no-side-effects-cache` to opt out.
    #[usage(long = "side-effects-cache", overrides = "--no-side-effects-cache")]
    pub side_effects_cache: bool,
    /// Verify tarball SHA-512 before importing into the store.
    ///
    /// Checks each tarball against the lockfile integrity. Defaults to `true` (pnpm parity); pair with `--no-verify-store-integrity` to skip.
    #[usage(
        long = "verify-store-integrity",
        overrides = "--no-verify-store-integrity"
    )]
    pub verify_store_integrity: bool,
    /// Short alias for the global `--workspace-root` flag.
    ///
    /// Runs install from the workspace root regardless of cwd (`pnpm install -w`).
    #[usage(short = 'w', hide)]
    pub w: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
}

/// Install dependencies, then run the `test` script (pnpm compat alias).
///
/// Hidden from help because `aube test` already auto-installs.
#[derive(Args)]
pub struct InstallTestArgs {
    /// Skip auto-install check
    #[usage(long = "no-install")]
    pub no_install: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Arguments to pass to the script
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Alias for `list --long` (hidden; prefer `list --long`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct LaArgs {
    /// Show only devDependencies
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// List globally-installed packages instead of the project's dependency tree
    #[usage(long = "global", short = 'g')]
    pub global: bool,
    /// Show only production dependencies (skip devDependencies)
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// How deep to render the transitive tree.
    ///
    /// `0` (default) shows only the top-level direct deps. Pass `9999` (or any large number) for the full graph; `--depth=Infinity` is accepted for pnpm/npm compat. `--depth=-1` (pnpm spelling) lists project headers only — no direct or transitive deps.
    #[usage(long = "depth", value_name = "DEPTH", default = "0")]
    pub depth: ::std::option::Option<::std::string::String>,
    /// Output format: one of `default`, `json`, or `parseable`
    #[usage(
        long = "format",
        value_name = "FORMAT",
        value_enum,
        default = "default"
    )]
    pub format: ::std::option::Option<LaFormatValue>,
    /// Shortcut for `--format json`.
    ///
    /// Emit a JSON array of package entries.
    #[usage(long = "json", conflicts = "--format")]
    pub json: bool,
    /// List packages from the lockfile only, without checking node_modules.
    #[usage(long = "lockfile-only")]
    pub lockfile_only: bool,
    /// Show version and path for each entry.
    ///
    /// Default output is already name + version; `--long` adds the store path for debugging.
    #[usage(long = "long")]
    pub long: bool,
    /// Shortcut for `--format parseable`.
    ///
    /// Emit one tab-separated line per package.
    #[usage(long = "parseable", conflicts("--format", "--json"))]
    pub parseable: bool,
    /// Optional package name (or glob-like prefix match) to filter the output
    #[usage(arg, name = "PATTERN")]
    pub pattern: ::std::option::Option<::std::string::String>,
}

#[derive(ValueEnum)]
pub enum LaFormatValue {
    #[usage(name = "default")]
    Default,
    #[usage(name = "json")]
    Json,
    #[usage(name = "parseable")]
    Parseable,
}

/// Report the licenses of installed dependencies
#[derive(Args)]
#[usage(effect = "read")]
pub struct LicensesArgs {
    /// Show only devDependencies
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// Emit a JSON array keyed by package instead of the default table
    #[usage(long = "json")]
    pub json: bool,
    /// Include the resolved path on disk for each package
    #[usage(long = "long")]
    pub long: bool,
    /// Show only production dependencies (skip devDependencies)
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// pnpm-compat subcommand marker.
    ///
    /// `aube licenses ls [flags...]` is accepted as a synonym for bare `aube licenses [flags...]` so scripts written for pnpm keep working. Modeled as an optional positional instead of a clap subcommand so flags can appear on either side of `ls` (subcommands swallow the parent's flags).
    #[usage(arg, name = "SUBCOMMAND", hide, choices("ls"))]
    pub subcommand: ::std::option::Option<::std::string::String>,
}

/// Link a local package globally, or into the current project
#[derive(Args)]
#[usage(effect = "write")]
pub struct LinkArgs {
    /// Register into (or resolve from) the global link registry.
    ///
    /// The registry lives at `$XDG_CACHE_HOME/aube/global-links`, `$HOME/.cache/aube/global-links` when `XDG_CACHE_HOME` is unset, or `%LOCALAPPDATA%\aube\global-links` on Windows. Default behavior for bare `aube link` / `aube link <name>` — the flag exists for pnpm parity and makes the intent explicit.
    #[usage(long = "global", short = 'g')]
    pub global: bool,
    /// Package name, or path to a local directory
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::option::Option<::std::string::String>,
}

/// Print the resolved dependency tree
#[derive(Args)]
#[usage(
    after_long_help = "Examples:\n\n  $ aube list\n  my-app@1.0.0 /home/user/project\n\n  dependencies:\n  ├── express 4.19.2\n  ├── lodash 4.17.21\n  └── zod 3.23.8\n\n  devDependencies:\n  ├── typescript 5.4.5\n  └── vitest 1.6.0\n\n  # Show the full transitive tree\n  $ aube list --depth Infinity\n  my-app@1.0.0 /home/user/project\n\n  dependencies:\n  ├─┬ express 4.19.2\n  │ ├── accepts 1.3.8\n  │ ├── body-parser 1.20.2\n  │ └── ...\n\n  # Only direct production deps\n  $ aube list --prod\n\n  # Machine-readable: one path per line (real store locations)\n  $ aube list --parseable\n  /home/user/project\n  /home/user/project/node_modules/.aube/express@4.19.2/node_modules/express\n  /home/user/project/node_modules/.aube/lodash@4.17.21/node_modules/lodash\n\n  # Filter to a single package\n  $ aube list express\n",
    effect = "read"
)]
pub struct ListArgs {
    /// Show only devDependencies
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// List globally-installed packages instead of the project's dependency tree
    #[usage(long = "global", short = 'g')]
    pub global: bool,
    /// Show only production dependencies (skip devDependencies)
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// How deep to render the transitive tree.
    ///
    /// `0` (default) shows only the top-level direct deps. Pass `9999` (or any large number) for the full graph; `--depth=Infinity` is accepted for pnpm/npm compat. `--depth=-1` (pnpm spelling) lists project headers only — no direct or transitive deps.
    #[usage(long = "depth", value_name = "DEPTH", default = "0")]
    pub depth: ::std::option::Option<::std::string::String>,
    /// Output format: one of `default`, `json`, or `parseable`
    #[usage(
        long = "format",
        value_name = "FORMAT",
        value_enum,
        default = "default"
    )]
    pub format: ::std::option::Option<ListFormatValue>,
    /// Shortcut for `--format json`.
    ///
    /// Emit a JSON array of package entries.
    #[usage(long = "json", conflicts = "--format")]
    pub json: bool,
    /// List packages from the lockfile only, without checking node_modules.
    #[usage(long = "lockfile-only")]
    pub lockfile_only: bool,
    /// Show version and path for each entry.
    ///
    /// Default output is already name + version; `--long` adds the store path for debugging.
    #[usage(long = "long")]
    pub long: bool,
    /// Shortcut for `--format parseable`.
    ///
    /// Emit one tab-separated line per package.
    #[usage(long = "parseable", conflicts("--format", "--json"))]
    pub parseable: bool,
    /// Optional package name (or glob-like prefix match) to filter the output
    #[usage(arg, name = "PATTERN")]
    pub pattern: ::std::option::Option<::std::string::String>,
}

#[derive(ValueEnum)]
pub enum ListFormatValue {
    #[usage(name = "default")]
    Default,
    #[usage(name = "json")]
    Json,
    #[usage(name = "parseable")]
    Parseable,
}

/// Alias for `list --long` (hidden; prefer `list --long`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct LlArgs {
    /// Show only devDependencies
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// List globally-installed packages instead of the project's dependency tree
    #[usage(long = "global", short = 'g')]
    pub global: bool,
    /// Show only production dependencies (skip devDependencies)
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// How deep to render the transitive tree.
    ///
    /// `0` (default) shows only the top-level direct deps. Pass `9999` (or any large number) for the full graph; `--depth=Infinity` is accepted for pnpm/npm compat. `--depth=-1` (pnpm spelling) lists project headers only — no direct or transitive deps.
    #[usage(long = "depth", value_name = "DEPTH", default = "0")]
    pub depth: ::std::option::Option<::std::string::String>,
    /// Output format: one of `default`, `json`, or `parseable`
    #[usage(
        long = "format",
        value_name = "FORMAT",
        value_enum,
        default = "default"
    )]
    pub format: ::std::option::Option<LlFormatValue>,
    /// Shortcut for `--format json`.
    ///
    /// Emit a JSON array of package entries.
    #[usage(long = "json", conflicts = "--format")]
    pub json: bool,
    /// List packages from the lockfile only, without checking node_modules.
    #[usage(long = "lockfile-only")]
    pub lockfile_only: bool,
    /// Show version and path for each entry.
    ///
    /// Default output is already name + version; `--long` adds the store path for debugging.
    #[usage(long = "long")]
    pub long: bool,
    /// Shortcut for `--format parseable`.
    ///
    /// Emit one tab-separated line per package.
    #[usage(long = "parseable", conflicts("--format", "--json"))]
    pub parseable: bool,
    /// Optional package name (or glob-like prefix match) to filter the output
    #[usage(arg, name = "PATTERN")]
    pub pattern: ::std::option::Option<::std::string::String>,
}

#[derive(ValueEnum)]
pub enum LlFormatValue {
    #[usage(name = "default")]
    Default,
    #[usage(name = "json")]
    Json,
    #[usage(name = "parseable")]
    Parseable,
}

/// Store a registry auth token in the user's ~/.npmrc
#[derive(Args)]
#[usage(effect = "write")]
pub struct LoginArgs {
    #[usage(
        help = "Authentication flow: `legacy` (token paste; default) or `web` (OAuth flow against `{registry}/-/v1/login`).",
        long_help = "Authentication flow: `legacy` (token paste; default) or `web`\n(OAuth flow against `{registry}/-/v1/login`).",
        long = "auth-type",
        value_name = "TYPE",
        default = "legacy"
    )]
    pub auth_type: ::std::option::Option<::std::string::String>,
    /// Scope to bind this registry to (e.g. `@myorg`).
    ///
    /// When set, the scope->registry mapping is also written to `~/.npmrc`.
    #[usage(long = "scope", value_name = "SCOPE")]
    pub scope: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
}

/// Remove a registry auth token from the user's ~/.npmrc
#[derive(Args)]
#[usage(effect = "destructive")]
pub struct LogoutArgs {
    /// Scope whose registry mapping should also be removed (e.g. `@myorg`).
    #[usage(long = "scope", value_name = "SCOPE")]
    pub scope: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
}

/// Run Node.js through aube's project runtime resolver
#[derive(Args)]
pub struct NodeArgs {
    /// Arguments to pass to Node.js
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Report dependencies whose installed version lags behind the registry
#[derive(Args)]
#[usage(effect = "read")]
pub struct OutdatedArgs {
    /// Show only devDependencies
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// Check globally-installed packages instead of the current project.
    #[usage(long = "global", short = 'g', conflicts = "--workspace-root")]
    pub global: bool,
    /// Emit a JSON object keyed by package name instead of the default table
    #[usage(long = "json")]
    pub json: bool,
    /// Also show deps whose `wanted` version matches the installed version
    #[usage(long = "long")]
    pub long: bool,
    /// Show only production dependencies (skip devDependencies)
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// Operate on the workspace root regardless of cwd.
    ///
    /// Mirrors pnpm's `-w/--workspace-root`: from a sub-package, `aube outdated -w` reports the root manifest's deps instead of the sub-package's. No-op when paired with `-r` / `--filter` (those already drive workspace selection from the root).
    #[usage(long = "workspace-root", long = "workspace", short = 'w')]
    pub workspace_root: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Optional package name (prefix match) to filter the report
    #[usage(arg, name = "PATTERN")]
    pub pattern: ::std::option::Option<::std::string::String>,
}

/// Manage package owners (not implemented — use `npm owner`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct OwnerArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "ARGS",
        help = "Unused; captured so `aube <cmd> foo bar` parses instead of erroring on unexpected args before the fallback message prints.",
        long_help = "Unused; captured so `aube <cmd> foo bar` parses instead of\nerroring on unexpected args before the fallback message prints.",
        hide,
        double_dash = "automatic"
    )]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Create a publishable `.tgz` tarball from the current project
#[derive(Args)]
#[usage(effect = "write")]
pub struct PackArgs {
    /// Don't write the tarball; print what would be packed
    #[usage(long = "dry-run")]
    pub dry_run: bool,
    /// Skip `prepack` / `prepare` / `postpack` lifecycle scripts.
    #[usage(long = "ignore-scripts")]
    pub ignore_scripts: bool,
    /// Print the result as a JSON object
    #[usage(long = "json")]
    pub json: bool,
    /// Directory to write the tarball into (default: current directory)
    #[usage(long = "pack-destination", value_name = "DIR")]
    pub pack_destination: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
}

/// Extract a package into an edit directory so it can be patched
#[derive(Args)]
#[usage(effect = "write")]
pub struct PatchArgs {
    /// Directory to extract the writable copy into.
    ///
    /// When omitted, `aube` picks a fresh temp dir under the system tmpdir.
    #[usage(long = "edit-dir", value_name = "DIR")]
    pub edit_dir: ::std::option::Option<::std::string::String>,
    /// Ignore any existing patch entry for this package.
    ///
    /// Extracts a pristine copy from `node_modules` rather than re-applying the existing patch first. Accepted for pnpm parity; aube already extracts from the *linked* (post-patch) tree, so this flag is effectively informational here.
    #[usage(long = "ignore-existing")]
    pub ignore_existing: bool,
    /// Package spec, `<name>@<version>`.
    ///
    /// The package must already be installed in `node_modules` (we copy from the linked virtual store, not from the registry, so the layout matches what install would later patch).
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
}

/// Generate a `.patch` file from a `aube patch` edit directory
#[derive(Args)]
#[usage(effect = "write")]
pub struct PatchCommitArgs {
    #[usage(
        help = "Where to write the generated `.patch` file, relative to the project root.",
        long_help = "Where to write the generated `.patch` file, relative to the\nproject root.\n\nDefaults to `patches`.\n\nIgnored when the dependency already has a declared patch path;\nthe existing path is always reused in that case.",
        long = "patches-dir",
        value_name = "DIR",
        default = "patches"
    )]
    pub patches_dir: ::std::option::Option<::std::string::String>,
    /// The edit directory printed by `aube patch`.
    ///
    /// The matching source snapshot is read from a sibling `source/` dir, located via the `.aube_patch_state.json` sidecar.
    #[usage(arg, name = "DIR")]
    pub dir: ::std::string::String,
}

/// Remove patch entries from `pnpm.patchedDependencies`
#[derive(Args)]
#[usage(effect = "destructive")]
pub struct PatchRemoveArgs {
    /// Patch keys to remove, formatted as `<name>@<version>`.
    ///
    /// Same shape used as the `pnpm.patchedDependencies` map key. With no arguments, every declared patch is removed.
    #[usage(arg, name = "PATCH")]
    pub patch: ::std::vec::Vec<::std::string::String>,
}

#[derive(Args)]
#[usage(
    after_long_help = "Examples:\n\n  $ aube peers check\n  All peer dependencies are satisfied.\n\n  # With issues\n  $ aube peers check\n  1 unmet, 1 missing peer dependencies:\n\n  ├─┬ @emotion/react@11.11.4\n  │ └── ✕ unmet peer react@>=16.8: found 17.0.2\n  └─┬ react-dom@18.2.0\n    └── ✕ missing peer react@^18.0.0\n\n  # Machine-readable\n  $ aube peers check --json\n",
    effect = "read"
)]
pub struct PeersCheckArgs {
    /// Emit a JSON report instead of the human-readable tree.
    #[usage(long = "json")]
    pub json: bool,
}

/// Inspect peer-dependency resolution from the lockfile
#[derive(Args)]
#[usage(effect = "read")]
pub struct PeersArgs {
    #[usage(subcommand)]
    pub command: PeersCommands,
}

#[derive(Subcommands)]
pub enum PeersCommands {
    /// Check for unmet and missing peer-dependency issues by reading the lockfile.
    #[usage(
        name = "check",
        help = "Check for unmet and missing peer-dependency issues by reading the lockfile.",
        long_help = "Check for unmet and missing peer-dependency issues by reading the\nlockfile.\n\nExits with status 1 if any issue is reported."
    )]
    Check(Box<PeersCheckArgs>),
}

/// Manage package.json entries (not implemented — use `npm pkg`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct PkgArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "ARGS",
        help = "Unused; captured so `aube <cmd> foo bar` parses instead of erroring on unexpected args before the fallback message prints.",
        long_help = "Unused; captured so `aube <cmd> foo bar` parses instead of\nerroring on unexpected args before the fallback message prints.",
        hide,
        double_dash = "automatic"
    )]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Print the current package prefix directory
#[derive(Args)]
#[usage(effect = "read")]
pub struct PrefixArgs {
    /// Print the global prefix directory instead of the project's root
    #[usage(long = "global", short = 'g')]
    pub global: bool,
}

/// Remove extraneous packages from project `node_modules`.
///
/// Reads the lockfile, computes the packages still reachable from each importer, and removes stale top-level links, stale virtual-store entries, and dangling .bin links. Does not modify package.json or the lockfile.
#[derive(Args)]
#[usage(effect = "write")]
pub struct PruneArgs {
    /// Remove devDependencies from node_modules
    #[usage(long = "prod", long = "production", short = 'P')]
    pub prod: bool,
    /// Also remove optionalDependencies
    #[usage(long = "no-optional")]
    pub no_optional: bool,
}

/// Publish the current package to the registry
#[derive(Args)]
#[usage(effect = "write")]
pub struct PublishArgs {
    /// Publish as `public` or `restricted`.
    ///
    /// Sent as the `access` field in the publish body; scoped packages default to `restricted` on the registry side, so pass `--access=public` to make a new scoped package world-readable.
    #[usage(long = "access", value_name = "LEVEL")]
    pub access: ::std::option::Option<::std::string::String>,
    /// Don't upload; print what would be published.
    #[usage(long = "dry-run")]
    pub dry_run: bool,
    /// Republish even when the version is already on the registry.
    ///
    /// By default `aube publish` issues a GET before the PUT and refuses to proceed when the version exists, surfacing a clear error instead of relying on the registry to return 409. In `--recursive` / `--filter` mode, `--force` overrides the silent "already-published" skip so every selected workspace package is re-PUT. The registry must still accept the republish — npm's public registry rejects re-publishes outright; Verdaccio and most private mirrors allow them.
    #[usage(long = "force")]
    pub force: bool,
    /// Skip publish lifecycle scripts.
    ///
    /// Suppresses `prepublishOnly`, `prepublish`, `prepack`, `prepare`, `postpack`, `publish`, and `postpublish` scripts for this publish.
    #[usage(long = "ignore-scripts")]
    pub ignore_scripts: bool,
    /// Emit the publish result as JSON.
    ///
    /// Output matches `npm publish --json` / `pnpm publish --json`; recursive multi-package publishes emit an array.
    #[usage(long = "json")]
    pub json: bool,
    /// Skip the "working tree must be clean" check.
    ///
    /// When unset, aube refuses to publish from a dirty git checkout (uncommitted tracked changes) or from a detached / non-release branch.
    #[usage(long = "no-git-checks")]
    pub no_git_checks: bool,
    /// One-time password for registries that require 2FA.
    ///
    /// Sent verbatim as the `npm-otp` header.
    #[usage(long = "otp", value_name = "CODE")]
    pub otp: ::std::option::Option<::std::string::String>,
    #[usage(
        help = "Generate a SLSA provenance attestation and attach it to the publish body.",
        long_help = "Generate a SLSA provenance attestation and attach it to the publish\nbody.\n\nRequires an OIDC-capable CI environment (GitHub Actions with\n`id-token: write`, GitLab CI, Buildkite, or CircleCI) — aube\nsigns via the Sigstore public-good instance (Fulcio + Rekor)\nand attaches the resulting bundle so registries that honor\nnpm's provenance protocol light up the \"provenance\" badge on\nthe published version.",
        long = "provenance"
    )]
    pub provenance: bool,
    /// Default dist-tag to publish under (default: `latest`).
    #[usage(long = "tag", value_name = "TAG")]
    pub tag: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Tarball or package directory to publish (default: current package).
    #[usage(arg, name = "TARBALL|FOLDER")]
    pub tarball_folder: ::std::option::Option<::std::string::String>,
}

/// Alias for `clean` — remove `node_modules` across every workspace project.
///
/// A `purge` script in the root `package.json` overrides the built-in.
#[derive(Args)]
#[usage(effect = "write")]
pub struct PurgeArgs {
    /// Also remove lockfiles at the workspace root.
    ///
    /// Targets `aube-lock.yaml`, `pnpm-lock.yaml`, `package-lock.json`, `npm-shrinkwrap.json`, `yarn.lock`, and `bun.lock`.
    #[usage(long = "lockfile", short = 'l')]
    pub lockfile: bool,
}

/// Query packages in the resolved dependency graph
#[derive(Args)]
#[usage(effect = "read")]
pub struct QueryArgs {
    /// Only match devDependency roots and their transitive deps.
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// Only match production/optional roots and their transitive deps.
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// Emit a JSON array instead of the default text layout.
    #[usage(long = "json", conflicts = "--parseable")]
    pub json: bool,
    /// Emit tab-separated rows: dep_path, name, version, source, flags.
    #[usage(long = "parseable")]
    pub parseable: bool,
    /// Selector expression.
    ///
    /// Supports `*`, bare package names, `[name=value]`, `[version=value]`, `[license=value]`, `[depPath=value]`, `[source=value]`, `:prod`, `:dev`, `:optional`, `:peer`, `:transitive`, `:scripts`, `:bin`, `:deprecated`, `:license(value)`, and `:type(value)`.
    #[usage(arg, name = "SELECTOR")]
    pub selector: ::std::string::String,
}

#[derive(Args)]
#[usage(effect = "write")]
pub struct RebuildArgs {
    #[usage(
        arg,
        name = "PACKAGE",
        help = "Optional package names. When supplied, only matching deps' scripts run; the root lifecycle hooks (preinstall, install, postinstall, prepare) are skipped. Match is by graph `name`, not by `dep_path`. The active `allowBuilds` / `onlyBuiltDependencies` policy is bypassed for the named deps — naming the package is the explicit opt-in.",
        long_help = "Optional package names. When supplied, only matching deps'\nscripts run; the root lifecycle hooks (preinstall, install,\npostinstall, prepare) are skipped. Match is by graph `name`,\nnot by `dep_path`. The active `allowBuilds` /\n`onlyBuiltDependencies` policy is bypassed for the named\ndeps — naming the package is the explicit opt-in."
    )]
    pub package: ::std::vec::Vec<::std::string::String>,
}

/// Run a supported command across workspace packages
#[derive(Args)]
pub struct RecursiveArgs {
    /// Command and arguments to run recursively across workspace packages
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Remove a dependency
#[derive(Args)]
#[usage(effect = "destructive")]
pub struct RemoveArgs {
    /// Remove only from devDependencies
    #[usage(long = "save-dev", short = 'D')]
    pub save_dev: bool,
    /// Remove from the global install directory instead of the project
    #[usage(long = "global", short = 'g')]
    pub global: bool,
    /// Skip root lifecycle scripts during the chained reinstall
    #[usage(long = "ignore-scripts")]
    pub ignore_scripts: bool,
    /// Remove the dependency from the workspace root's `package.json`.
    ///
    /// Applies regardless of the current working directory: walks up from cwd looking for `aube-workspace.yaml`, `pnpm-workspace.yaml`, or a `package.json` with a `workspaces` field and runs the remove against that directory. Takes precedence over `--filter` when both are supplied (same as `add --workspace`).
    #[usage(long = "workspace", short = 'w', conflicts = "--global")]
    pub workspace: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Package(s) to remove
    #[usage(arg, name = "PACKAGES")]
    pub packages: ::std::vec::Vec<::std::string::String>,
}

/// Restart a package (shortcut for `run restart`; falls back to `stop` + `start`)
#[derive(Args)]
pub struct RestartArgs {
    /// Skip auto-install check
    #[usage(long = "no-install")]
    pub no_install: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Arguments to pass to the script
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Print the path to `node_modules`
#[derive(Args)]
#[usage(effect = "read")]
pub struct RootArgs {
    /// Print the global package directory instead of the project's
    #[usage(long = "global", short = 'g')]
    pub global: bool,
}

/// Run a script defined in package.json
#[derive(Args)]
pub struct RunArgs {
    /// Print the nearest `package.json`'s scripts for shell completion.
    ///
    /// Consumed by the `complete "script"` node in the usage spec, not meant to be typed by hand.
    #[usage(long = "complete", hide)]
    pub complete: bool,
    /// Don't error if the script is missing from package.json
    #[usage(long = "if-present")]
    pub if_present: bool,
    /// Forward `--inspect` to a Node-backed script or local binary.
    #[usage(
        long = "inspect",
        require_equals,
        value_optional,
        default_missing = "",
        value_name = "[[HOST:]PORT]"
    )]
    pub inspect: ::std::option::Option<::std::string::String>,
    /// Forward `--inspect-brk` to a Node-backed script or local binary.
    #[usage(
        long = "inspect-brk",
        require_equals,
        value_optional,
        default_missing = "",
        value_name = "[[HOST:]PORT]"
    )]
    pub inspect_brk: ::std::option::Option<::std::string::String>,
    /// Continue recursive execution after a script fails.
    ///
    /// Parsed for pnpm compatibility; aube's sequential fanout still stops on first failure.
    #[usage(long = "no-bail")]
    pub no_bail: bool,
    /// Skip auto-install check
    #[usage(long = "no-install")]
    pub no_install: bool,
    /// Disable topological sorting (default is on).
    ///
    /// Without this, recursive runs visit packages in a deps-first order so a `build` script in a shared library finishes before a dependent app's `build` starts. Pass this to fall back to the raw workspace-listing order.
    #[usage(long = "no-sort", overrides = "--sort")]
    pub no_sort: bool,
    /// Run the script in every matched workspace package concurrently.
    ///
    /// Unbounded parallelism. Pair with `--workspace-concurrency=N` to cap the worker count. Single-package runs ignore this flag. First non-zero exit fails the whole run, but siblings are allowed to finish so their output isn't truncated. Child stdio is piped and lines are emitted with a `<package>: ` prefix; pass `--reporter-hide-prefix` to drop the labels.
    #[usage(long = "parallel")]
    pub parallel: bool,
    /// Write a recursive run summary file.
    ///
    /// Parsed for pnpm compatibility.
    #[usage(long = "report-summary")]
    pub report_summary: bool,
    /// Hide the `<package>: ` label on parallel-run output lines.
    ///
    /// Lines are still piped through aube (so the line breaks are clean even when many packages run at once), but the source package isn't named on each line. Sequential runs ignore this flag.
    #[usage(long = "reporter-hide-prefix")]
    pub reporter_hide_prefix: bool,
    /// Resume recursive execution starting at this package name.
    ///
    /// After the topo sort and `--reverse` are applied, packages before the named one in the resulting order are skipped. Errors if the name isn't in the matched workspace set.
    #[usage(long = "resume-from", value_name = "PACKAGE")]
    pub resume_from: ::std::option::Option<::std::string::String>,
    /// Reverse the recursive execution order (after topo sort).
    ///
    /// Useful for teardown-style scripts where dependents must shut down before their deps.
    #[usage(long = "reverse")]
    pub reverse: bool,
    /// Sort recursive packages topologically (this is the default).
    ///
    /// Pass to override an earlier `--no-sort` on the same invocation.
    #[usage(long = "sort", overrides = "--no-sort")]
    pub sort: bool,
    #[usage(
        help = "Suppress aube's wrapper output while still showing script stdout/stderr.",
        long_help = "Suppress aube's wrapper output while still showing script\nstdout/stderr.\n\nShort alias for the global `--silent` flag; long form is\nintentionally omitted to avoid shadowing the global `--silent`\nin clap's dispatch.",
        short = 's'
    )]
    pub s: bool,
    /// Cap the number of recursive packages running at once.
    ///
    /// Setting this implicitly enables parallel mode at width `N`. `0` means "use the available CPU count". Without this flag, `--parallel` stays unbounded.
    #[usage(long = "workspace-concurrency", value_name = "N")]
    pub workspace_concurrency: ::std::option::Option<::std::string::String>,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Script or local binary name.
    ///
    /// Omit on an interactive TTY to pick from `package.json` scripts. If no script matches, aube falls back to `node_modules/.bin/<name>`.
    #[usage(arg, name = "SCRIPT")]
    pub script: ::std::option::Option<::std::string::String>,
    /// Arguments to pass to the script
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Show the resolved runtime and installed versions
#[derive(Args)]
#[usage(effect = "read")]
pub struct RuntimeListArgs {}

/// Pin a runtime in package.json devEngines.runtime and install it
#[derive(Args)]
#[usage(effect = "write")]
pub struct RuntimeSetArgs {
    #[usage(
        help = "Install for the user instead of the project (delegates to `mise use -g node@<version>` when mise manages installs)",
        long_help = "Install for the user instead of the project (delegates to\n`mise use -g node@<version>` when mise manages installs)",
        long = "global",
        short = 'g'
    )]
    pub global: bool,
    /// `onFail` policy written to devEngines.runtime
    #[usage(long = "on-fail", value_name = "POLICY", default = "download")]
    pub on_fail: ::std::option::Option<::std::string::String>,
    /// Pin the exact resolved version instead of a caret range
    #[usage(long = "save-exact")]
    pub save_exact: bool,
    /// Runtime name (only `node` is supported)
    #[usage(arg, name = "NAME")]
    pub name: ::std::string::String,
    #[usage(
        arg,
        name = "VERSION",
        help = "Version request: an exact version, a range (`^24`, `22`), `lts`, `latest`, or an LTS codename (`lts/jod`)",
        long_help = "Version request: an exact version, a range (`^24`, `22`), `lts`,\n`latest`, or an LTS codename (`lts/jod`)"
    )]
    pub version: ::std::string::String,
}

/// Manage the project's Node.js runtime (pin, install, inspect)
#[derive(Args)]
#[usage(effect = "read")]
pub struct RuntimeArgs {
    #[usage(subcommand)]
    pub command: RuntimeCommands,
}

#[derive(Subcommands)]
pub enum RuntimeCommands {
    /// Show the resolved runtime and installed versions
    #[usage(name = "list", alias = "ls")]
    List(Box<RuntimeListArgs>),
    /// Pin a runtime in package.json devEngines.runtime and install it
    #[usage(name = "set")]
    Set(Box<RuntimeSetArgs>),
}

/// Generate a Software Bill of Materials (CycloneDX or SPDX)
#[derive(Args)]
#[usage(effect = "read")]
pub struct SbomArgs {
    /// Show only devDependencies
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// Exclude peer dependencies from CycloneDX output
    #[usage(long = "exclude-peers")]
    pub exclude_peers: bool,
    /// Output format: `cyclonedx` (default) or `spdx`
    #[usage(
        long = "format",
        value_name = "FORMAT",
        value_enum,
        default = "cyclonedx"
    )]
    pub format: ::std::option::Option<SbomFormatValue>,
    /// Describe the complete platform-independent lockfile graph
    #[usage(long = "lockfile-only")]
    pub lockfile_only: bool,
    /// Show only production dependencies (skip devDependencies)
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
}

#[derive(ValueEnum)]
pub enum SbomFormatValue {
    #[usage(name = "cyclonedx")]
    Cyclonedx,
    #[usage(name = "spdx")]
    Spdx,
}

/// Search the registry for packages (not implemented — use `npm search`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct SearchArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "ARGS",
        help = "Unused; captured so `aube <cmd> foo bar` parses instead of erroring on unexpected args before the fallback message prints.",
        long_help = "Unused; captured so `aube <cmd> foo bar` parses instead of\nerroring on unexpected args before the fallback message prints.",
        hide,
        double_dash = "automatic"
    )]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Alias for `config set` (hidden; prefer `config set`)
#[derive(Args)]
#[usage(effect = "write")]
pub struct SetArgs {
    /// Shortcut for `--location project`.
    #[usage(long = "local", conflicts = "--location")]
    pub local: bool,
    /// Which config location to write to.
    ///
    /// Defaults to `user`. Writes land in `.npmrc` for the npm-shared surface — per-host auth/cert templates, scoped registries, and settings tagged `npmShared = true` in the settings registry (`registry`, `proxy` / `https-proxy`, `engine-strict`, `ignore-scripts`, etc.) — so npm and yarn read the same value. Aube-only and pnpm-only settings, plus unknown keys, land in aube's own config (`~/.config/aube/config.toml` at user scope, `<cwd>/.config/aube/config.toml` at project scope) where sibling tools don't see them.
    ///
    /// Dotted writes for aube map settings (`allowBuilds.<pkg>`, `overrides.<pkg>`, …) edit one entry at a time. At project scope (`--local`) they land in `pnpm-workspace.yaml#<map>.<entry>` or `package.json#aube.<map>.<entry>` if no workspace yaml exists, the same place install reads from. User-scope dotted writes for these maps error: aube only reads them per project.
    #[usage(
        long = "location",
        value_name = "LOCATION",
        value_enum,
        default = "user"
    )]
    pub location: ::std::option::Option<SetLocationValue>,
    /// Setting key (canonical name or `.npmrc` alias).
    #[usage(arg, name = "KEY")]
    pub key: ::std::string::String,
    /// Value to write. Stored verbatim after `key=`.
    #[usage(arg, name = "VALUE")]
    pub value: ::std::string::String,
}

#[derive(ValueEnum)]
pub enum SetLocationValue {
    /// User config (`~/.config/aube/config.toml` for known aube settings, `~/.npmrc` for registry/auth and unknown keys)
    #[usage(name = "user")]
    User,
    /// `<cwd>/.npmrc`
    #[usage(name = "project")]
    Project,
    /// Alias for `user` — aube has no separate global config file.
    #[usage(name = "global")]
    Global,
}

/// Set a `package.json` script (not implemented — use `npm set-script`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct SetScriptArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "ARGS",
        help = "Unused; captured so `aube <cmd> foo bar` parses instead of erroring on unexpected args before the fallback message prints.",
        long_help = "Unused; captured so `aube <cmd> foo bar` parses instead of\nerroring on unexpected args before the fallback message prints.",
        hide,
        double_dash = "automatic"
    )]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Show the companies sponsoring aube and the jdx.dev open source tools
#[derive(Args)]
#[usage(effect = "read")]
pub struct SponsorsArgs {}

/// Stage packages for publishing (not implemented — use `npm stage`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct StageArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "ARGS",
        help = "Unused; captured so `aube <cmd> foo bar` parses instead of erroring on unexpected args before the fallback message prints.",
        long_help = "Unused; captured so `aube <cmd> foo bar` parses instead of\nerroring on unexpected args before the fallback message prints.",
        hide,
        double_dash = "automatic"
    )]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Start a package (shortcut for `run start`)
#[derive(Args)]
pub struct StartArgs {
    /// Skip auto-install check
    #[usage(long = "no-install")]
    pub no_install: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Arguments to pass to the script
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Stop a package (shortcut for `run stop`)
#[derive(Args)]
pub struct StopArgs {
    /// Skip auto-install check
    #[usage(long = "no-install")]
    pub no_install: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Arguments to pass to the script
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

#[derive(Args)]
#[usage(effect = "write")]
pub struct StoreAddArgs {
    /// Package specs to fetch into the store.
    #[usage(arg, name = "PACKAGES", required)]
    pub packages: ::std::vec::Vec<::std::string::String>,
}

/// Show the store path.
#[derive(Args)]
#[usage(effect = "read")]
pub struct StorePathArgs {}

/// Remove unreferenced packages from the global store.
///
/// Operates on the store printed by `aube store path`; it does not touch project node_modules directories, manifests, or lockfiles.
///
/// It removes global virtual-store graph entries not referenced by any registered project. Entries from older aube releases live outside the registry-managed versioned namespace and are not touched. It then prunes content-store files.
///
/// On reflink filesystems such as APFS or btrfs, link counts cannot prove project reachability, so content-store pruning relies on cached package indexes. Global virtual-store reachability comes from project links.
#[derive(Args)]
#[usage(effect = "write")]
pub struct StorePruneArgs {
    /// Do not actually delete anything; report what would be pruned.
    #[usage(long = "dry-run")]
    pub dry_run: bool,
    /// Emit the dry-run plan as one machine-readable JSON document.
    #[usage(long = "json", requires = "--dry-run")]
    pub json: bool,
}

/// Verify the store against cached package indexes.
///
/// Confirms every file referenced by a cached package index is still present in the store and that its BLAKE3 hash matches. Exits non-zero when any corruption is detected.
#[derive(Args)]
#[usage(effect = "read")]
pub struct StoreStatusArgs {}

/// Manage the global store
#[derive(Args)]
#[usage(effect = "read")]
pub struct StoreArgs {
    #[usage(subcommand)]
    pub command: StoreCommands,
}

#[derive(Subcommands)]
pub enum StoreCommands {
    /// Add one or more packages to the global store without linking them into any project.
    #[usage(
        name = "add",
        help = "Add one or more packages to the global store without linking them into any project.",
        long_help = "Add one or more packages to the global store without linking them\ninto any project.\n\nEach argument is a package spec: `lodash`, `lodash@4.17.21`,\n`react@next`, or `express@^4`."
    )]
    Add(Box<StoreAddArgs>),
    /// Show the store path.
    #[usage(name = "path")]
    Path(Box<StorePathArgs>),
    /// Remove unreferenced packages from the global store.
    #[usage(name = "prune")]
    Prune(Box<StorePruneArgs>),
    /// Verify the store against cached package indexes.
    #[usage(name = "status")]
    Status(Box<StoreStatusArgs>),
}

/// Run the `test` script (shortcut for `run test`)
#[derive(Args)]
pub struct TestArgs {
    /// Skip auto-install check
    #[usage(long = "no-install")]
    pub no_install: bool,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Arguments to pass to the script
    #[usage(arg, name = "ARGS", double_dash = "automatic")]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Manage registry auth tokens (not implemented — use `npm token`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct TokenArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "ARGS",
        help = "Unused; captured so `aube <cmd> foo bar` parses instead of erroring on unexpected args before the fallback message prints.",
        long_help = "Unused; captured so `aube <cmd> foo bar` parses instead of\nerroring on unexpected args before the fallback message prints.",
        hide,
        double_dash = "automatic"
    )]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Check one package version for a publishing-trust downgrade
#[derive(Args)]
#[usage(
    after_long_help = "Examples:\n\n  $ aube trust check @hono/node-server@1.19.17\n  @hono/node-server@1.19.17: pass\n  published: 2026-07-27T03:07:48.993Z\n  current evidence: trusted publisher\n  strongest earlier evidence: trusted publisher (2.0.10)\n\n  # Evaluate the underlying policy even when aube has a built-in exception\n  $ aube trust check @hono/node-server@1.19.15 --ignore-default-excludes\n\n  # Machine-readable report\n  $ aube trust check @hono/node-server@1.19.17 --json\n",
    effect = "read"
)]
pub struct TrustCheckArgs {
    /// Evaluate the policy without aube's built-in package exceptions
    #[usage(long = "ignore-default-excludes")]
    pub ignore_default_excludes: bool,
    /// Emit a JSON report
    #[usage(long = "json")]
    pub json: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Exact npm package version to inspect
    ///
    /// Example: `@hono/node-server@1.19.17`.
    #[usage(arg, name = "PACKAGE@VERSION")]
    pub package_version: ::std::string::String,
}

/// Inspect npm package publishing trust
#[derive(Args)]
#[usage(effect = "read")]
pub struct TrustArgs {
    #[usage(subcommand)]
    pub command: TrustCommands,
}

#[derive(Subcommands)]
pub enum TrustCommands {
    /// Check one package version for a publishing-trust downgrade
    #[usage(name = "check")]
    Check(Box<TrustCheckArgs>),
}

/// Clear an existing deprecation on the registry
#[derive(Args)]
#[usage(effect = "write")]
pub struct UndeprecateArgs {
    /// Don't PUT anything — print which versions would be touched and exit.
    #[usage(long = "dry-run")]
    pub dry_run: bool,
    /// One-time password from a 2FA authenticator; sent as `npm-otp`.
    #[usage(long = "otp", value_name = "CODE")]
    pub otp: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Package spec: `name`, `name@version`, or `name@<range>`.
    ///
    /// Omitting the version clears the deprecation on every published version.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
}

/// Unlink a package (remove linked entries from node_modules)
#[derive(Args)]
#[usage(effect = "write")]
pub struct UnlinkArgs {
    #[usage(
        help = "Operate on the global link registry instead of the current project.",
        long_help = "Operate on the global link registry instead of the current\nproject.\n\n`aube unlink -g` removes the current package's entry from\n`$XDG_CACHE_HOME/aube/global-links`, `$HOME/.cache/aube/global-links`\nwhen `XDG_CACHE_HOME` is unset, or `%LOCALAPPDATA%\\aube\\global-links`\non Windows; `aube unlink -g <name>` removes the named entry.",
        long = "global",
        short = 'g'
    )]
    pub global: bool,
    /// Package name to unlink (omit to unlink all linked dependencies)
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::option::Option<::std::string::String>,
}

/// Remove a package (or a single version) from the registry
#[derive(Args)]
#[usage(effect = "destructive")]
pub struct UnpublishArgs {
    /// Don't talk to the registry; print what the command would do.
    #[usage(long = "dry-run")]
    pub dry_run: bool,
    /// Required for whole-package unpublish (no `@version` in the spec).
    ///
    /// Single-version unpublish works without it — matching npm, which is more permissive about dropping one version than nuking every version in one call.
    #[usage(long = "force", short = 'f')]
    pub force: bool,
    /// One-time password for registries that require 2FA.
    ///
    /// Sent verbatim as the `npm-otp` header.
    #[usage(long = "otp", value_name = "CODE")]
    pub otp: ::std::option::Option<::std::string::String>,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "SPEC",
        help = "Package spec: `name`, `name@version`, or omitted to use the current project's `package.json`.",
        long_help = "Package spec: `name`, `name@version`, or omitted to use the\ncurrent project's `package.json`."
    )]
    pub spec: ::std::option::Option<::std::string::String>,
}

/// Update dependencies
#[derive(Args)]
#[usage(effect = "write")]
pub struct UpdateArgs {
    /// Update only devDependencies.
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    #[usage(
        help = "Pin manifest specifiers to the resolved version with no range prefix.",
        long_help = "Pin manifest specifiers to the resolved version with no range\nprefix.\n\nPair with `--latest`: when the rewritten specifier replaces the\ncaret/tilde original, drop the prefix so the manifest carries an\nexact pin (`\"1.2.3\"`) instead of `\"^1.2.3\"`. Mirrors\n`pnpm update --save-exact`.",
        long = "exact",
        long = "save-exact",
        short = 'E'
    )]
    pub exact: bool,
    /// Update globally installed packages.
    ///
    /// Parsed for pnpm compatibility.
    #[usage(long = "global", short = 'g')]
    pub global: bool,
    /// Interactive update picker.
    ///
    /// Parsed for pnpm compatibility.
    #[usage(long = "interactive", short = 'i')]
    pub interactive: bool,
    /// Update past the manifest range unless paired with `--no-save`.
    ///
    /// Rewrites `package.json` specifiers to match the newly resolved versions (the registry's `latest` dist-tag, clamped by `minimumReleaseAge` / `resolution-mode` as usual). With `--no-save`, leaves the manifest range unchanged and resolves only to the newest version that range allows.
    #[usage(long = "latest", short = 'L')]
    pub latest: bool,
    /// Update only production dependencies.
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// Update dependencies in the current workspace package.
    #[usage(long = "workspace", short = 'w')]
    pub workspace: bool,
    /// Dependency traversal depth.
    ///
    /// Parsed for pnpm compatibility but ignored: aube only ever refreshes direct deps (pnpm's `--depth 0` default). Setting the flag emits a one-line warning pointing at `rm aube-lock.yaml && aube install` for the `--depth Infinity` case.
    #[usage(long = "depth", value_name = "DEPTH")]
    pub depth: ::std::option::Option<::std::string::String>,
    /// Add a global pnpmfile that runs before the local one.
    ///
    /// Mirrors pnpm's `--global-pnpmfile <path>`. The global hook runs first and the local hook (if any) runs second.
    #[usage(
        long = "global-pnpmfile",
        conflicts = "--ignore-pnpmfile",
        value_name = "PATH"
    )]
    pub global_pnpmfile: ::std::option::Option<::std::string::String>,
    /// Skip running `.pnpmfile.mjs` / `.pnpmfile.cjs` hooks for this update.
    #[usage(long = "ignore-pnpmfile")]
    pub ignore_pnpmfile: bool,
    /// Skip lifecycle scripts.
    ///
    /// Skips the root `pnpm:devPreinstall` hook and all approved dependency build scripts in the chained install.
    #[usage(long = "ignore-scripts", hide)]
    pub ignore_scripts: bool,
    /// Refresh the lockfile without populating `node_modules`.
    ///
    /// Re-resolves the full graph (direct + transitive) and writes `aube-lock.yaml`, then skips the linker so `node_modules` is left untouched. Mirrors `npm update --package-lock-only`.
    #[usage(long = "lockfile-only")]
    pub lockfile_only: bool,
    /// Skip optionalDependencies.
    #[usage(long = "no-optional")]
    pub no_optional: bool,
    /// Refresh the lockfile without rewriting `package.json` ranges.
    ///
    /// Pair with `--latest` to refresh the lockfile to the newest version allowed by the unchanged manifest range. Without `--latest`, it still suppresses manifest range rewrites enabled by `updateRewritesSpecifier`. Mirrors `pnpm update --no-save`.
    #[usage(long = "no-save")]
    pub no_save: bool,
    /// Override the local pnpmfile location.
    ///
    /// Mirrors pnpm's `--pnpmfile <path>`. Relative paths resolve against the project root; absolute paths are used as-is. Wins over `pnpmfilePath` from `pnpm-workspace.yaml`.
    #[usage(
        long = "pnpmfile",
        conflicts = "--ignore-pnpmfile",
        value_name = "PATH"
    )]
    pub pnpmfile: ::std::option::Option<::std::string::String>,
    /// Error if the lockfile drifts from package.json.
    #[usage(
        long = "frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--no-frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub frozen_lockfile: bool,
    /// Always re-resolve, even if the lockfile is up to date.
    #[usage(
        long = "no-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--prefer-frozen-lockfile")
    )]
    pub no_frozen_lockfile: bool,
    /// Use the lockfile when fresh, re-resolve when stale.
    #[usage(
        long = "prefer-frozen-lockfile",
        help_heading = "Lockfile",
        conflicts("--frozen-lockfile", "--no-frozen-lockfile")
    )]
    pub prefer_frozen_lockfile: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Force the shared global virtual store off for this invocation.
    ///
    /// Packages are materialized inside the project's virtual store instead of symlinked from `~/.cache/aube/virtual-store/`.
    #[usage(
        long = "disable-global-virtual-store",
        long = "disable-gvs",
        help_heading = "Virtual store",
        conflicts = "--enable-global-virtual-store"
    )]
    pub disable_global_virtual_store: bool,
    /// Force the shared global virtual store on for this invocation.
    ///
    /// Overrides CI's default per-project materialization and the `disableGlobalVirtualStoreForPackages` auto-disable heuristic.
    #[usage(
        long = "enable-global-virtual-store",
        long = "enable-gvs",
        help_heading = "Virtual store",
        conflicts = "--disable-global-virtual-store"
    )]
    pub enable_global_virtual_store: bool,
    /// Package(s) to update (all if empty)
    #[usage(arg, name = "PACKAGES")]
    pub packages: ::std::vec::Vec<::std::string::String>,
}

/// Bump the version in package.json (and optionally create a git commit + tag)
#[derive(Args)]
#[usage(effect = "write")]
pub struct VersionArgs {
    /// Allow setting the version to its current value without erroring.
    #[usage(long = "allow-same-version")]
    pub allow_same_version: bool,
    /// Skip `preversion` / `version` / `postversion` lifecycle scripts.
    #[usage(long = "ignore-scripts")]
    pub ignore_scripts: bool,
    /// Emit the result as JSON instead of `v<version>` text.
    #[usage(long = "json")]
    pub json: bool,
    /// Commit message template.
    ///
    /// `%s` is replaced with the new version. Defaults to `v%s`.
    #[usage(long = "message", short = 'm', value_name = "MSG")]
    pub message: ::std::option::Option<::std::string::String>,
    /// Skip git pre-commit / commit-msg hooks (passes `--no-verify`).
    #[usage(long = "no-commit-hooks")]
    pub no_commit_hooks: bool,
    /// Don't create a git commit or tag.
    ///
    /// By default `aube version` commits the manifest change and tags it `v<version>`.
    #[usage(long = "no-git-tag-version")]
    pub no_git_tag_version: bool,
    /// Prerelease identifier to use with the `pre*` keywords (e.g. `rc`).
    #[usage(long = "preid", value_name = "ID")]
    pub preid: ::std::option::Option<::std::string::String>,
    /// GPG-sign the created tag (`git tag -s`).
    #[usage(long = "sign-git-tag")]
    pub sign_git_tag: bool,
    /// Bump keyword or an explicit version string.
    ///
    /// Accepts `major`, `minor`, `patch`, `premajor`, `preminor`, `prepatch`, `prerelease`, `from-git`, or an explicit version. `from-git` reads the nearest reachable version-like Git tag. When omitted, prints the current version.
    #[usage(arg, name = "NEW_VERSION")]
    pub new_version: ::std::option::Option<::std::string::String>,
}

/// Print package metadata from the registry
#[derive(Args)]
#[usage(
    after_long_help = "Examples:\n\n  $ aube view\n  my-package@1.0.0 | MIT | deps: 0 | versions: 1\n\n  $ aube view react\n  react@18.3.1 | MIT | deps: 1 | versions: 2037\n  React is a JavaScript library for building user interfaces.\n  https://react.dev/\n\n  keywords: react\n\n  dist\n  .tarball: https://registry.npmjs.org/react/-/react-18.3.1.tgz\n  .shasum:  a0b2eb79...\n  .integrity: sha512-...\n\n  # A specific version\n  $ aube view react@17.0.2\n\n  # A single field\n  $ aube view react version\n  18.3.1\n\n  $ aube view react dist.tarball\n  https://registry.npmjs.org/react/-/react-18.3.1.tgz\n\n  # All versions ever published\n  $ aube view react versions --json\n\n  # Raw JSON for the resolved version\n  $ aube view react@next --json\n",
    effect = "read"
)]
pub struct ViewArgs {
    /// Print the full JSON of the selected version instead of the summary.
    ///
    /// Mutually exclusive with `field`.
    #[usage(long = "json")]
    pub json: bool,
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    /// Package to view, optionally with a version or dist-tag.
    ///
    /// Examples: `lodash`, `lodash@4.17.21`, `react@next`, `express@^4`.
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::option::Option<::std::string::String>,
    /// Dotted path into the version metadata to print.
    ///
    /// Examples: `version`, `dependencies`, `dist.tarball`, `maintainers.0.name`. When omitted, prints a formatted summary.
    #[usage(arg, name = "FIELD")]
    pub field: ::std::option::Option<::std::string::String>,
}

/// Report the current registry user (not implemented — use `npm whoami`)
#[derive(Args)]
#[usage(effect = "read")]
pub struct WhoamiArgs {
    /// Number of retry attempts for failed registry fetches.
    ///
    /// Overrides `fetchRetries` / `fetch-retries` from `.npmrc` / `aube-workspace.yaml` when set. Pair with `--fetch-timeout` to fail fast in scripted test runs.
    #[usage(long = "fetch-retries", help_heading = "Network", value_name = "N")]
    pub fetch_retries: ::std::option::Option<::std::string::String>,
    /// Exponential backoff factor between retry attempts.
    ///
    /// Overrides `fetchRetryFactor` / `fetch-retry-factor` from `.npmrc` / `aube-workspace.yaml` when set. Integer-only — the underlying `FetchPolicy.retry_factor` is `u32`. Fractional values like `1.5` are rejected by the CLI parser.
    #[usage(
        long = "fetch-retry-factor",
        help_heading = "Network",
        value_name = "N"
    )]
    pub fetch_retry_factor: ::std::option::Option<::std::string::String>,
    /// Upper bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMaxtimeout` / `fetch-retry-maxtimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-maxtimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_maxtimeout: ::std::option::Option<::std::string::String>,
    /// Lower bound (ms) on the computed retry backoff.
    ///
    /// Overrides `fetchRetryMintimeout` / `fetch-retry-mintimeout` from `.npmrc` / `aube-workspace.yaml` when set.
    #[usage(
        long = "fetch-retry-mintimeout",
        help_heading = "Network",
        value_name = "MS"
    )]
    pub fetch_retry_mintimeout: ::std::option::Option<::std::string::String>,
    /// Per-request HTTP timeout in milliseconds.
    ///
    /// Overrides `fetchTimeout` / `fetch-timeout` from `.npmrc` / `aube-workspace.yaml` when set. Applied via `reqwest`'s `.timeout()` so it covers headers + body together.
    #[usage(long = "fetch-timeout", help_heading = "Network", value_name = "MS")]
    pub fetch_timeout: ::std::option::Option<::std::string::String>,
    /// Override the default registry URL for this invocation.
    ///
    /// Use this npm registry URL for package metadata, tarballs, audit requests, dist-tags, and registry writes.
    #[usage(long = "registry", help_heading = "Network", value_name = "URL")]
    pub registry: ::std::option::Option<::std::string::String>,
    #[usage(
        arg,
        name = "ARGS",
        help = "Unused; captured so `aube <cmd> foo bar` parses instead of erroring on unexpected args before the fallback message prints.",
        long_help = "Unused; captured so `aube <cmd> foo bar` parses instead of\nerroring on unexpected args before the fallback message prints.",
        hide,
        double_dash = "automatic"
    )]
    pub args: ::std::vec::Vec<::std::string::String>,
}

/// Print reverse dependency chains explaining why a package is installed
#[derive(Args)]
#[usage(
    after_long_help = "Examples:\n\n  $ aube why debug\n  my-app@1.0.0 /home/user/project\n\n  dependencies:\n  express 4.19.2\n  └── debug 2.6.9\n  body-parser 1.20.2\n  └── debug 2.6.9\n\n  # Only follow chains starting at a devDependency\n  $ aube why --dev typescript\n\n  # Include each node's store path\n  $ aube why --long debug\n\n  # Tab-separated, one chain per line (pipe-friendly)\n  $ aube why --parseable debug\n\n  # JSON: an array of chain objects\n  $ aube why --json debug\n",
    effect = "read"
)]
pub struct WhyArgs {
    /// Only follow chains that start at a devDependency
    #[usage(long = "dev", short = 'D', conflicts = "--prod")]
    pub dev: bool,
    /// Only follow chains that start at a production (or optional) dependency
    #[usage(long = "prod", long = "production", short = 'P', conflicts = "--dev")]
    pub prod: bool,
    /// Output as JSON — an array of chain objects
    #[usage(long = "json", conflicts = "--parseable")]
    pub json: bool,
    /// Append each node's `.aube/<dep_path>` store path to the tree output
    #[usage(long = "long")]
    pub long: bool,
    /// Tab-separated output: one line per chain, `importer\tdep_type\tname@ver\t...`
    #[usage(long = "parseable")]
    pub parseable: bool,
    /// Package name to search for (exact match against package names)
    #[usage(arg, name = "PACKAGE")]
    pub package: ::std::string::String,
}

/// A fast Node.js package manager
#[derive(Cli)]
#[usage(bin = "aube", name = "aube")]
pub struct Cli {
    /// Change to directory before running (like `make -C` or `mise --cd`)
    #[usage(
        long = "dir",
        long = "cd",
        long = "prefix",
        short = 'C',
        global,
        value_name = "DIR"
    )]
    pub dir: ::std::option::Option<::std::string::String>,
    /// Scope command execution to workspace packages matching PATTERN.
    ///
    /// Supports exact names (`my-pkg`), globs (`@scope/*`, `*-plugin`), paths (`./packages/api`), graph selectors (`pkg...`, `...pkg`), git-ref selectors (`[origin/main]`), and exclusions (`!pkg`). Repeatable; matches are OR-ed.
    ///
    /// Currently honored by `run`, `test`, `start`, `stop`, `restart`, `install`, `exec`, `list`, `publish`, `deploy`, `add`, `remove`, `update`, `why`, and implicit-script invocations.
    #[usage(long = "filter", short = 'F', global, value_name = "WORKSPACE", var)]
    pub filter: ::std::vec::Vec<::std::string::String>,
    /// Run the command across every workspace package.
    ///
    /// Equivalent to `--filter=*`; if `--filter` is also given, `--recursive` is a no-op and the explicit filter wins. Honored by the same commands as `--filter`.
    #[usage(long = "recursive", short = 'r', global)]
    pub recursive: bool,
    /// Enable verbose/debug logging (shortcut for `--loglevel debug`)
    #[usage(long = "verbose", short = 'v', global)]
    pub verbose: bool,
    /// Print version and check for updates.
    ///
    /// Manual flag so we can run the async update notifier alongside the version print — clap's auto `Action::Version` exits inside `parse_from`, before the tokio runtime is built.
    #[usage(long = "version", short = 'V', global)]
    pub version: bool,
    /// Group workspace command output after each package finishes.
    ///
    /// Accepted for pnpm compatibility; aube's workspace fanout is currently sequential, so output is already grouped.
    #[usage(long = "aggregate-output", global, hide, conflicts = "--stream")]
    pub aggregate_output: bool,
    /// Force colored output even when stderr is not a TTY.
    ///
    /// Overrides `NO_COLOR` / `CLICOLOR=0`. Mutually exclusive with `--no-color`.
    #[usage(long = "color", global, conflicts = "--no-color")]
    pub color: bool,
    #[usage(
        help = "Enable cold-install deep diagnostics. Modes:   summary  — sum_ms / mean / max / %wall table at end   trace    — summary + critical path + starvation + what-if + lifecycle   live     — like trace, plus print every span >= 100ms to stderr live   full     — like trace, plus write JSONL trace to a file (defaults to ./aube-diag.jsonl)",
        long_help = "Enable cold-install deep diagnostics. Modes:\n  summary  — sum_ms / mean / max / %wall table at end\n  trace    — summary + critical path + starvation + what-if + lifecycle\n  live     — like trace, plus print every span >= 100ms to stderr live\n  full     — like trace, plus write JSONL trace to a file (defaults to ./aube-diag.jsonl)\n\nQuick form: `--diag` with no value defaults to `trace`.\nOutput file path can be set via `--diag-file`. Threshold for live\nmode via `--diag-threshold-ms`.",
        long = "diag",
        global,
        value_optional,
        default_missing = "trace",
        value_name = "MODE"
    )]
    pub diag: ::std::option::Option<::std::string::String>,
    /// Path for `--diag full` JSONL trace (default: ./aube-diag.jsonl)
    #[usage(long = "diag-file", global, value_name = "PATH")]
    pub diag_file: ::std::option::Option<::std::string::String>,
    /// Live-mode threshold: only print spans whose duration is >= N ms (default 100).
    #[usage(long = "diag-threshold-ms", global, value_name = "MS")]
    pub diag_threshold_ms: ::std::option::Option<::std::string::String>,
    /// Error when a workspace selector matches no packages.
    ///
    /// Accepted globally; selected commands already fail on empty matches.
    #[usage(long = "fail-if-no-match", global)]
    pub fail_if_no_match: bool,
    /// Production-only variant of `--filter`.
    ///
    /// Same selector grammar as `--filter`, but graph walks (`pkg...`, `...pkg`) only follow `dependencies` / `optionalDependencies` / `peerDependencies` edges — `devDependencies` (and packages reachable solely through them) are skipped. Non-graph forms (exact name, glob, path, `[git-ref]`) behave identically to `--filter`. Repeatable; can be combined with `--filter`.
    #[usage(long = "filter-prod", global, value_name = "PATTERN", var)]
    pub filter_prod: ::std::vec::Vec<::std::string::String>,
    /// Ignore workspace discovery for commands that support workspace fanout.
    ///
    /// Parsed for pnpm compatibility.
    #[usage(long = "ignore-workspace", global, hide)]
    pub ignore_workspace: bool,
    /// Include the workspace root in recursive workspace operations.
    ///
    /// Parsed for pnpm compatibility.
    #[usage(long = "include-workspace-root", global, hide)]
    pub include_workspace_root: bool,
    /// Set the log level. Logs at or above this level are shown.
    #[usage(long = "loglevel", global, value_name = "LEVEL", value_enum)]
    pub loglevel: ::std::option::Option<LoglevelValue>,
    /// Disable colored output.
    ///
    /// Overrides `FORCE_COLOR` / `CLICOLOR_FORCE` and sets `NO_COLOR=1` so downstream libraries (miette, clx, child processes) all see the same choice.
    #[usage(long = "no-color", global)]
    pub no_color: bool,
    /// Output format: default, append-only, ndjson, silent.
    ///
    /// `default` renders the progress UI when stderr is a TTY; `append-only` disables the progress UI in favor of plain line-at-a-time logs; `ndjson` swaps the tracing fmt layer for the JSON formatter (one JSON object per log event on stderr) and is what tooling wrappers should consume; `silent` suppresses all non-error output (alias for `--loglevel silent`).
    #[usage(long = "reporter", global, value_name = "NAME", value_enum)]
    pub reporter: ::std::option::Option<ReporterValue>,
    /// Suppress all non-error output (alias for `--loglevel silent`)
    #[usage(long = "silent", global)]
    pub silent: bool,
    /// Stream workspace command output as each child process writes it.
    ///
    /// Accepted for pnpm compatibility; aube's workspace fanout is currently sequential.
    #[usage(long = "stream", global, hide, conflicts = "--aggregate-output")]
    pub stream: bool,
    /// Route lifecycle and workspace command output through stderr.
    ///
    /// Accepted for pnpm compatibility.
    #[usage(long = "use-stderr", global, hide)]
    pub use_stderr: bool,
    /// Prefer workspace packages when resolving dependencies.
    ///
    /// Parsed for pnpm compatibility; aube already resolves workspace packages when a workspace is present.
    #[usage(long = "workspace-packages", global, hide)]
    pub workspace_packages: bool,
    /// Run from the workspace root regardless of the current package.
    #[usage(long = "workspace-root", global)]
    pub workspace_root: bool,
    /// Automatically answer yes to prompts.
    ///
    /// Parsed for pnpm compatibility; aube does not currently prompt on these paths.
    #[usage(long = "yes", short = 'y', global, hide)]
    pub yes: bool,
    #[usage(subcommand)]
    pub command: ::std::option::Option<Commands>,
}

#[derive(ValueEnum)]
pub enum LoglevelValue {
    #[usage(name = "trace")]
    Trace,
    #[usage(name = "debug")]
    Debug,
    #[usage(name = "info")]
    Info,
    #[usage(name = "warn")]
    Warn,
    #[usage(name = "error")]
    Error,
    #[usage(name = "silent")]
    Silent,
}

#[derive(ValueEnum)]
pub enum ReporterValue {
    #[usage(name = "default")]
    Default,
    #[usage(name = "append-only")]
    AppendOnly,
    #[usage(name = "ndjson")]
    Ndjson,
    #[usage(name = "silent")]
    Silent,
}

#[derive(Subcommands)]
pub enum Commands {
    /// Bootstrap aube's cached node-gyp and print the executable path.
    #[usage(name = "__node-gyp-bootstrap", hide)]
    NodeGypBootstrap(Box<NodeGypBootstrapArgs>),
    /// Manage package access and visibility on the registry
    #[usage(name = "access")]
    Access(Box<AccessArgs>),
    /// Emit shell activation code for runtime tool shims
    #[usage(name = "activate")]
    Activate(Box<ActivateArgs>),
    /// Add a dependency
    #[usage(name = "add", alias = "a")]
    Add(Box<AddArgs>),
    /// Approve ignored dependency build scripts.
    #[usage(name = "approve-builds")]
    ApproveBuilds(Box<ApproveBuildsArgs>),
    /// Check installed packages against the registry advisory DB
    #[usage(name = "audit")]
    Audit(Box<AuditArgs>),
    /// Print the path to `node_modules/.bin`
    #[usage(name = "bin")]
    Bin(Box<BinArgs>),
    /// Open package bug tracker URLs
    #[usage(name = "bugs", alias = "issues")]
    Bugs(Box<BugsArgs>),
    /// Inspect and manage the packument metadata cache
    #[usage(name = "cache")]
    Cache(Box<CacheArgs>),
    /// Print a file from the global store by integrity or hex hash
    #[usage(name = "cat-file")]
    CatFile(Box<CatFileArgs>),
    /// Print the cached package index JSON for `<name>@<version>`
    #[usage(name = "cat-index")]
    CatIndex(Box<CatIndexArgs>),
    /// Verify installed packages can resolve their declared deps.
    #[usage(name = "check")]
    Check(Box<CheckArgs>),
    /// Clean install: delete node_modules, then install with frozen lockfile.
    #[usage(name = "ci", alias("clean-install", "ic", "install-clean"))]
    Ci(Box<CiArgs>),
    /// Remove `node_modules` across every workspace project.
    #[usage(name = "clean")]
    Clean(Box<CleanArgs>),
    /// Generate shell completions (bash, zsh, fish)
    #[usage(name = "completion")]
    Completion(Box<CompletionArgs>),
    /// Read and write settings in `.npmrc`
    #[usage(name = "config", alias = "c")]
    Config(Box<ConfigArgs>),
    /// Scaffold a project from a `create-*` starter kit (via dlx)
    #[usage(name = "create")]
    Create(Box<CreateArgs>),
    /// Re-resolve the lockfile to collapse duplicate versions
    #[usage(name = "dedupe")]
    Dedupe(Box<DedupeArgs>),
    /// Deploy a workspace package into a target directory with deps inlined
    #[usage(name = "deploy")]
    Deploy(Box<DeployArgs>),
    /// Mark published versions of a package as deprecated on the registry
    #[usage(name = "deprecate")]
    Deprecate(Box<DeprecateArgs>),
    /// Report deprecated packages in the resolved dependency graph
    #[usage(name = "deprecations")]
    Deprecations(Box<DeprecationsArgs>),
    /// Diagnostic trace analysis (compare/analyze JSONL traces)
    #[usage(name = "diag")]
    Diag(Box<DiagArgs>),
    /// Manage package distribution tags on the registry
    #[usage(name = "dist-tag", alias = "dist-tags")]
    DistTag(Box<DistTagArgs>),
    /// Fetch a package into a throwaway environment and run its binary
    #[usage(name = "dlx")]
    Dlx(Box<DlxArgs>),
    /// Run broad install-health diagnostics
    #[usage(name = "doctor")]
    Doctor(Box<DoctorArgs>),
    /// Execute a locally installed binary
    #[usage(name = "exec", alias = "x")]
    Exec(Box<ExecArgs>),
    /// Download lockfile dependencies into the store without linking node_modules
    #[usage(name = "fetch")]
    Fetch(Box<FetchArgs>),
    /// List packages whose cached index references a given file hash
    #[usage(name = "find-hash")]
    FindHash(Box<FindHashArgs>),
    /// Alias for `config get` (hidden; prefer `config get`)
    #[usage(name = "get", hide)]
    Get(Box<GetArgs>),
    /// Print packages whose install scripts were skipped by `pnpm.allowBuilds`
    #[usage(name = "ignored-builds")]
    IgnoredBuilds(Box<IgnoredBuildsArgs>),
    /// Convert a supported lockfile into aube-lock.yaml
    #[usage(name = "import")]
    Import(Box<ImportArgs>),
    /// Create a `package.json` in the current directory
    #[usage(name = "init")]
    Init(Box<InitArgs>),
    /// Install all dependencies
    #[usage(name = "install", alias = "i")]
    Install(Box<InstallArgs>),
    /// Install dependencies, then run the `test` script (pnpm compat alias).
    #[usage(name = "install-test", hide, alias = "it")]
    InstallTest(Box<InstallTestArgs>),
    /// Alias for `list --long` (hidden; prefer `list --long`)
    #[usage(name = "la", hide)]
    La(Box<LaArgs>),
    /// Report the licenses of installed dependencies
    #[usage(name = "licenses")]
    Licenses(Box<LicensesArgs>),
    /// Link a local package globally, or into the current project
    #[usage(name = "link", alias = "ln")]
    Link(Box<LinkArgs>),
    /// Print the resolved dependency tree
    #[usage(name = "list", alias = "ls")]
    List(Box<ListArgs>),
    /// Alias for `list --long` (hidden; prefer `list --long`)
    #[usage(name = "ll", hide)]
    Ll(Box<LlArgs>),
    /// Store a registry auth token in the user's ~/.npmrc
    #[usage(name = "login", alias = "adduser")]
    Login(Box<LoginArgs>),
    /// Remove a registry auth token from the user's ~/.npmrc
    #[usage(name = "logout")]
    Logout(Box<LogoutArgs>),
    /// Run Node.js through aube's project runtime resolver
    #[usage(name = "node")]
    Node(Box<NodeArgs>),
    /// Report dependencies whose installed version lags behind the registry
    #[usage(name = "outdated")]
    Outdated(Box<OutdatedArgs>),
    /// Manage package owners (not implemented — use `npm owner`)
    #[usage(name = "owner", hide)]
    Owner(Box<OwnerArgs>),
    /// Create a publishable `.tgz` tarball from the current project
    #[usage(name = "pack")]
    Pack(Box<PackArgs>),
    /// Extract a package into an edit directory so it can be patched
    #[usage(name = "patch")]
    Patch(Box<PatchArgs>),
    /// Generate a `.patch` file from a `aube patch` edit directory
    #[usage(name = "patch-commit")]
    PatchCommit(Box<PatchCommitArgs>),
    /// Remove patch entries from `pnpm.patchedDependencies`
    #[usage(name = "patch-remove")]
    PatchRemove(Box<PatchRemoveArgs>),
    /// Inspect peer-dependency resolution from the lockfile
    #[usage(name = "peers")]
    Peers(Box<PeersArgs>),
    /// Manage package.json entries (not implemented — use `npm pkg`)
    #[usage(name = "pkg", hide)]
    Pkg(Box<PkgArgs>),
    /// Print the current package prefix directory
    #[usage(name = "prefix")]
    Prefix(Box<PrefixArgs>),
    /// Remove extraneous packages from project `node_modules`.
    #[usage(name = "prune")]
    Prune(Box<PruneArgs>),
    /// Publish the current package to the registry
    #[usage(name = "publish")]
    Publish(Box<PublishArgs>),
    /// Alias for `clean` — remove `node_modules` across every workspace project.
    #[usage(name = "purge")]
    Purge(Box<PurgeArgs>),
    /// Query packages in the resolved dependency graph
    #[usage(name = "query")]
    Query(Box<QueryArgs>),
    /// Re-run root lifecycle scripts and allowlisted dependency builds
    #[usage(
        name = "rebuild",
        help = "Re-run root lifecycle scripts and allowlisted dependency builds",
        long_help = "`aube rebuild [<pkg>...]` — without args, re-run the root package's\npreinstall hook, then install / postinstall work for dependency\npackages allowed by the active `allowBuilds` /\n`onlyBuiltDependencies` policy, then the root package's install /\npostinstall / prepare lifecycle hooks.\n\nWith one or more package names, run lifecycle scripts only for the\nnamed deps and skip the root hooks. Match is by graph `name`, which\nis the in-tree alias when one is configured (so `aube rebuild\nmy-alias` works for a manifest entry like\n`\"my-alias\": \"npm:real-pkg@1.0\"`, matching pnpm).\n\nUnlike the other lifecycle shortcuts, `rebuild` intentionally does not\nauto-install: `aube install` already runs these same four hooks after\nlinking, so triggering an install here would double-run every script\non a stale tree. Users who actually want a fresh install should run\n`aube install`.",
        alias = "rb"
    )]
    Rebuild(Box<RebuildArgs>),
    /// Run a supported command across workspace packages
    #[usage(name = "recursive", alias("multi", "m"))]
    Recursive(Box<RecursiveArgs>),
    /// Remove a dependency
    #[usage(name = "remove", alias("rm", "uninstall", "un", "uni"))]
    Remove(Box<RemoveArgs>),
    /// Restart a package (shortcut for `run restart`; falls back to `stop` + `start`)
    #[usage(name = "restart")]
    Restart(Box<RestartArgs>),
    /// Print the path to `node_modules`
    #[usage(name = "root")]
    Root(Box<RootArgs>),
    /// Run a script defined in package.json
    #[usage(name = "run", alias = "run-script")]
    Run(Box<RunArgs>),
    /// Manage the project's Node.js runtime (pin, install, inspect)
    #[usage(name = "runtime", alias = "rt")]
    Runtime(Box<RuntimeArgs>),
    /// Generate a Software Bill of Materials (CycloneDX or SPDX)
    #[usage(name = "sbom")]
    Sbom(Box<SbomArgs>),
    /// Search the registry for packages (not implemented — use `npm search`)
    #[usage(name = "search", hide)]
    Search(Box<SearchArgs>),
    /// Alias for `config set` (hidden; prefer `config set`)
    #[usage(name = "set", hide)]
    Set(Box<SetArgs>),
    /// Set a `package.json` script (not implemented — use `npm set-script`)
    #[usage(name = "set-script", hide)]
    SetScript(Box<SetScriptArgs>),
    /// Show the companies sponsoring aube and the jdx.dev open source tools
    #[usage(name = "sponsors")]
    Sponsors(Box<SponsorsArgs>),
    /// Stage packages for publishing (not implemented — use `npm stage`)
    #[usage(name = "stage")]
    Stage(Box<StageArgs>),
    /// Start a package (shortcut for `run start`)
    #[usage(name = "start")]
    Start(Box<StartArgs>),
    /// Stop a package (shortcut for `run stop`)
    #[usage(name = "stop")]
    Stop(Box<StopArgs>),
    /// Manage the global store
    #[usage(name = "store")]
    Store(Box<StoreArgs>),
    /// Run the `test` script (shortcut for `run test`)
    #[usage(name = "test", alias = "t")]
    Test(Box<TestArgs>),
    /// Manage registry auth tokens (not implemented — use `npm token`)
    #[usage(name = "token", hide)]
    Token(Box<TokenArgs>),
    /// Inspect npm package publishing trust
    #[usage(name = "trust")]
    Trust(Box<TrustArgs>),
    /// Clear an existing deprecation on the registry
    #[usage(name = "undeprecate")]
    Undeprecate(Box<UndeprecateArgs>),
    /// Unlink a package (remove linked entries from node_modules)
    #[usage(name = "unlink", alias = "dislink")]
    Unlink(Box<UnlinkArgs>),
    /// Remove a package (or a single version) from the registry
    #[usage(name = "unpublish")]
    Unpublish(Box<UnpublishArgs>),
    /// Update dependencies
    #[usage(name = "update", alias("up", "upgrade"))]
    Update(Box<UpdateArgs>),
    /// Bump the version in package.json (and optionally create a git commit + tag)
    #[usage(name = "version")]
    Version(Box<VersionArgs>),
    /// Print package metadata from the registry
    #[usage(name = "view", alias("info", "show", "v"))]
    View(Box<ViewArgs>),
    /// Report the current registry user (not implemented — use `npm whoami`)
    #[usage(name = "whoami", hide)]
    Whoami(Box<WhoamiArgs>),
    /// Print reverse dependency chains explaining why a package is installed
    #[usage(name = "why", alias = "w")]
    Why(Box<WhyArgs>),
}
