Feature: Add CLI list-templates Command Closes #31#62
Feature: Add CLI list-templates Command Closes #31#62IvantheGreatMaker wants to merge 2 commits into
Closes #31#62Conversation
Adds new Feature: Add CLI list-templates Command cloudengine-labs#31
chefgs
left a comment
There was a problem hiding this comment.
@IvantheGreatMaker
One suggestion is to add the new list command under the Quick Start Commands section in root README.md file.
# ── List templates ──────────────────────────────────────────────────────────
python -m cli.devopsos list # → Displays list of available templates
|
Hello @IvantheGreatMaker - Thank you for picking up the issue and raising a PR. Glad you have followed the PR template, which helped us to review the code quickly. Please address the review comment, I've added in the code. |
There was a problem hiding this comment.
Pull request overview
This PR adds a new top-level CLI command (python -m cli.devopsos list) that prints the available scaffold templates grouped by category, based on per-scaffold TEMPLATE_INFO metadata.
Changes:
- Added
TEMPLATE_INFOmetadata to scaffold modules so templates can be discovered and categorized. - Added
_collect_templates()and a newlistcommand incli/devopsos.pyto render grouped template output. - Added CLI tests to validate the new command and its presence in help output.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/devopsos.py | Adds template collection + new list command rendering grouped templates. |
| cli/test_cli.py | Adds tests for list command output and help presence. |
| cli/scaffold_gha.py | Adds TEMPLATE_INFO for the GitHub Actions scaffold. |
| cli/scaffold_gitlab.py | Adds TEMPLATE_INFO for the GitLab CI scaffold. |
| cli/scaffold_jenkins.py | Adds TEMPLATE_INFO for the Jenkins scaffold. |
| cli/scaffold_cicd.py | Adds TEMPLATE_INFO for the combined CI/CD scaffold. |
| cli/scaffold_argocd.py | Adds TEMPLATE_INFO for the GitOps scaffold. |
| cli/scaffold_sre.py | Adds TEMPLATE_INFO for the SRE scaffold. |
| cli/scaffold_unittest.py | Adds TEMPLATE_INFO for the unit test scaffold. |
| cli/scaffold_devcontainer.py | Adds TEMPLATE_INFO for the devcontainer scaffold. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for t in items: | ||
| name = t["name"].ljust(14) | ||
| desc = t["description"] | ||
| typer.echo(f" {name} {desc}") |
| result = _run_module("cli.devopsos", ["--help"]) | ||
| assert result.returncode == 0 | ||
| assert "list" in result.stdout |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Adds new Feature: Add CLI list-templates Command #31
Description
Add a new
listcommand to the CLI that displays all available scaffold templates organized by category. This enables users to discover available templates without consulting documentation.Related Issue
Closes #31
Type of Change
Changes Made
TEMPLATE_INFOdictionary to 8 scaffold modules for dynamic discovery_collect_templates()helper function indevopsos.py@app.command("list")command to display templates by categorylistcommandTesting Done
python -m pytest cli/test_cli.py mcp_server/test_server.py tests/test_comprehensive.py -v)python -m cli.devopsos listChecklist