Merged
Conversation
6a949cb to
85b1559
Compare
Contributor
There was a problem hiding this comment.
5 issues found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/templates/utils.ts">
<violation number="1" location="src/commands/templates/utils.ts:33">
P2: Reject empty numeric fallbacks instead of coercing `count:number:` to `fallbackValue: 0`.</violation>
</file>
<file name="src/commands/templates/delete.ts">
<violation number="1" location="src/commands/templates/delete.ts:9">
P2: Deleting by alias produces incorrect `--json` output because the helper echoes the input string into the `id` field instead of the API response.</violation>
</file>
<file name="src/commands/templates/create.ts">
<violation number="1" location="src/commands/templates/create.ts:81">
P2: Reject `--html` with `--html-file` instead of silently preferring the file body.</violation>
</file>
<file name="src/commands/templates/update.ts">
<violation number="1" location="src/commands/templates/update.ts:25">
P2: The update command is missing `variables` support even though `templates.update` now accepts it, so the help text documents a limitation that is no longer true.</violation>
<violation number="2" location="src/commands/templates/update.ts:79">
P1: Truthy checks here prevent supported empty-string updates from ever reaching `templates.update`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| export const deleteTemplateCommand = new Command('delete') | ||
| .alias('rm') | ||
| .description('Delete a template') | ||
| .argument('<id>', 'Template ID or alias') |
Contributor
There was a problem hiding this comment.
P2: Deleting by alias produces incorrect --json output because the helper echoes the input string into the id field instead of the API response.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/templates/delete.ts, line 9:
<comment>Deleting by alias produces incorrect `--json` output because the helper echoes the input string into the `id` field instead of the API response.</comment>
<file context>
@@ -0,0 +1,48 @@
+export const deleteTemplateCommand = new Command('delete')
+ .alias('rm')
+ .description('Delete a template')
+ .argument('<id>', 'Template ID or alias')
+ .option(
+ '--yes',
</file context>
vcapretz
approved these changes
Mar 12, 2026
Contributor
There was a problem hiding this comment.
3 issues found across 4 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/templates/utils.ts">
<violation number="1" location="src/commands/templates/utils.ts:31">
P2: This now rejects valid empty-string fallbacks for `string` template variables. `--var NAME:string:` should still map to `fallbackValue: ''`; only empty numeric fallbacks need to be rejected.</violation>
</file>
<file name="src/commands/templates/update.ts">
<violation number="1" location="src/commands/templates/update.ts:71">
P2: Use the same null-check semantics in the `--html`/`--html-file` exclusivity guard; `--html ""` currently bypasses the conflict error.</violation>
</file>
<file name="src/commands/templates/create.ts">
<violation number="1" location="src/commands/templates/create.ts:79">
P2: Check option presence here rather than truthiness; `--html "" --html-file ...` currently bypasses the mutual-exclusion error.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Add full templates CRUD support with list, get, create, update, delete, publish, and duplicate subcommands. Create requires --html or --html-file (prompts interactively if missing), matching the SDK's requirement.
- Reject empty numeric fallbacks in --var parsing - Use API response for delete JSON output instead of manually constructed object - Reject --html + --html-file as mutually exclusive on create and update - Add --var support to update command - Use != null checks in update to allow clearing fields with empty strings
The runDelete action was outputting raw SDK responses which lack a
consistent shape. Now it synthesizes {object, id, deleted} so piped
and --json output matches the documented contract.
01beb0b to
a6d2b1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add full templates CRUD support with list, get, create, update, delete, publish, and duplicate subcommands. Create requires --html or --html-file (prompts interactively if missing), matching the SDK's requirement.