Skip to content

Commit e4617ee

Browse files
author
jzhu
committed
fix: Show Active Prompt instead of Import ID in show-live
Replace confusing 'Import ID' (random UUID) with 'Active Prompt' which shows the actual prompt name and ID that is currently synced to the file. Users can use 'cam prompt view <id>' to see details.
1 parent 4f3ef51 commit e4617ee

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

code_assistant_manager/cli/prompts_commands.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,20 @@ def show_live_prompt(
553553
)
554554

555555
file_path = get_prompt_file_path(app, lvl, lvl_project_dir)
556-
suggested_id = generate_prompt_id(f"{app}-{lvl}")
556+
# Show active prompt ID if one exists
557+
active_prompt = manager.get_active_prompt(app)
557558
typer.echo(f"\n{Colors.BOLD}Live prompt for {app}:{Colors.RESET}")
558559
typer.echo(f"{Colors.CYAN}Level:{Colors.RESET} {lvl}")
559560
typer.echo(f"{Colors.CYAN}File:{Colors.RESET} {file_path}")
560-
typer.echo(f"{Colors.CYAN}Import ID:{Colors.RESET} {suggested_id}\n")
561+
if active_prompt:
562+
typer.echo(
563+
f"{Colors.CYAN}Active Prompt:{Colors.RESET} {active_prompt.name} ({active_prompt.id})"
564+
)
565+
else:
566+
typer.echo(
567+
f"{Colors.CYAN}Active Prompt:{Colors.RESET} {Colors.YELLOW}(none){Colors.RESET}"
568+
)
569+
typer.echo()
561570

562571
if content:
563572
typer.echo(content)
@@ -575,12 +584,14 @@ def _show_copilot(manager: PromptManager, project_dir: Optional[Path]):
575584

576585
base_dir = project_dir or Path.cwd()
577586
file_path = base_dir / ".github" / "copilot-instructions.md"
578-
suggested_id = generate_prompt_id("copilot-repo")
579587

580588
typer.echo(f"\n{Colors.BOLD}Live prompt for copilot:{Colors.RESET}")
581589
typer.echo(f"{Colors.CYAN}Level:{Colors.RESET} project")
582590
typer.echo(f"{Colors.CYAN}File:{Colors.RESET} {file_path}")
583-
typer.echo(f"{Colors.CYAN}Import ID:{Colors.RESET} {suggested_id}\n")
591+
typer.echo(
592+
f"{Colors.CYAN}Active Prompt:{Colors.RESET} {Colors.YELLOW}(use import-live to import){Colors.RESET}"
593+
)
594+
typer.echo()
584595

585596
if content:
586597
typer.echo(content)

0 commit comments

Comments
 (0)