google-gemini/gemini-cli

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

クローズ

#22,844 opened on 2026/03/17

 (12 件のコメント) (0 件のリアクション) (1 人の担当者)TypeScript (13,657 件のフォーク)batch import
area/extensionseffort/smallhelp wantedkind/bugpriority/p2status/bot-triagedstatus/need-informationstatus/possible-duplicate

Repository metrics

Stars
 (103,992 個のスター)
PR merge metrics
 (平均マージ 4d 2h) (30d で 55 merged PRs)

説明

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

コントリビューターガイド