feat: support locally provided CLI binaries via binaryDestination#286
Open
feat: support locally provided CLI binaries via binaryDestination#286
Conversation
Reimplemented `binPath` to support three modes: - default data directory - absolute path to a pre-existing local CLI (when downloads are disabled) - and base directory with host-specific subdirectory (when downloads are enabled) This modes are controlled by the Binary directory setting now renamed to Binary destination and the enable downloads setting. - resolves #285
That tests the fallback configuration from binaryDestination to the deprecated binaryDirectory. In addition, the existing tests were updated as they now have to take into account that enableDownloads option affects the output of binPath API.
Windows needs special handling because we can't mock the exe binary as a bash script like we do on Linux/Mac. In addition, there were a couple of unix paths hardcoded in some of the tests.
code-asher
reviewed
Mar 25, 2026
src/main/kotlin/com/coder/toolbox/settings/ReadOnlyCoderSettings.kt
Outdated
Show resolved
Hide resolved
Windows needs special handling because we can't mock the exe binary as a bash script like we do on Linux/Mac. In addition, there were a couple of unix paths hardcoded in some of the tests.
binaryDestination can now take a path to an executable or a path to a download directory.
In order to reflect the new behavior regarding CLI resolution in general and the binary destination in particular.
Adds a chapter describing the behavior of binaryDestination, dataDir, enableDownloads, and enableBinaryDirFallback, and explains how these settings interact and work together.
Refactored some of the existing tests into a new battery with a bunch additional tests to cover the complex and intertwined way of working for binaryDestination, enableDownloads, dataDir and enableFallback settings in the way CLI is resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reimplemented
binPathto support three modes:This modes are controlled by the Binary directory setting now renamed to Binary destination and the enable downloads setting.