Skip to content

fix(core): short, positive help text and one-line usage errors - #303

Merged
SakshiKoli-CS merged 2 commits into
v2-devfrom
CL-8909
Nov 23, 2026
Merged

SakshiKoli-CS merged 2 commits into
v2-devfrom
CL-8909

Conversation

@SakshiKoli-CS

Copy link
Copy Markdown
Contributor

Ticket: CL-8909

What

Help text:

  • csdx launch --help, launch:deployments --help, launch:logs --help and launch:functions --help open with one short topic line. Retired V1 commands are hidden from every listing, and no help screen says "Removed in v2" any more.
  • The projects TYPE column shows GitHub / FileUpload, the names --type takes.
  • logs:get names deployment, server and live logs, and has examples for --type live, --search and --cursor.
  • site:open and deployments:create get one-line summaries for topic listings.
  • --data-dir reads "Path to the project folder"; functions:serve reads "Serve cloud functions locally".

Usage errors are one line, exit 2, and point at --help, the only help form in V2:

User types Message
Any V1 command (launch, launch:open, …) Launch CLI v2 has new commands. Run csdx launch --help to see them.
Unknown command, e.g. launch:foo Run csdx launch --help to see all commands.
csdx help launch…, -h, bare help word For help, run csdx <command> --help.
Unknown flag or stray argument Run csdx <command> --help to see its flags.
Flag with no value --org needs a value.

How:

  • A new oclif init hook (src/hooks/init/usage.ts) answers help, -h and unknown launch ids before csdx's own help and "Did you mean" handling. It reacts only to ids that start with launch, so other csdx commands are unaffected.
  • failure.ts maps parser errors using the command id that each command now passes to failureOutputOf.

Not in scope:

  • Secrets commands keep their own argument messages.
  • Other parser errors (invalid option values) keep their current wording.
  • USAGE still reads $ csdx launch, because oclif always adds a space after the id.

Tests

  • New test/integration/usage-errors.test.ts covers every row above, checks that --help still works on the topic, a group and a command, and checks that a bare group name still shows its help.
  • src/hooks/init/usage.test.ts checks that non-launch commands are left to csdx.
  • failure.test.ts covers the parser-error mapping. retired-commands.test.ts and oclif-manifest.test.ts cover the help text and the single V1 message.
  • Existing assertions of the old wording are updated.
  • npm test: 201 suites / 4100 tests pass; npm run lint is clean.
  • Not yet checked inside an installed csdx (via csdx plugins:link); checked through bin/run.js and oclif's runCommand.

#claude_code#
🤖 Generated with Claude Code

Help text: the launch, deployments, logs and functions topics open with
one short line; retired V1 commands are hidden from every listing; the
projects TYPE column shows GitHub/FileUpload, the names --type takes;
logs:get names deployment, server and live logs and has examples for
--type live, --search and --cursor; site:open and deployments:create get
one-line summaries; --data-dir reads "Path to the project folder";
functions:serve reads "Serve cloud functions locally".

Usage errors are one line, exit 2, and point at --help, the only help
form in V2:
- any V1 command: "Launch CLI v2 has new commands. Run csdx launch
  --help to see them."
- unknown launch command: "Run csdx launch --help to see all commands."
- csdx help launch, -h, a bare help word: "For help, run csdx <id> --help."
- unknown flag or stray argument: "Run csdx <id> --help to see its flags."
- flag with no value: "--org needs a value."

An init hook (src/hooks/init/usage.ts) answers help, -h and unknown
launch ids before csdx's own help and not-found handling, and touches
only ids that start with launch. failure.ts maps parser errors using the
command id each command now passes in.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@SakshiKoli-CS
SakshiKoli-CS requested review from a team as code owners November 23, 2026 10:16
@snyk-io

snyk-io Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 2 25 ✅ Passed
🟡 Medium Severity 0 1 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@dhruv-parekh-cs dhruv-parekh-cs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the whole PR (a34d59f) against v2-dev: 3 low findings, inline. No other open PRs share CL-8909, so there is no cross-repo pass.

— 🤖 launch-pr-review-agent (Claude)


Generated by Claude Code

Comment thread src/projects/project.presenter.ts Resolved
Comment thread src/hooks/init/usage.ts Resolved
…ommands, colon space

- projects:list / projects:get TYPE shows GitProvider for every git
  project instead of GitHub. Projects made in the UI from an external git
  provider (Bitbucket Cloud) are GITPROVIDER too, and the API only says
  GitHub or ExternalGitProvider, so naming one provider would mislabel them.
- The init hook checks that a launch command or topic exists before
  answering -h, a bare help word or csdx help <id>. A mistyped id now gets
  "Run csdx launch --help to see all commands." in one step, instead of
  being sent to the --help of a command that doesn't exist.
- deployments:create description gets back the space after its colon.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@SakshiKoli-CS

Copy link
Copy Markdown
Contributor Author

/ship 2b summary: Fixed: TYPE label (GitProvider for every git project), mistyped ids with -h / help / csdx help now get 'Run csdx launch --help to see all commands.' in one step, and the space after the colon in deployments:create, all in 5430abe. Resolved: all 3 review threads. Left for human: none. General comments: the Snyk and security-scan reports passed and need no action. Next: the push may have voided the approval, so this needs re-approval to merge.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 2 25 ✅ Passed
🟡 Medium Severity 0 1 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@dhruv-parekh-cs dhruv-parekh-cs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review since a34d59f (5430abe): no issues found. The 3 lows from the earlier review (TYPE label for non-GitHub git projects, --help suggestion for mistyped commands, missing space after the colon in deployments:create) are all fixed at this head.

— 🤖 launch-pr-review-agent (Claude)


Generated by Claude Code

@SakshiKoli-CS
SakshiKoli-CS merged commit 2c558fb into v2-dev Nov 23, 2026
7 checks passed
@SakshiKoli-CS
SakshiKoli-CS deleted the CL-8909 branch November 23, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants