Skip to content
16 changes: 15 additions & 1 deletion packages/prime/src/prime_cli/commands/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def pull(
if target:
target_dir = Path(target)
else:
target_dir = Path.cwd() / f"{owner}-{name}-{version}"
Copy link
Member Author

Choose a reason for hiding this comment

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

This gives it more of a git-like feel, so I prime env pull will/wordle into the wordle dir for development

target_dir = Path.cwd() / name

try:
target_dir.mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -840,6 +840,20 @@ def pull(

console.print(f"[green]✓ Environment pulled to {target_dir}[/green]")

# Create .env-metadata.json for proper resolution
try:
metadata_path = target_dir / ".env-metadata.json"
env_metadata = {
"environment_id": details.get("id"),
"owner": owner,
"name": name,
}
with open(metadata_path, "w") as f:
json.dump(env_metadata, f, indent=2)
console.print(f"[dim]Created environment metadata at {metadata_path.name}[/dim]")
except Exception as e:
console.print(f"[yellow]Warning: Could not create metadata file: {e}[/yellow]")

try:
extracted_files = list(target_dir.iterdir())
if extracted_files:
Expand Down