Skip to content

feat(vscode): install VSCode and extensions automatically#61

Merged
chicham merged 1 commit intomainfrom
feat/vscode-extensions
Feb 21, 2026
Merged

feat(vscode): install VSCode and extensions automatically#61
chicham merged 1 commit intomainfrom
feat/vscode-extensions

Conversation

@chicham
Copy link
Copy Markdown
Collaborator

@chicham chicham commented Feb 21, 2026

Summary

  • Add visual-studio-code to the macOS Homebrew casks so it is installed during setup.
  • Add run_onchange_after_install-vscode-extensions.sh to automatically install recommended extensions after brew finishes (using the after_ modifier to guarantee ordering).

Extensions installed

Extension ID
Catppuccin Theme Catppuccin.catppuccin-vsc
Catppuccin Icons Catppuccin.catppuccin-vsc-icons
Python ms-python.python
Pylance ms-python.vscode-pylance
Ruff charliermarsh.ruff

The script is idempotent (skips already-installed extensions) and exits cleanly if the code CLI is not found.

Closes #52

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @chicham, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the automated setup for macOS environments by integrating Visual Studio Code and a curated set of essential extensions. It ensures that developers have a consistent and ready-to-use VSCode environment with necessary tools, streamlining the initial configuration process.

Highlights

  • VSCode Installation: Visual Studio Code has been added to the macOS Homebrew casks, ensuring it is installed automatically during system setup.
  • Extension Automation: A new shell script, run_onchange_after_install-vscode-extensions.sh, was introduced to automatically install a predefined list of recommended VSCode extensions after Homebrew completes its installation process. This script is idempotent and checks for the code CLI availability.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .chezmoidata/packages.yaml
    • Added 'visual-studio-code' to the list of Homebrew casks for macOS.
  • .chezmoiscripts/run_onchange_after_install-vscode-extensions.sh
    • Created a new shell script to automatically install specified VSCode extensions.
    • Implemented a check to ensure the 'code' CLI is available before attempting installation.
    • Added an 'install_extension' function to handle idempotent installation of extensions.
    • Included specific extensions for themes (Catppuccin) and Python development (Python, Pylance, Ruff).
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request successfully automates the installation of Visual Studio Code and its extensions using chezmoi. The logic for idempotency in the extension installation script is good, though it can be optimized for performance. By caching the list of installed extensions, we can avoid the overhead of starting the VSCode CLI multiple times.

Comment on lines +14 to +22
install_extension() {
# Skip if already installed to avoid redundant network calls
if code --list-extensions | grep -qi "^$1$"; then
echo "Already installed: $1"
else
echo "Installing: $1"
code --install-extension "$1"
fi
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The code command has a significant startup overhead. Calling code --list-extensions inside the install_extension function results in multiple CLI invocations, which can be slow. Fetching the list of installed extensions once at the start of the script is much more efficient.

@chicham chicham force-pushed the feat/vscode-extensions branch from faf468a to 1cec549 Compare February 21, 2026 10:58
- Add visual-studio-code to darwin Homebrew casks
- Add run_onchange_after_install-vscode-extensions.sh to install
  Catppuccin theme/icons, Python, Pylance, and Ruff extensions
  automatically after brew finishes

Script hardening:
- exit 1 (not 0) when code CLI is missing so chezmoi retries on next apply
- capture code --list-extensions output before piping to avoid swallowing failures
- use grep -F for literal extension ID matching (dots are not regex wildcards)
- explicit error on code --install-extension failure with actionable message

Closes #52
@chicham chicham force-pushed the feat/vscode-extensions branch from 1cec549 to 5dabde1 Compare February 21, 2026 11:04
@chicham chicham merged commit 4645629 into main Feb 21, 2026
@chicham chicham deleted the feat/vscode-extensions branch February 21, 2026 11:04
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.

VSCode: Add automatic extension installation script

1 participant