google-gemini/gemini-cli

Fix TypeScript execution in “CLI: Run Current File” debug configuration

Open

#22844 opened on Mar 17, 2026

View on GitHub
 (12 comments) (0 reactions) (1 assignee)TypeScript (103,992 stars) (13,657 forks)batch import
area/extensionseffort/smallhelp wantedkind/bugpriority/p2status/bot-triagedstatus/need-informationstatus/possible-duplicate

Description

URL of the page with the issue

cant find at the moment

What is the problem?

The current “CLI: Run Current File” debug configuration uses:

"program": "${file}"

This attempts to execute files directly using Node.js. However, since this project is written in TypeScript, running .ts or .tsx files directly with Node will fail.

As a result, this configuration is non-functional for most files in the repository and leads to runtime errors during debugging.

⚠️ Root Cause

Node.js does not natively execute TypeScript files

The project relies on tsx (already included as a dependency) for runtime transpilation

The debug configuration does not use tsx, causing execution failures

What did you expect to happen?

Update the configuration to use tsx via npm exec, enabling proper execution of TypeScript files.

{ "name": "CLI: Run Current File", "type": "node", "request": "launch", "runtimeExecutable": "npm", "runtimeArgs": [ "exec", "tsx", "--", "${file}" ], "cwd": "${workspaceFolder}", "skipFiles": ["<node_internals>/"], "outFiles": ["${workspaceFolder}//*.js"], "env": { "NODE_ENV": "development" } } 🚀 Benefits

✅ Enables direct debugging of .ts and .tsx files

✅ Aligns with existing project tooling (tsx)

✅ Removes runtime errors when launching files

✅ Improves developer experience and debugging workflow

Additional context

No response

Contributor guide