Skip to content

Comments

Enable silent mode#3

Open
macguru wants to merge 2 commits intosonofagl1tch:mainfrom
macguru:feature/add-silent-mode
Open

Enable silent mode#3
macguru wants to merge 2 commits intosonofagl1tch:mainfrom
macguru:feature/add-silent-mode

Conversation

@macguru
Copy link

@macguru macguru commented Feb 16, 2026

Adds silent-mode=YES parameter and open -g flag to executeUlyssesCommand function to prevent Ulysses from opening sheets and moving to the foreground when commands are executed. This improves the user experience by keeping Ulysses in the state the user left it in and not switching focus.

Documentation for the silent flag can be found here.

Thanks for building this project in the first place!

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Warning

Rate limit exceeded

@macguru has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Adds an optional silent parameter to executeUlyssesCommand(action, params, silent = true). When silent is true the function injects silent-mode=YES and opens Ulysses in the background; callers that require visible behavior now pass silent = false.

Changes

Cohort / File(s) Summary
Command implementation & signature
src/index.ts
Adds silent: boolean = true parameter to executeUlyssesCommand, injects silent-mode=YES when silent is true, and uses open -g for background launches.
Call site updates
src/index.ts (multiple call sites)
Adjusts calls to executeUlyssesCommand to pass silent = false for non-silent actions (open, open-all, open-recent, open-favorites), preserving previous visible behavior for those flows.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🤫 A flag slipped in, polite and slight,
Background doors now close just right,
Callers choose when to make a sound,
Quiet by default, seen when found. 🔕

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title lacks conventional commit format prefix (e.g., 'feat:', 'fix:') required by the title check requirements. Revise title to follow conventional commit format, e.g., 'feat: enable silent mode' or 'feat: add silent mode parameter'.
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 70.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main
Critical Security Review ✅ Passed Silent-mode feature safely implemented with no security vulnerabilities. Command execution uses execFile with array args preventing injection, all user parameters are URL-encoded, and hardcoded silent values prevent manipulation.
Security Best Practices ✅ Passed Silent mode feature securely implemented with hardcoded parameters, proper URL encoding, and execFile() preventing injection.
Mcp Protocol Compliance ✅ Passed Pull request maintains full MCP protocol compliance with proper schema definitions, comprehensive input validation, appropriate error handling, and secure resource access controls.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/index.ts`:
- Around line 345-347: The unconditional params["silent-mode"] = "YES" disables
the intended behavior of open actions; change the logic that sets silent-mode so
it is omitted for the Ulysses actions that should reveal content (specifically
"open", "open-all", "open-recent", "open-favorites"): instead of always adding
params["silent-mode"] = "YES", only add it when the action name is not one of
those open* actions (or when the action does not startWith "open"), so open*
commands are sent without the silent-mode parameter.

Adds optional silent parameter to executeUlyssesCommand with two effects:
- silent-mode=YES: Prevents Ulysses from revealing the affected item in UI
- open -g flag: Prevents bringing Ulysses app to foreground

Navigation actions (open, open-all, etc.) explicitly disable silent mode
to reveal content as intended.

Co-authored-by: Cursor <cursoragent@cursor.com>
@macguru macguru force-pushed the feature/add-silent-mode branch from 7ee3a02 to 82ae747 Compare February 16, 2026 10:22
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/index.ts (2)

326-334: 🧹 Nitpick | 🔵 Trivial

JSDoc missing @param silent documentation.

The coding guidelines require complex functions to have JSDoc comments. The new silent parameter and the -g background behavior it controls are not documented.

Suggested fix
 /**
  * Executes a Ulysses x-callback-url command
  * Uses execFile to prevent command injection vulnerabilities
  * For callback actions, waits for Ulysses to respond with data
+ * `@param` action - The Ulysses x-callback-url action to execute
+ * `@param` params - Key-value parameters to include in the URL
+ * `@param` silent - When true, adds silent-mode=YES and opens Ulysses in background (-g flag). Defaults to true.
  */

As per coding guidelines: src/**/*.ts: "Document complex functions with JSDoc comments."


1032-1043: ⚠️ Potential issue | 🟠 Major

authorize should not use -g background flag — the user must see the authorization dialog.

The authorize action requires explicit user interaction (permission prompt). When silent=true (default), the code passes the -g flag to open, launching Ulysses in the background. This can hide the authorization dialog behind the current app, blocking the user from completing the flow.

Unlike open, open-all, etc., which are passive read operations, authorize needs the window in the foreground.

Suggested fix
-        const result = await executeUlyssesCommand("authorize", params);
+        const result = await executeUlyssesCommand("authorize", params, false);

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant