Skip to content

Instantly share code, notes, and snippets.

@blattmann
Last active August 5, 2026 16:19
Show Gist options
  • Select an option

  • Save blattmann/c7e4a6761d62edc4750eb4b1855f0ab1 to your computer and use it in GitHub Desktop.

Select an option

Save blattmann/c7e4a6761d62edc4750eb4b1855f0ab1 to your computer and use it in GitHub Desktop.
install-vscode-extensions.sh

Gist name

install-vscode-extensions.sh

Gist description

Installs a focused set of Visual Studio Code extensions for Nuxt 3/4, Vue 3, TypeScript, ESLint, Prettier, Git, and optional Tailwind CSS development.

Installation

1. Download the script

Open Git Bash, WSL, or another Bash-compatible terminal and run:

curl -L \
  "https://gist.github.com/blattmann/c7e4a6761d62edc4750eb4b1855f0ab1/raw/install-vscode-extensions.sh" \
  -o install-vscode-extensions.sh

2. Make the script executable

chmod +x install-vscode-extensions.sh

3. Run the installer

For the standard Nuxt 3/4 extension set:

./install-vscode-extensions.sh

Alternatively:

bash install-vscode-extensions.sh

Optional Tailwind CSS support

For projects using Tailwind CSS or Nuxt UI:

./install-vscode-extensions.sh --with-tailwind

Or:

bash install-vscode-extensions.sh --with-tailwind

Display available options

./install-vscode-extensions.sh --help

Requirements

  • Visual Studio Code
  • Git Bash, WSL, macOS Terminal, Linux Terminal, or another Bash-compatible shell
  • The VS Code code CLI command available in PATH

Verify the VS Code CLI:

code --version

If the command is unavailable, open Visual Studio Code and run the following command from the Command Palette:

Shell Command: Install 'code' command in PATH

On Windows, restarting Git Bash or the terminal after installing Visual Studio Code may be required.

Installed extensions

The default installation includes:

  • Vue Official
  • ESLint
  • Prettier
  • Path IntelliSense
  • GitLens
  • GitHub Pull Requests and Issues
  • DotENV

The optional --with-tailwind flag also installs:

  • Tailwind CSS IntelliSense

Update the installed extensions

Run the installer again:

./install-vscode-extensions.sh

The script uses the VS Code CLI --force option, so existing extensions are updated when possible.

Remove the downloaded installer

After installation:

rm install-vscode-extensions.sh

One-line installation

Standard installation:

curl -L "https://gist.github.com/blattmann/c7e4a6761d62edc4750eb4b1855f0ab1/raw/install-vscode-extensions.sh" -o install-vscode-extensions.sh && chmod +x install-vscode-extensions.sh && ./install-vscode-extensions.sh

Installation with Tailwind CSS support:

