Skip to content

feat(cli): expose new cluster SDK parameters#378

Merged
blainekasten merged 14 commits into
nextfrom
cursor/sdk-cli-parameter-changes-4420
May 22, 2026
Merged

feat(cli): expose new cluster SDK parameters#378
blainekasten merged 14 commits into
nextfrom
cursor/sdk-cli-parameter-changes-4420

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 20, 2026

Summary

  • Expose newly generated beta cluster SDK parameters in CLI create/update/list commands
  • Add storage lifecycle/project filters and optional storage update size handling
  • Add remediation list order/page-size flags and focused CLI coverage

Testing

  • python3 -m ruff check src/together/lib/cli/api/beta/clusters/_json_params.py src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py src/together/lib/cli/api/beta/clusters/list.py src/together/lib/cli/api/beta/clusters/storage/create.py src/together/lib/cli/api/beta/clusters/storage/update.py src/together/lib/cli/api/beta/clusters/storage/list.py src/together/lib/cli/api/beta/clusters/remediations/list.py tests/cli/test_beta_clusters.py
  • python3 -m pytest tests/cli/test_beta_clusters.py

Target base branch: next (do not retarget to main).

Requested reviewers: @blainekasten, stainless-app[bot] (incoming commit author).

cursoragent and others added 2 commits May 20, 2026 19:07
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
@blainekasten blainekasten changed the base branch from main to next May 20, 2026 19:09
@blainekasten blainekasten self-requested a review May 20, 2026 19:09
@blainekasten blainekasten marked this pull request as ready for review May 20, 2026 19:10
response = await show_loading_status(
"Loading storage volumes...",
config.client.beta.clusters.storage.list(project_id=project_id or omit),
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent omit these changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look!

Open in Web Open in Cursor 

cluster_id=cluster_id,
mode=safe_modes or omit,
order_by=order_by or omit,
page_size=page_size if page_size is not None else omit,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent omit these changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look!

Open in Web Open in Cursor 


async def list(
after: AfterParameter = None,
project_id: Annotated[Optional[str], Parameter(help="Project ID to filter clusters by")] = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent omit these changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look!

Open in Web Open in Cursor 

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Copy link
Copy Markdown
Contributor

@blainekasten blainekasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent let's not add add_ons and cluster_config to the cli yet. This needs more thought.

@cursor
Copy link
Copy Markdown
Contributor Author

cursor Bot commented May 21, 2026

Done.

  • Removed remediation list --order-by / --page-size SDK/CLI changes
  • Removed matching test args/assertions
  • Fully reverted remaining storage/list.py formatting diff too, so that earlier “omit” comment is satisfied
  • Pushed commit: c2b9b411 fix(cli): omit list parameter changes

Verified:

.venv/bin/python -m ruff check ...
.venv/bin/python -m pytest tests/cli/test_beta_clusters.py

Result: 27 passed

Open in Web Open in Cursor 

cursoragent and others added 5 commits May 21, 2026 17:47
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Comment on lines +94 to +97
shared_volume_name: SharedVolumeNameParameter = None,
shared_volume_region: SharedVolumeRegionParameter = None,
shared_volume_size_tib: SharedVolumeSizeTibParameter = None,
shared_volume_lifecycle_independent: SharedVolumeLifecycleIndependentParameter = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent Drop these parameters since the cli has a helper flow or users can attach the volume id for a previously created one

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look!

Open in Web Open in Cursor 

num_capacity_pool_gpus: NumCapacityPoolGpusParameter = None,
num_preemptible_gpus: NumPreemptibleGpusParameter = None,
num_reserved_gpus: NumReservedGpusParameter = None,
oidc_config: OidcConfigParameter = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent remove this for now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look!

Open in Web Open in Cursor 

gpu_type: GpuTypeParameter = None,
cluster_type: ClusterTypeParameter = None,
volume: VolumeParameter = None,
acceptance_tests_params: AcceptanceTestsParamsParameter = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent remove this for now

Copy link
Copy Markdown
Contributor Author

@cursor cursor Bot May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

  • Removed --shared-volume-name
  • Removed --shared-volume-region
  • Removed --shared-volume-size-tib
  • Removed --shared-volume-lifecycle-independent
  • Removed non-interactive inline shared_volume request mapping
  • Kept the interactive helper flow / existing --volume path
  • Pushed commit: 7b02fa7d fix(cli): drop inline shared volume create flags

Verified:

.venv/bin/python -m ruff check ...
.venv/bin/python -m ruff format --check src/together/lib/cli/api/beta/clusters/create.py tests/cli/test_beta_clusters.py
.venv/bin/pyright --pythonpath .venv/bin/python src/together/lib/cli/api/beta/clusters/_json_params.py src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py
.venv/bin/python -m pytest tests/cli/test_beta_clusters.py

Result: 26 passed

Open in Web Open in Cursor 

cursoragent and others added 3 commits May 21, 2026 20:41
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
is_lifecycle_independent = input(
"Clusters: Keep storage volume after cluster deletion? [y/N] "
).strip().lower() in ("y", "yes")
params["shared_volume"] = _shared_volume(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent I don't think we need this helper function. Seems like we can revert back to just instantiating a SharedVolume, right?

Copy link
Copy Markdown
Contributor Author

@cursor cursor Bot May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

  • Removed _shared_volume
  • Reverted interactive storage helper flow to direct SharedVolume(...)
  • Removed the extra lifecycle-independent prompt tied to that helper
  • Pushed commit: 2aa68755 fix(cli): inline cluster shared volume creation

Verified:

.venv/bin/python -m ruff check ...
.venv/bin/python -m ruff format --check src/together/lib/cli/api/beta/clusters/create.py tests/cli/test_beta_clusters.py
.venv/bin/pyright --pythonpath .venv/bin/python src/together/lib/cli/api/beta/clusters/_json_params.py src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py
.venv/bin/python -m pytest tests/cli/test_beta_clusters.py

Result: 26 passed

Open in Web Open in Cursor 

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
try:
return json.loads(value)
except json.JSONDecodeError as exc:
raise ValueError(f"{parameter_name} must be valid JSON") from exc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent I don't think anything in this file is still being used. Can you check and if it's not just remove this file?

Copy link
Copy Markdown
Contributor Author

@cursor cursor Bot May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

  • Confirmed _json_params.py had no remaining external references
  • Deleted src/together/lib/cli/api/beta/clusters/_json_params.py
  • Confirmed no _json_params, parse_json_object, or parse_json_array refs remain
  • Pushed commit: 0a2316ce fix(cli): remove unused JSON param helpers

Verified:

.venv/bin/python -m ruff check src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py src/together/lib/cli/api/beta/clusters/list.py src/together/lib/cli/api/beta/clusters/storage/create.py src/together/lib/cli/api/beta/clusters/storage/update.py src/together/lib/cli/api/beta/clusters/storage/list.py src/together/lib/cli/api/beta/clusters/remediations/list.py tests/cli/test_beta_clusters.py
.venv/bin/python -m ruff format --check src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py tests/cli/test_beta_clusters.py
.venv/bin/pyright --pythonpath .venv/bin/python src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py
.venv/bin/python -m pytest tests/cli/test_beta_clusters.py

Result: 26 passed

Open in Web Open in Cursor 

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
VolumeParameter = Annotated[Optional[str], Parameter(help="Storage volume ID to use for the cluster")]
AutoScaleParameter = Annotated[Optional[bool], Parameter(help="Enable cluster auto-scaling")]
AutoScaleMaxGpusParameter = Annotated[Optional[int], Parameter(help="Maximum GPUs for auto-scaling")]
AutoScaledParameter = Annotated[Optional[bool], Parameter(help="Enable workload-based GPU auto-scaling")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent This field was marked as deprecated. We shouldn't add it. Remove it

Copy link
Copy Markdown
Contributor Author

@cursor cursor Bot May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

  • Removed deprecated auto_scaled / --auto-scaled from cluster create
  • Removed its request mapping
  • Confirmed no auto_scaled diff remains
  • Pushed commit: 935060d9 fix(cli): omit deprecated auto-scaled flag

Verified:

.venv/bin/python -m ruff check ...
.venv/bin/python -m ruff format --check src/together/lib/cli/api/beta/clusters/create.py tests/cli/test_beta_clusters.py
.venv/bin/pyright --pythonpath .venv/bin/python src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py
.venv/bin/python -m pytest tests/cli/test_beta_clusters.py

Result: 26 passed

Open in Web Open in Cursor 

Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
@blainekasten blainekasten merged commit b694d8f into next May 22, 2026
9 checks passed
@stainless-app stainless-app Bot mentioned this pull request May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants