INNER CODE UNIT · Python
show_prompts
stacklok/codegate · src/codegate/cli.py:117
def show_prompts(prompts: Optional[Path]) -> None:
"""Display prompts from the specified file or default if no file specified."""
try:
cfg = Config.load(prompts_path=prompts)
click.echo("Loaded prompts:")
click.echo("-" * 40)
for name, content in cfg.prompts.prompts.items():
click.echo(f"\n{name}:")
click.echo(f"{content}")
click.echo("-" * 40)
except ConfigurationError as e:
click.echo(f"Configuration error: {e}", err=True)
sys.exit(1)
except Exception as e:
click.echo(f"Error: {e}", err=True)
sys.exit(1)