Skip to content

feat(cli): implement a tip system for CLI commands to enhance user experience#583

Merged
hyf0 merged 1 commit intomainfrom
hyf_tip
Feb 21, 2026
Merged

feat(cli): implement a tip system for CLI commands to enhance user experience#583
hyf0 merged 1 commit intomainfrom
hyf_tip

Conversation

@hyf0
Copy link
Copy Markdown
Contributor

@hyf0 hyf0 commented Feb 10, 2026

  • stateless per 5 minutes display for any tip
image image

Closes #546

Copilot AI review requested due to automatic review settings February 10, 2026 08:14
Copy link
Copy Markdown
Contributor

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

Introduces a new Rust crate (vite_global_cli_tips) and wires it into the vp CLI to display occasional, contextual “Tip:” messages (rate-limited) to help users discover commands and aliases.

Changes:

  • Added a new vite_global_cli_tips crate with a tip registry, matching logic, and a time-based display gate.
  • Updated vite_global_cli to use a fallible clap parsing path and to print tips after execution (and on parse errors).
  • Documented the design in rfcs/cli-tips.md and stabilized snapshot tests by disabling tips in CLI test mode.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
rfcs/cli-tips.md RFC documenting the CLI tips system and how to add tips
packages/tools/src/snap-test.ts Ensures tips are disabled during snapshot tests via env var
crates/vite_global_cli_tips/src/lib.rs Implements TipContext, Tip, and get_tip() selection + rate limiting
crates/vite_global_cli_tips/src/tips/mod.rs Registers available tips
crates/vite_global_cli_tips/src/tips/short_aliases.rs Adds a tip for discovering short aliases
crates/vite_global_cli_tips/src/tips/use_vpx_or_run.rs Adds (currently disabled) unknown-command guidance tip
crates/vite_global_cli_tips/Cargo.toml Declares the new crate
crates/vite_global_cli/src/main.rs Integrates tip printing and switches to fallible clap parsing
crates/vite_global_cli/src/cli.rs Introduces try_parse_args_from returning clap errors
crates/vite_global_cli/Cargo.toml Adds dependency on vite_global_cli_tips
Cargo.toml Adds vite_global_cli_tips to workspace dependencies
Cargo.lock Lockfile updates to include the new crate and dependency graph changes

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

Comment thread crates/vite_global_cli/src/main.rs Outdated
Comment thread crates/vite_global_cli/src/main.rs Outdated
Comment thread crates/vite_global_cli_tips/src/lib.rs Outdated
Comment thread crates/vite_global_cli/src/tips/short_aliases.rs
@hyf0 hyf0 marked this pull request as draft February 10, 2026 08:37
@hyf0 hyf0 force-pushed the hyf_tip branch 3 times, most recently from 5e5a6ae to 895fc1d Compare February 10, 2026 11:27
@hyf0 hyf0 marked this pull request as ready for review February 11, 2026 03:26
@hyf0 hyf0 requested review from cpojer and fengmk2 February 11, 2026 08:15
@cpojer
Copy link
Copy Markdown
Member

cpojer commented Feb 11, 2026

Can you make the tips gray?

@hyf0
Copy link
Copy Markdown
Contributor Author

hyf0 commented Feb 11, 2026

Can you make the tips gray?

Done. I think it's the issue of warp, it shows true black color for light mode. Terminal in vscode shows gray in light mode.

Comment thread crates/vite_global_cli/src/tips/use_vpx_or_run.rs
Comment thread crates/vite_global_cli/src/tips/short_aliases.rs Outdated
Comment thread crates/vite_global_cli/src/tips/use_vpx_or_run.rs Outdated
…perience

- Stateless per 5 minutes display for any tip
- Use gray color for tips output

Closes #546
@hyf0 hyf0 merged commit 2621113 into main Feb 21, 2026
16 checks passed
@hyf0 hyf0 deleted the hyf_tip branch February 21, 2026 03:22
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.

Tip mechanism for vp cli

3 participants