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
.envfile - Detects the main entry point file for your project based on the selected language
- Creates a properly formatted
.vscode/launch.jsonwith your environment and program settings - Installs
jqif 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.gofor Go,index.jsfor Node.js,.dllfor C#,main.pyfor Python) - Reads environment variables from
.envfile and injects them into the debug configuration - Generates language-specific debug configurations compatible with VS Code
- Handles OS-specific automatic installation of
jqif 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
.envfile in the root directory of your project. -
Make the script executable (if not already):
chmod +x generate-vscode-launch.sh