Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions packages/prime/src/prime_cli/commands/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,28 +224,33 @@ def push_image(
def list_images(
output: str = typer.Option("table", "--output", "-o", help="Output format (table or json)"),
all_images: bool = typer.Option(
Comment thread
kcoopermiller marked this conversation as resolved.
False, "--all", "-a", help="Show all accessible images (personal + team)"
False, "--all", "-a", help="[Deprecated] Show all accessible images (personal + team)"
),
):
"""
List all images you've pushed to Prime Intellect registry.

By default, shows images in the current context (personal or team).
Use --all to show all accessible images including team images.
Shows personal images by default, or team images when a team is configured.

\b
Examples:
prime images list
prime images list --all
prime images list --output json
"""
validate_output_format(output, console)

if all_images and output != "json":
console.print(
"[yellow]Warning: --all flag is deprecated and will be removed in a future release. "
"Images are now scoped to your current context (personal or team).[/yellow]"
)
console.print()
Comment thread
kcoopermiller marked this conversation as resolved.
try:
client = APIClient()

# Build query params
params = {}
if config.team_id and not all_images:
if config.team_id:
Comment thread
kcoopermiller marked this conversation as resolved.
params["teamId"] = config.team_id

response = client.request("GET", "/images", params=params if params else None)
Expand All @@ -261,11 +266,10 @@ def list_images(
return

# Table output
title = "Your Docker Images"
if config.team_id and not all_images:
if config.team_id:
title = f"Team Docker Images (team: {config.team_id})"
elif all_images:
title = "All Accessible Docker Images"
else:
title = "Personal Docker Images"

# Group images by (owner, imageName, imageTag) to deduplicate rows.
grouped: dict[str, list] = {}
Expand Down
Loading