feat(cli): install JetBrains stack plugins via customizations.jetbrains - #79
Draft
shejnowicz wants to merge 1 commit into
Draft
feat(cli): install JetBrains stack plugins via customizations.jetbrains#79shejnowicz wants to merge 1 commit into
shejnowicz wants to merge 1 commit into
Conversation
Adds stack_jetbrains_plugin() symmetric to the existing
stack_extension() lookup, plus customize_devcontainer_plugins()
that rewrites the empty "plugins": [] in the JetBrains
customizations block that customize_devcontainer_json emits.
When --ide jetbrains and --stacks scala,python is passed:
"jetbrains": {
"backend": "IntelliJ",
"plugins": ["org.intellij.scala", "PythonCore"],
"settings": {}
}
Gateway installs these plugins into the backend IDE at start-up,
matching how VS Code auto-installs extensions from the vscode
customizations block. Stacks whose language support is bundled in
IntelliJ (java, node) or that don't have a first-party JetBrains
plugin (rust, dotnet) contribute nothing — the empty array stays.
Downloads hit plugins.jetbrains.com and
downloads.marketplace.jetbrains.com, already listed in the JetBrains
row of the default network allowlist (README §Network access rules).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Symmetric counterpart for the JetBrains devcontainer path to how VS Code stacks already work:
sandcat init --ide jetbrains --stacks scalanow seedscustomizations.jetbrains.pluginswith["org.intellij.scala"], so Gateway auto-installs the plugin into the backend IDE at first start. Today the array is emitted empty regardless of stack selection.Motivation
Existing
stack_extension()incli/lib/stacks.bashmapsscala → scalameta.metals(etc.) intocustomizations.vscode.extensionsfor the VS Code path. Nothing analogous exists for JetBrains — users need to open the plugin marketplace inside Gateway and install manually every time. The JetBrains devcontainer spec supportscustomizations.jetbrains.pluginsnatively (Gateway parses this block and installs listed marketplace IDs at backend start-up); we already emit the surrounding block viaapply_ide_customizations— just with"plugins": [].Changes
cli/lib/stacks.bash— newstack_jetbrains_plugin()lookup, mirroringstack_extension(). Only maps stacks with first-party or well-established plugins:python → PythonCorescala → org.intellij.scalago → org.jetbrains.plugins.go(Ultimate/GoLand only)ruby → org.jetbrains.plugins.ruby(Ultimate/RubyMine only)zig → com.falsepattern.zigbrains(community)node,java→ empty (language support bundled in IntelliJ)rust,dotnet→ empty (RustRover / Rider are standalone IDEs; no first-party IntelliJ plugin)See the function docstring for edition caveats.
cli/lib/devcontainer.bash— newcustomize_devcontainer_plugins(), symmetric to the existingcustomize_devcontainer_extensions(). Rewrites the literal"plugins": []emitted byapply_ide_customizationsin place. No-op if no stack contributes a plugin.cli/libexec/init/devcontainer— invokecustomize_devcontainer_pluginsaftercustomize_devcontainer_json(so the JetBrains block exists) and only when--ide jetbrainswith non-empty--stacks.cli/test/init/jetbrains_plugins.bats— 6 new tests covering: single plugin, multiple plugins, bundled-only stack (no rewrite), no stacks (no rewrite), mixed bundled+non-bundled, no-op on vscode devcontainer.json.Example
$ sandcat init --agent claude --ide jetbrains --stacks scala,python --name demoGenerates in
.devcontainer/devcontainer.json:Gateway installs both plugins into the IntelliJ backend on first start. Downloads go to
plugins.jetbrains.com/downloads.marketplace.jetbrains.com, already in the JetBrains row of the default network allowlist (README §Network access rules).Test plan
bats cli/test/init/— 81 tests pass locally (6 new + 75 existing)sandcat init --ide jetbrains --stacks scalaon a fresh project, open in JetBrains Gateway, verify the Scala plugin appears installed in the backend's Plugins UI at first launch (not yet run — requires Gateway + Marketplace access)Non-goals / notes for reviewer
--jetbrains-pluginsflag. Users who want additional plugins beyond stack defaults edit.devcontainer/devcontainer.jsondirectly. Same escape hatch as for the vscodeextensionsarray today.stack_jetbrains_plugin()docstring.rustanddotnetintentionally return empty. Both moved to standalone JetBrains IDEs (RustRover, Rider) with no maintained IntelliJ plugin equivalent. Happy to re-add if there's a preferred community plugin to point at.🤖 Generated with Claude Code