Skip to content

Detect Devin Desktop's bundled CLI on macOS - #13

Merged
TheOnlyFusionCube merged 1 commit into
TheOnlyFusionCube:mainfrom
hessabi:feat/desktop-cli-lookup
Oct 23, 2026
Merged

TheOnlyFusionCube merged 1 commit into
TheOnlyFusionCube:mainfrom
hessabi:feat/desktop-cli-lookup

Conversation

@hessabi

@hessabi hessabi commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Proposal 8 in #4.

What was wrong: the plugin only looked for devin on PATH. Devin Desktop ships the CLI inside its app bundle without putting it on PATH, so on a Desktop-only Mac /devin:setup said "NOT FOUND" even though a working CLI was installed.

What changed

  • New resolveDevinBinary() in lib/devin.mjs, run once per process, in this order:
    1. DEVIN_COMPANION_DEVIN_BINARY, used exactly as given. A bad value is reported by setup, never silently replaced.
    2. devin on PATH, searched with fs rather than a shell. Behavior is unchanged when devin is on PATH.
    3. On macOS only, /Applications/Devin.app/Contents/Resources/app/extensions/windsurf/devin/bin/devin. It's resolved with realpath and must be an executable regular file.
  • Setup, auth status, session listing, print runs and the stop-review-gate hook all use the same resolved binary.
  • /devin:setup shows the binary path and where it came from (env, PATH, or Devin Desktop app bundle). The "not found" guidance now mentions Devin Desktop.
  • DEVIN_COMPANION_DESKTOP_BINARY_CANDIDATE replaces the app-bundle path so tests can simulate Devin Desktop on any OS. It's documented as test-only.
  • DEVIN_BINARY is no longer exported. Its only consumer, the companion, now calls getDevinBinary().
  • Updated README, AGENTS.md, llms.txt, and the setup command doc.

How tested

  • New tests/binary.test.mjs, 12 tests:
    • The env override beats both PATH and the bundle.
    • PATH beats the bundle, using two fake executables.
    • A Desktop-only install selects the bundle and uses its realpath.
    • The bundle is ignored off macOS.
    • Non-executable files and directories are skipped.
    • Nothing found returns null.
    • With PATH stripped of devin, a spawned process sees setup report the CLI as installed, and task invokes the bundled binary.
  • Full suite: 40/40, also with devin removed from PATH.
  • Checked on macOS with Devin Desktop installed and devin off PATH: setup selected the app-bundle CLI and reported it authenticated.

devin was only looked up on PATH, so machines with Devin Desktop but no
standalone CLI install reported the CLI as missing.

Resolve the binary once per process in this order: the
DEVIN_COMPANION_DEVIN_BINARY override, devin on PATH, then (macOS only)
the Devin Desktop app-bundle CLI, validated as an executable regular
file and resolved with realpath. Setup, auth, session listing, print
runs, and the stop-review-gate hook all use that one binary, and setup
reports its path and source.

@TheOnlyFusionCube TheOnlyFusionCube left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Verified macOS Desktop bundle detection and path precedence (40 passed). Clean implementation of Proposal 8.

@TheOnlyFusionCube
TheOnlyFusionCube merged commit b8737f6 into TheOnlyFusionCube:main Oct 23, 2026
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.

2 participants