feat: add hyprnote-cli and hyprnote-cli-tauri crates for CLI refactor #2703
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR separates CLI concerns into dedicated crates to improve modularity and fix a bug where
hyprnote updatedidn't work on first instance launch.New crates:
crates/hyprnote-cli: Tauri-independent CLI contract with command definitions, parsing,ExecModeenum, and early-exit command execution (bug, web, changelog)crates/hyprnote-cli-tauri: Tauri-dependent handlers for commands needing app runtime (update)Key architectural change: The desktop app now captures the CLI invocation early and executes runtime-dependent commands after the Tauri app is built. Previously, the
updatecommand returnedContinueWithoutWindowbut the actual update logic only ran in the single-instance callback, which never fires on first instance.Review & Testing Checklist for Human
hyprnote updateon first instance launch - This is the main bug fix. Verify the update check actually runs when no other instance is running.bugcommand now usesenv!("CARGO_PKG_VERSION")from thehyprnote-clicrate (0.1.0) instead of the desktop app version. This may need adjustment.hyprnote bug,hyprnote web,hyprnote changelogand verify they open the correct URLshyprnote updatefrom terminal and verify it worksRecommended test plan:
hyprnote updatewith no instance running - should check for updateshyprnote bug- should open GitHub issues pagehyprnote updateagain from terminalNotes
hyprnote doctorandhyprnote runLink to Devin run: https://app.devin.ai/sessions/a8ad4b7f25e24a23af00cb9aaa8c98ce
Requested by: yujonglee (@yujonglee)