fix(flags): normalize short flag consistency across cli-cm-regex-validate, tsgen, migration, and apps-cli#261
Conversation
…date, tsgen, migration, and apps-cli
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
1fcb265
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
There was a problem hiding this comment.
Pull request overview
Normalizes short-flag usage across multiple Contentstack CLI plugins to match the v2 consistency rule (keep short flags only when the meaning is consistent across commands/plugins), removing or adding single-letter aliases to avoid semantic conflicts and ambiguity.
Changes:
- Removed command-specific/conflicting short flags (e.g.,
-afor--affix,-c/-f/-gin regex validate,-o/-p/-din tsgen) and updated in-code examples/tests accordingly. - Renamed
tsgenlong flag--token-alias→--aliaswhile keeping the universal-a. - Resolved
-kambiguity in migration by removingchar: 'k'from the deprecated hidden--api-key, and added missing universal-kto apps-cli install/reinstall stack API key flags.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/contentstack-migration/src/commands/cm/stacks/migration.ts | Removes -k from deprecated --api-key to eliminate collision with canonical --stack-api-key. |
| packages/contentstack-external-migrate/src/commands/migrate/convert.ts | Removes -a short flag from --affix to avoid conflict with universal -a (--alias). |
| packages/contentstack-cli-tsgen/tests/integration/tsgen.integration.test.ts | Updates integration tests to use long --output/--prefix instead of short forms. |
| packages/contentstack-cli-tsgen/src/commands/tsgen.ts | Renames --token-alias to --alias and removes short flags for command-specific options; updates examples accordingly. |
| packages/contentstack-cli-cm-regex-validate/src/commands/cm/stacks/validate-regex.ts | Removes command-specific short flags and updates examples to long-form options. |
| packages/contentstack-apps-cli/src/commands/app/reinstall.ts | Adds universal -k to --stack-api-key. |
| packages/contentstack-apps-cli/src/commands/app/install.ts | Adds universal -k to --stack-api-key. |
| packages/contentstack-apps-cli/src/commands/app/create.ts | Removes -n short flag from --name to avoid semantic conflict with stack-name usage elsewhere. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
What
Audits and normalizes single-character (
-x) short flags across all CLI plugins based on the v2 consistency rule:Universal short flags kept everywhere:
-a(--alias),-k(--stack-api-key),-y(--yes).Consistent cross-command short flags also kept:
-c(--config),-d(--data-dir),-n(--stack-name).Changes by Package
contentstack-cli-cm-regex-validate—src/commands/cm/stacks/validate-regex.ts--contentType-c--filePath-f--globalField-gExamples updated to use long flags.
contentstack-cli-tsgen—src/commands/tsgen.ts+ integration tests--output-o--prefix-p--doc-d--no-docstill works)--token-alias--alias-aconvention across all plugins. Breaking change acceptable in v2 major.Examples updated to use long flags. Integration tests updated — all 8 test cases replaced
-o→--output; test case 2 replaced-p→--prefix.--no-docwas already long-form.contentstack-migration—src/commands/cm/stacks/migration.tsRemoved
char: 'k'from the deprecated--api-keyflag only. The canonical--stack-api-keyretains-k.contentstack-apps-cli— multiple filesinstall.ts-kto--stack-api-key-kreinstall.ts-kto--stack-api-keycreate.ts-nfrom--name-neverywhere elsecontentstack-external-migrate—src/commands/migrate/convert.tsRemoved
char: 'a'from--affix. This flag used-ato mean "content-type UID prefix", directly conflicting with the universal-a=--aliasconvention.