Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Summary

This PR separates CLI concerns into dedicated crates to improve modularity and fix a bug where hyprnote update didn't work on first instance launch.

New crates:

  • crates/hyprnote-cli: Tauri-independent CLI contract with command definitions, parsing, ExecMode enum, 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 update command returned ContinueWithoutWindow but the actual update logic only ran in the single-instance callback, which never fires on first instance.

Review & Testing Checklist for Human

  • Test hyprnote update on first instance launch - This is the main bug fix. Verify the update check actually runs when no other instance is running.
  • Verify version label in bug reports - The bug command now uses env!("CARGO_PKG_VERSION") from the hyprnote-cli crate (0.1.0) instead of the desktop app version. This may need adjustment.
  • Test early-exit commands - Run hyprnote bug, hyprnote web, hyprnote changelog and verify they open the correct URLs
  • Test normal app startup - Verify the app starts normally without CLI args (should show main/onboarding window)
  • Test single-instance CLI handling - With app already running, run hyprnote update from terminal and verify it works

Recommended test plan:

  1. Build the desktop app locally
  2. Run hyprnote update with no instance running - should check for updates
  3. Run hyprnote bug - should open GitHub issues page
  4. Run the app normally - should show window
  5. With app running, run hyprnote update again from terminal

Notes

  • The dprint linter was timing out during development, so formatting was verified by reviewing file diffs
  • This is a structural refactor preparing for future CLI commands like hyprnote doctor and hyprnote run

Link to Devin run: https://app.devin.ai/sessions/a8ad4b7f25e24a23af00cb9aaa8c98ce
Requested by: yujonglee (@yujonglee)

This refactor separates CLI concerns into dedicated crates:

- crates/hyprnote-cli: CLI contract with command definitions, parsing, and
  early-exit command execution (bug, web, changelog). Independent of Tauri.

- crates/hyprnote-cli-tauri: Tauri-dependent handlers for commands that need
  app runtime (update). Fixes bug where 'hyprnote update' didn't work on
  first instance.

- plugins/cli2: Refactored to use new crates, keeping only installation logic
  and Tauri arg filtering.

- apps/desktop: Updated entrypoint to carry CLI invocation forward and execute
  runtime-dependent commands after app setup.

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 1, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit d9aa31e
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6955e0c6f98d0800081fb56d

@netlify
Copy link

netlify bot commented Jan 1, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit d9aa31e
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6955e0c6c549500008a09978

@netlify
Copy link

netlify bot commented Jan 1, 2026

Deploy Preview for howto-fix-macos-audio-selection canceled.

Name Link
🔨 Latest commit d9aa31e
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/6955e0c6b5b6be00082cd23b

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.

2 participants