Linux: support installing the Studio CLI#3269
Merged
Merged
Conversation
ivan-ottinger
commented
Apr 28, 2026
| } | ||
| } | ||
|
|
||
| function isPlatformSupported(): boolean { |
Contributor
Author
There was a problem hiding this comment.
Since we support all three platforms now, this is not necessary anymore.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Linux support for installing and auto-installing the bundled Studio CLI, aligning Linux behavior with existing macOS/Windows flows and fixing Linux pathing issues in the CLI launcher script.
Changes:
- Introduce
LinuxCliInstallationManagerand wire it into CLI IPC install/uninstall/status flows. - Auto-install the CLI on first production launch on Linux (matching other platforms).
- Fix Linux desktop launcher
Exec=resolution and makestudio-cli.shresource-path agnostic (macOS vs Linux).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/studio/src/modules/cli/lib/linux-installation-manager.ts | Adds Linux CLI install/uninstall/auto-install implementation (symlink + shell profile PATH export). |
| apps/studio/src/modules/cli/lib/ipc-handlers.ts | Adds Linux manager to platform switch; removes previous platform guard. |
| apps/studio/src/index.ts | Calls Linux CLI auto-install during app boot in production. |
| apps/studio/bin/studio-cli.sh | Fixes CLI bundle path resolution to work under Linux resources/ and macOS Resources/. |
| apps/studio/installers/desktop.ejs | Uses absolute Exec=/usr/bin/<name> to ensure launcher opens GUI, not CLI symlink. |
| apps/studio/src/tests/index.test.ts | Mocks the new Linux auto-install module for initialization tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
📊 Performance Test ResultsComparing 30b79f2 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
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.



Related issues
How AI was used in this PR
Used Claude Code to scope the work, write the new
LinuxCliInstallationManager(mirroring the macOS one), patch the path bug instudio-cli.sh, and run lint/typecheck/tests. Each change was reviewed before committing.Proposed Changes
LinuxCliInstallationManager(apps/studio/src/modules/cli/lib/linux-installation-manager.ts) that symlinks~/.local/bin/studio→ the bundledstudio-cli.shand appendsexport PATH="$HOME/.local/bin:$PATH"to.bashrc/.zshrc. Mirrors the macOS manager (no/usr/local/binlegacy cleanup needed — no prior Linux release shipped there).getCliInstallationManager()so the Preferences toggle and IPC handlers work on Linux. Drop the now-redundantisPlatformSupported()guard — every Electron-supported platform now has a manager, so the explicitthrowingetCliInstallationManager()is the single source of truth.autoInstallLinuxCliIfNeeded()fromapps/studio/src/index.tsso the CLI auto-installs on first launch (production builds only, matching the existing macOS/Windows behavior).apps/studio/bin/studio-cli.sh: deriveCLI_SCRIPTfromBIN_DIRdirectly so it works on both macOS (Resources/) and Linux (resources/). The previousCONTENTS_DIR/Resources/cli/main.mjspath was mac-specific and would have broken on Linux even with a working installer.apps/studio/src/tests/index.test.ts.apps/studio/installers/desktop.ejsto use an absolute path inExec=(/usr/bin/<%= name %>instead of bare<%= name %>). Without this, clicking the dock icon would invoke the CLI symlink (~/.local/bin/studio) instead of the GUI launcher (/usr/bin/studio), because Ubuntu's~/.profileputs~/.local/binahead of/usr/binon PATH for the desktop session. Same pattern VS Code uses (Exec=/usr/share/code/code %F).Testing Instructions
npm run make.sudo apt install ./out/make/deb/<arch>/studio_*.deb.sudo rm -f ~/.local/bin/studio ~/.studio/app.json. Then launch Studio from your distro's application launcher.~/.local/bin/studio(a symlink to/usr/lib/studio/resources/bin/studio-cli.sh). We can check this withls -la ~/.local/bin/studio.export PATH="$HOME/.local/bin:$PATH"is in~/.bashrc(or~/.zshrcif zsh is your shell):grep -n '\.local/bin' ~/.bashrc.studio --help. The CLI help should print.studio preview list(or any other CLI subcommand) to verify the bundled Node runtime and CLI bundle resolve correctly.ls -l ~/.local/bin/studio— it should report "No such file or directory". (Note:which studiomay still resolve to/usr/bin/studio, which is the DEB-installed GUI launcher — that's expected and unrelated to the CLI.)hash -rin the current one, since bash caches command paths), confirmstudio --helpworks again.~/.local/bin/studio.Pre-merge Checklist