Repository navigation
fix(keepassxc): retrieve keepassxc app location. - #22073
Conversation
- fix: find app no matter the location. - Initial commit
commented
Oct 9, 2025
|
Thank you for the update! 🎉 You can expect an initial review within five business days. |
commented
Oct 9, 2025
|
@Osmagtor, this update impacts Windows as well. Could you confirm it works on your side? I'll wait your validation before proceeding. |
| /** | ||
| * Find the installed KeePassXC application. | ||
| * | ||
| * @returns {Promise<void>} A promise that resolves nothing. | ||
| * | ||
| * This function uses the `getApplications` function from the `@raycast/api` library | ||
| * to get a list of all installed applications on the system. It then filters the list | ||
| * to only include applications with the name "KeePassXC". If the list is not empty, | ||
| * it sets the `keepassxcCli` class variable to the path of the found application. | ||
| * If the list is empty, it does nothing. | ||
| */ | ||
| static findApplication = async (): Promise<void> => { | ||
| const installedApplications = await getApplications(); | ||
| const apps = installedApplications.filter((application) => application.name == "KeePassXC"); | ||
| if (apps.length > 0) { | ||
| if (process.platform === "win32") { | ||
| const pathParts = apps[0].path.split("\\"); | ||
| this.keepassxcCli = pathParts.slice(0, -1).concat("keepassxc-cli.exe").join("\\"); | ||
| } else { | ||
| this.keepassxcCli = apps[0].path + "/Contents/MacOS/keepassxc-cli"; | ||
| } | ||
| } | ||
| }; | ||
|
|
There was a problem hiding this comment.
It fails to find the KeepassXC app on Windows. It seems like the list of apps retrieved by getApplications() does not return valid paths on Windows unlike on macOS:
This is the output on Windows:
[
{
name: 'KeePassXC',
localizedName: undefined,
path: '/Applications/8570d9f0-9729-57a6-89cc-06429aab905e',
windowsAppId: '/Applications/8570d9f0-9729-57a6-89cc-06429aab905e'
}
]
And this is the output on macOS:
[
{
bundleId: 'org.keepassxc.keepassxc',
path: '/Applications/KeePassXC.app',
name: 'KeePassXC'
}
]
My guess is that getApplications() does not yet have a native implementation on Windows.
There was a problem hiding this comment.
Great work. Thank you for your feedback 👍🏻. Do you know what /Applications/8570d9f0-9729-57a6-89cc-06429aab905e refers to 🤔?
Well, for Windows, I'll let the hardcoded path until the Raycast API offers a better way to retrieve the path.
There was a problem hiding this comment.
I'm glad to be able to help 👍 I don't really know, but it reminds me of virtual or pseudo paths similar to those used by JavaScript and PHP in web environments. With any luck someone from the Raycast team can shed some light 😄
left a comment
There was a problem hiding this comment.
Greptile Overview
Summary
This PR fixes issue #22043 by dynamically discovering the KeePassXC application path on macOS using the Raycast API's getApplications() function, replacing the previously hard-coded path /Applications/KeePassXC.app/Contents/MacOS/keepassxc-cli.
Key changes:
- Added new
findApplication()async method that discovers KeePassXC location at runtime on macOS - Windows path remains hard-coded due to Raycast API limitation (documented in PR description)
- The method is called before each CLI operation (
checkCredentialsandexecKeepassxcCli) - Dependency updates including
@raycast/apibumped to ^1.103.3
Issues identified:
- Missing error handling when KeePassXC is not found on macOS—
keepassxcCliremains undefined, causing unclear spawn errors instead of user-friendly "KeePassXC not found" message
Confidence Score: 4/5
- This PR is mostly safe to merge but has one logical error that needs correction
- The dynamic path discovery solves the reported issue effectively, but the implementation has a critical flaw: when KeePassXC is not found on macOS, the code silently leaves
keepassxcCliundefined, which will cause cryptic errors when spawn is called. Adding proper error handling would make this production-ready. - extensions/keepassxc/src/utils/keepass-loader.ts - needs error handling for missing KeePassXC application
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| extensions/keepassxc/src/utils/keepass-loader.ts | 4/5 | Changed from hard-coded macOS path to dynamic path discovery using Raycast API's getApplications(); Windows path remains hard-coded. Added new findApplication() method called before CLI operations. |
| extensions/keepassxc/CHANGELOG.md | 5/5 | Added version 1.7.1 changelog entry documenting the fix for KeePassXC app location retrieval on macOS. |
| extensions/keepassxc/package.json | 5/5 | Updated dependencies including @raycast/api to ^1.103.3 and run-applescript to ^7.1.0. Updated devDependencies. |
9 files reviewed, 1 comment
commented
Oct 13, 2025
|
@Osmagtor could you give it another go? |
commented
Oct 13, 2025
|
It now works without a hitch. |
Description
Hello there 👋🏻,
An update to find the KeePassXC app location using the Raycast API.
Fix #22043.
EDIT: The Raycast API doesn't provide a Windows path when using
getApplications(). The current workaround is to have the Windows path hard-coded.Tested on
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder