feat(devgen/cli): add config info command and improve undo commit message formatting

This commit is contained in:
sankalp committed 2025-12-25 00:04:48 +05:45
1 parent 286c46d2b5
commit cfa891dcde
2 files changed
+30 -1

No files matched your search

+3 -1
View File
@@ -115,6 +115,8 @@ def undo_commit() -> None:
).ask():
try:
run_git_command(["git", "reset", "--soft", "HEAD~1"])
typer.secho("Last commit undone. Changes are still staged.", fg=typer.colors.GREEN)
typer.secho(
"Last commit undone. Changes are still staged.", fg=typer.colors.GREEN
)
except Exception as e:
typer.secho(f"Failed to undo commit: {e}", fg=typer.colors.RED)
+27
View File
@@ -167,3 +167,30 @@ def set_config() -> None:
_save_config(config)
typer.secho("\nConfiguration saved.", fg=typer.colors.GREEN)
typer.echo(yaml.dump(new_config, default_flow_style=False))
@app.command("info")
def config_info() -> None:
"""Show information about configuration options and templates."""
from rich.console import Console
from rich.table import Table
console = Console()
table = Table(title="Custom Template Variables", box=None)
table.add_column("Variable", style="cyan")
table.add_column("Description", style="white")
table.add_row("{{ group_name }}", "The folder name being committed (or 'root').")
table.add_row("{{ diff_text }}", "The git diff of the changes.")
table.add_row("{{ context }}", "Project context (manifest files content).")
console.print(table)
console.print(
"\n[bold]Tip:[/bold] If you hardcode emojis in your template, the AI will likely include them regardless of the 'emoji' setting.",
style="yellow",
)
console.print("\n[bold]Example Template:[/bold]")
console.print(
"custom_template: |\n [type]: [desc]\n \n Diff: {{ diff_text }}\n",
style="dim",
)