A handy Bash script to auto-generate VS Code launch.json
debug configurations for popular programming languages, including Go, Node.js, C#, and Python.
It automatically:
- Parses environment variables from your
.env
file - Detects the main entry point file for your project based on the selected language
- Creates a properly formatted
.vscode/launch.json
with your environment and program settings - Installs
jq
if it's missing (supports macOS, Debian/Ubuntu Linux, and warns on Windows)
- Go
- Node.js
- C# (.NET Core)
- Python
- Auto-detects main entry file (e.g.,
cmd/main.go
for Go,index.js
for Node.js,.dll
for C#,main.py
for Python) - Reads environment variables from
.env
file and injects them into the debug configuration - Generates language-specific debug configurations compatible with VS Code
- Handles OS-specific automatic installation of
jq
if needed
- Bash shell (Linux/macOS/WSL)
jq
(JSON processor) — the script tries to install it if missing on supported OSes- Git (optional, if you want to clone this repo)
-
Place your
.env
file in the root directory of your project. -
Make the script executable (if not already):
chmod +x generate-vscode-launch.sh