From 007422f65c986468bab17a81524a66f03ddeb281 Mon Sep 17 00:00:00 2001 From: Daniel Tao Date: Wed, 20 May 2026 16:31:17 -0700 Subject: [PATCH 1/3] feat(nodes): add feature-flag-gated --enable-infiniband to `sf nodes create` Convert `create` to a `createCreateCommand({ enableInfiniband })` factory so the call site can thread in the result of the `infiniband-preview` feature-flag check. When the flag is enabled for the caller's account, the option is mounted on `sf nodes create` and forwards `_preview_enable_infiniband: true` to the nodes SDK. When the flag is disabled, the surface is unchanged. --- src/lib/nodes/create.ts | 734 +++++++++++++++++++++------------------- src/lib/nodes/index.ts | 9 +- src/lib/posthog.ts | 2 +- 3 files changed, 387 insertions(+), 358 deletions(-) diff --git a/src/lib/nodes/create.ts b/src/lib/nodes/create.ts index 73e2b55d..6c3ba6dd 100644 --- a/src/lib/nodes/create.ts +++ b/src/lib/nodes/create.ts @@ -68,149 +68,155 @@ function validateCount(val: string): number { return parsed; } -const create = new Command("create") - .description("Create reserved or auto reserved nodes") - .showHelpAfterError() - .argument( - "[names...]", - "[Required: names or --count] Names of the nodes to create (must be unique across your account)", - ) - .option( - "-n, --count ", - "[Required: names or --count] Number of nodes to create with auto-generated names", - validateCount, - ) - .addOption( - new Option( - "-z, --zone ", - "[Required: zone or --any-zone if --auto is provided] Zone for your nodes", - ).conflicts("any-zone"), - ) - .addOption( - new Option("--any-zone", "Use any zone that meets requirements").conflicts( - "zone", - ), - ) - .addOption(maxPriceOption) - .addOption( - new Option( - "--reserved", - "Create reserved nodes (default). Reserved nodes have an explicit start and end time.", - ).conflicts("auto"), - ) - .addOption( - new Option( - "--auto", - "Create auto-reserved nodes. Auto-reserved nodes self-extend until they are released.", - ).conflicts("reserved"), - ) - .addOption(startOrNowOption) - .addOption(endOption.conflicts("duration")) - .addOption(durationOption.conflicts("end")) - .option( - "-u, --user-data