curl -L "https://gist.github.com/blattmann/c7e4a6761d62edc4750eb4b1855f0ab1/raw/install-vscode-extensions.sh" -o install-vscode-extensions.sh && chmod +x install-vscode-extensions.sh && ./install-vscode-extensions.sh --with-tailwind
#!/usr/bin/env bash
###############################################################################
# VS Code Extension Installer
# -----------------------------------------------------------------------------
# Installs a focused set of Visual Studio Code extensions for:
#
# - Nuxt 3 and Nuxt 4
# - Vue 3
# - TypeScript
# - ESLint
# - Prettier
# - Git and GitHub workflows
#
# Supported environments:
#
# - Git Bash on Windows 11
# - WSL with access to the Windows VS Code CLI
# - Bash terminals on macOS and Linux
#
# Requirements:
#
# - Visual Studio Code
# - The VS Code CLI command: code
#
# Usage:
#
# bash install-vscode-extensions.sh
#
# Optional:
#
# bash install-vscode-extensions.sh --with-tailwind
#
###############################################################################
set -u
set -o pipefail
# ----------------------------
# OUTPUT HELPERS
# ----------------------------
print_header() {
printf '%s\n' "---------------------------------------------------------"
printf '%s\n' " VS Code Extension Installer"
printf '%s\n' " Nuxt 3/4, Vue, TypeScript, ESLint and Prettier"
printf '%s\n' "---------------------------------------------------------"
printf '\n'
}
print_usage() {
cat <<'EOF'
Usage:
bash install-vscode-extensions.sh
bash install-vscode-extensions.sh --with-tailwind
bash install-vscode-extensions.sh --help
Options:
--with-tailwind Also install Tailwind CSS IntelliSense
--help Display this help message
EOF
}
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# ----------------------------
# ARGUMENTS
# ----------------------------
INSTALL_TAILWIND=false
while [[ $# -gt 0 ]]; do
case "$1" in
--with-tailwind)
INSTALL_TAILWIND=true
shift
;;
--help | -h)
print_usage
exit 0
;;
*)
printf '❌ Unknown option: %s\n\n' "$1" >&2
print_usage >&2
exit 1
;;
esac
done
# ----------------------------
# VS CODE CLI DETECTION
# ----------------------------
find_vscode_cli() {
if command_exists code; then
printf '%s\n' "code"
return 0
fi
if command_exists code-insiders; then
printf '%s\n' "code-insiders"
return 0
fi
# Common Windows installation locations visible from Git Bash.
local windows_candidates=(
"/c/Users/${USERNAME:-}/AppData/Local/Programs/Microsoft VS Code/bin/code"
"/c/Program Files/Microsoft VS Code/bin/code"
"/c/Program Files (x86)/Microsoft VS Code/bin/code"
)
local candidate
for candidate in "${windows_candidates[@]}"; do
if [[ -x "$candidate" ]]; then
printf '%s\n' "$candidate"
return 0
fi
done
# Common Windows installation locations visible from WSL.
local wsl_candidates=(
"/mnt/c/Users/${USERNAME:-}/AppData/Local/Programs/Microsoft VS Code/bin/code"
"/mnt/c/Program Files/Microsoft VS Code/bin/code"
"/mnt/c/Program Files (x86)/Microsoft VS Code/bin/code"
)
for candidate in "${wsl_candidates[@]}"; do
if [[ -x "$candidate" ]]; then
printf '%s\n' "$candidate"
return 0
fi
done
return 1
}
print_header
if ! VSCODE_CLI="$(find_vscode_cli)"; then
printf '%s\n' "❌ ERROR: The Visual Studio Code CLI could not be found."
printf '\n'
printf '%s\n' "Install Visual Studio Code and ensure the 'code' command is available."
printf '\n'
printf '%s\n' "In VS Code, open the Command Palette and run:"
printf '%s\n' " Shell Command: Install 'code' command in PATH"
printf '\n'
printf '%s\n' "On Windows, reinstalling or modifying VS Code with"
printf '%s\n' "'Add to PATH' enabled may also resolve the problem."
exit 1
fi
printf 'Using VS Code CLI: %s\n\n' "$VSCODE_CLI"
# ----------------------------
# EXTENSIONS
# ----------------------------
# Core extensions for Nuxt 3/4 development.
#
# Vue (Official) provides Vue SFC and TypeScript language support.
# ESLint handles project linting and automatic fixes.
# Prettier handles project formatting.
#
# Nuxt itself does not require a separate extension pack.
EXTENSIONS=(
# Vue 3 and Nuxt SFC language support
"Vue.volar"
# ESLint integration
"dbaeumer.vscode-eslint"
# Prettier formatting
"esbenp.prettier-vscode"
# Path completion
"christian-kohler.path-intellisense"
# Git history, blame and repository tooling
"eamodio.gitlens"
# GitHub pull requests and issues
"GitHub.vscode-pull-request-github"
# Environment-file syntax highlighting
"mikestead.dotenv"
)
# Tailwind is optional because not every Nuxt project uses it.
if [[ "$INSTALL_TAILWIND" == true ]]; then
EXTENSIONS+=(
"bradlc.vscode-tailwindcss"
)
fi
# ----------------------------
# INSTALLATION
# ----------------------------
SUCCESS_COUNT=0
FAILURE_COUNT=0
SKIPPED_COUNT=0
FAILED_EXTENSIONS=()
printf '%s\n' "πŸ“¦ Installing VS Code extensions..."
printf '\n'
for extension in "${EXTENSIONS[@]}"; do
printf 'β†’ %s\n' "$extension"
# Determine whether the extension is already installed.
if "$VSCODE_CLI" --list-extensions 2>/dev/null |
grep -Fqi -- "$extension"; then
printf '%s\n' " ↻ Already installed; checking for updates"
fi
# --force installs the extension or updates an existing installation.
if "$VSCODE_CLI" \
--install-extension "$extension" \
--force \
>/dev/null 2>&1; then
printf '%s\n' " βœ” Installed or updated"
SUCCESS_COUNT=$((SUCCESS_COUNT + 1))
else
printf '%s\n' " ❌ Installation failed"
FAILURE_COUNT=$((FAILURE_COUNT + 1))
FAILED_EXTENSIONS+=("$extension")
fi
printf '\n'
done
# ----------------------------
# RESULTS
# ----------------------------
printf '%s\n' "---------------------------------------------------------"
printf '%s\n' " Installation Complete"
printf '%s\n' "---------------------------------------------------------"
printf 'βœ” Successful installs or updates: %d\n' "$SUCCESS_COUNT"
printf '❌ Failed installs: %d\n' "$FAILURE_COUNT"
if [[ "$INSTALL_TAILWIND" == true ]]; then
printf '%s\n' "βœ” Tailwind CSS IntelliSense: requested"
else
printf '%s\n' "β„Ή Tailwind CSS IntelliSense: not requested"
fi
printf '\n'
if [[ "$FAILURE_COUNT" -gt 0 ]]; then
printf '%s\n' "The following extensions failed:"
printf '\n'
for extension in "${FAILED_EXTENSIONS[@]}"; do
printf ' - %s\n' "$extension"
done
printf '\n'
printf '%s\n' "Run the script again or install those extensions manually."
printf '%s\n' "Review the terminal output from this command for more details:"
printf '\n'
for extension in "${FAILED_EXTENSIONS[@]}"; do
printf ' %q --install-extension %q --force\n' \
"$VSCODE_CLI" \
"$extension"
done
printf '\n'
exit 1
fi
printf '%s\n' "All requested extensions were installed successfully."
printf '%s\n' "Restart or reload VS Code so every extension is activated."
printf '\n'
printf '%s\n' "In VS Code, use:"
printf '%s\n' " Ctrl+Shift+P β†’ Developer: Reload Window"
printf '%s\n' "---------------------------------------------------------"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment