Skip to content

feat(cli): add upgrade information on startup - #294

Merged
zwpaper merged 13 commits into
TabbyML:mainfrom
DESU-CLUB:feat/upgrade-on-startup
Sep 16, 2025
Merged

feat(cli): add upgrade information on startup#294
zwpaper merged 13 commits into
TabbyML:mainfrom
DESU-CLUB:feat/upgrade-on-startup

Conversation

@DESU-CLUB

@DESU-CLUB DESU-CLUB commented Sep 14, 2025

Copy link
Copy Markdown
Collaborator

Closes #277

Summary

  • Adds a startup routine that prints the current version and whether an update is available
  • Refactored internal logic for cmd.ts
    • checkForUpdates (packages/cli/upgrade/version-check.ts) and registerUpgradeCommand (packages/cli/upgrade/cmd.ts) now internally use returnVersionInfo, to de-duplicate potentially redundant code
  • Added program preAction hook that runs version-check before any command

How to run

Building from source (Github)

  • Fetch this pull request
  • Run bun install in the root folder
  • Run bun run build in packages/cli
  • Run ./dist/pochi -<command>: The upgrade information should be shown on display

Running using bun

  • Fetch this pull request
  • Run bun install in the root folder
  • Run bun run pochi -<command>: The upgrade information should be shown

Known Issues

  • The display feature does not show during pochi -V and pochi -h. This is as CommanderJS do not treat the help and version actions as commands and exits early.

TODO

  • Check with Tabby team if the upgrade display should show when pochi -V (show current version) and pochi -h (Show help) [Current implementation does not show when these commands are called]
  • Check with Tabby team if the console.log in upgrade command stating new version is redundant
  • Test on Windows and MacOS machines
  • Update documentation with note that now upgrade is displayed on startup (Doesn't seem like it belongs in docs, which talks about core features rather than UI changes)

Display Preview

image

Display Preview with prompt command

image

Display Preview with upgrade command

Comment thread packages/cli/src/upgrade/version-check.ts Outdated
@wsxiaoys
wsxiaoys requested a review from zwpaper September 15, 2025 00:57
@DESU-CLUB
DESU-CLUB marked this pull request as ready for review September 15, 2025 06:18
@DESU-CLUB
DESU-CLUB force-pushed the feat/upgrade-on-startup branch 2 times, most recently from 234c633 to d64718d Compare September 15, 2025 06:58

@zwpaper zwpaper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @DESU-CLUB , there are some UX comments and nits, please have a look and ping me if you have any questions

Comment thread packages/cli/src/upgrade/version-check.ts Outdated
Comment thread packages/cli/src/upgrade/version-check.ts
Comment thread packages/cli/src/upgrade/version-check.ts Outdated
Comment thread packages/cli/src/upgrade/cmd.ts
@zwpaper zwpaper changed the title Add upgrade information on startup feat(cli): add upgrade information on startup Sep 15, 2025
@DESU-CLUB

Copy link
Copy Markdown
Collaborator Author

@zwpaper Thank you for the feedback! Have resolved the nits, and left comments for clarifications on one of the comments!

@DESU-CLUB
DESU-CLUB requested a review from zwpaper September 16, 2025 02:16

@zwpaper zwpaper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @DESU-CLUB, one last nit, otherwise LGTM

Comment thread packages/cli/src/upgrade/cmd.ts
@DESU-CLUB
DESU-CLUB requested a review from zwpaper September 16, 2025 05:46
@zwpaper
zwpaper added this pull request to the merge queue Sep 16, 2025
Merged via the queue into TabbyML:main with commit 734d3da Sep 16, 2025
3 checks passed
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.

feat(cli): display upgrade information on startup

3 participants