Skip to content

Conversation

@JannikSt
Copy link
Member

@JannikSt JannikSt commented Jan 6, 2026

Summary

  • Adds prime env fork command to fork environments via CLI
  • Supports optional --team flag for team ownership

Usage

prime env fork owner/env-name
prime env fork owner/env-name --team my-team

Depends on platform PR #76 for the API endpoint.


Note

Adds a new CLI subcommand to fork environments from the hub.

  • New prime env fork command in env.py calls POST /environments/{owner/name}/fork
  • Supports optional --team/-t to assign team ownership (team_slug)
  • Handles success/error responses and prints next-step guidance (env pull, modify, env push)

Written by Cursor Bugbot for commit 5132005. This will update automatically on new commits. Configure here.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d27d667f9c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1105 to 1106
if team:
fork_data["team_id"] = team

Choose a reason for hiding this comment

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

P2 Badge Send team slug under correct request key

The --team flag is documented as a team slug, but this code places it in the team_id field. Elsewhere in this file (push) the slug is sent as team_slug and team_id is reserved for CUIDs from config, so passing a slug here will likely be rejected or mis-attributed by the API. This will make prime env fork --team my-team fail for team users unless they happen to supply a CUID. Consider sending team_slug or resolving the slug to an ID before populating team_id.

Useful? React with 👍 / 👎.

fork_data["team_slug"] = team

try:
response = client.post(f"/environments/{env_id}/fork", json=fork_data)
Copy link

Choose a reason for hiding this comment

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

Wrong API endpoint prefix breaks fork command

High Severity

The fork command uses /environments/{env_id}/fork as the API endpoint, but all other environment-related API calls in this file consistently use the /environmentshub/ prefix (e.g., /environmentshub/{env_id}/wheels, /environmentshub/resolve, /environmentshub/{env_id}). This inconsistency likely means the fork command will fail to reach the correct API endpoint.

Fix in Cursor Fix in Web

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