发布

  • fix(nx-cloud): forward --help to nx-cloud aliases (#32627)

    frostbyte_neo 发布于 2025-09-05 13:28:35 +00:00

    Current Behavior

    --help behaviour is defined in the Nx alias entrypoints, and doesn't
    show the correct output:

    npx nx start-ci-run --help
    nx start-ci-run [options]
    
    Starts a new CI run for distributed task execution. This command is an alias for [`nx-cloud start-ci-run`](/ci/reference/nx-cloud-cli#npx-nxcloud-start-ci-run).
    
    Options:
      --help     Show help                                                                                                                                                                                                                   [boolean]
      --version  Show version number                                                                                                                                                                                                         [boolean]
      --verbose  Prints additional information about the commands (e.g., stack traces).   
    

    Expected Behavior

    When running npx nx start-ci-run --help the help from the file in the
    NxCloud repo should be displayed:

    npx nx start-ci-run --help
    Usage: npx nx-cloud start-ci-run [options]
    
    Starts an Nx Cloud CI Pipeline Execution and configures distribution.
    
    Options:
      --distribute-on <config>        Configure how to distribute with Nx Agents. Accepts:
                                      - "<count> <launchTemplate>" (e.g., "8 linux-medium-js")
                                      - path to a .yaml/.yml file for dynamic changesets
                                      - "manual" to disable the warning for legacy DTE setups
      --stop-agents-after <targets>   Comma-separated targets that signal agents can stop.
                                      Include configuration when needed, e.g., "build:locale-en".
      --require-explicit-completion   Require explicitly completing the CI run with
                                      "npx nx-cloud complete-ci-run".
      --stop-agents-on-failure        Stop all agents when a command fails (default: true).
      --with-env-vars <CSV>           Extra env vars to forward to agents in addition to NX_* (e.g., "VAR1,VAR2").
      --use-dte-by-default            Use this to disable auto-distribution of Nx tasks (default: true)
      --no-distribution               Disable distribution for this run
      --assignment-rules <file>       YAML file with assignment rules (for manual DTE only, see docs)
      --fix-tasks <csv>               Task names to auto fix
      --force                         Force start a CIPE even when a CI environment is not detected.
      --help, -h                      Show this help and exit.
    
    Notes:
      - Do not run this command locally. If run accidentally, clean up with "npx nx-cloud cleanup".
      - For legacy manual DTE setups, you can pass "--distribute-on=manual".
    
    Examples:
      npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js" --stop-agents-after=lint,test,build
      npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" --stop-agents-after=e2e
      npx nx-cloud start-ci-run --distribute-on="manual" --stop-agents-after=e2e
      npx nx affected -t lint,test,build
    
    Docs:
      https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
      https://nx.dev/ci/reference/assignment-rules
    

    Related Issue(s)

    Fixes #CLOUD-3580

    下载附件