Skip to content

Upgrade commander to v14 and refresh CLI visuals#2859

Merged
Harjun751 merged 7 commits intoMarkBind:masterfrom
gerteck:enhanceCLI
Mar 16, 2026
Merged

Upgrade commander to v14 and refresh CLI visuals#2859
Harjun751 merged 7 commits intoMarkBind:masterfrom
gerteck:enhanceCLI

Conversation

@gerteck
Copy link
Member

@gerteck gerteck commented Mar 13, 2026

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:

  • Upgraded commander to v14 and restructured CLI option definitions to use new APIs (grouped commands/options, conflict declarations, hidden options)
  • Added chalk-based color styling to CLI help output (better UI colors)
  • Removed serve -d option from being displayed in help usage as suggested by @yihao03 as it is not user facing but internal to developers, and added developer guide documentation for markbind serve -d

Anything you'd like to highlight/discuss:

Quality of Life improvements

  • Now suggests the correct command if a user makes a typo (e.g., markbind s0rve).
gerteck@mac cli % markbind ser0v
  __  __                  _      ____    _               _ 
 |  \/  |   __ _   _ __  | | __ | __ )  (_)  _ __     __| |
 | |\/| |  / _` | | '__| | |/ / |  _ \  | | | '_ \   / _` |
 | |  | | | (_| | | |    |   <  | |_) | | | | | | | | (_| |
 |_|  |_|  \__,_| |_|    |_|\_\ |____/  |_| |_| |_|  \__,_|
                                                           
 v6.3.1
error: unknown command 'ser0v'
(Did you mean serve?)
(run "markbind --help" to list commands)
  • Nicer UI colors added to the CI:
image image

Added info box in DG

image

Testing instructions:

No regressions

Proposed commit message: (wrap lines at 72 characters)

Upgrade commander to v14 and refresh CLI visuals

Remove serve -d from user facing help
Update CLI colors


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

@gerteck gerteck requested a review from a team March 13, 2026 12:14
@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.90%. Comparing base (696595e) to head (c2f011c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2859   +/-   ##
=======================================
  Coverage   71.90%   71.90%           
=======================================
  Files         132      132           
  Lines        7362     7362           
  Branches     1638     1573   -65     
=======================================
  Hits         5294     5294           
  Misses       1967     1967           
  Partials      101      101           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Upgrades the commander dependency from v8 to v14 in the CLI package, leveraging new features like .conflicts(), .commandsGroup(), .optionsGroup(), .summary(), configureHelp styling, and command suggestion on typos. Also hides the -d dev flag from help output and adds documentation for markbind serve -d.

Changes:

  • Upgraded commander to v14 and restructured CLI option definitions to use new APIs (grouped commands/options, conflict declarations, hidden options)
  • Added chalk-based color styling to CLI help output
  • Added developer guide documentation for markbind serve -d

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/cli/index.ts Restructured CLI definitions using commander v14 APIs, added help styling with chalk
packages/cli/src/cmd/serve.ts Removed runtime --force-reload/--one-page conflict check (now handled by commander)
packages/cli/package.json Bumped commander to v14, sorted devDependencies
package-lock.json Updated lockfile for commander v14
docs/devGuide/development/workflow.md Added info box documenting markbind serve -d

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

@Harjun751 Harjun751 left a comment

Choose a reason for hiding this comment

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

Code looks good to me. I ran this version in my terminal - it's quite a step up in visual clarity!

.addOption(
program.createOption('-f, --force-reload',
'force a full reload of all site files when a file is changed')
.conflicts('onePage'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice that they added an in-built mechanism to handle this.

@Harjun751 Harjun751 merged commit 40df5b7 into MarkBind:master Mar 16, 2026
18 of 20 checks passed
@github-actions github-actions bot added the r.Minor Version resolver: increment by 0.1.0 label Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r.Minor Version resolver: increment by 0.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants