Skip to content

Commit 2bfad84

Browse files
ibolmoviadezo1er
authored andcommitted
Infer language and runner from file extensions
Replace explicit `--language` and `--runner` flags with automatic detection based on file extensions. Introduce separate `--runner-js` and `--runner-python` flags for explicit runner overrides. Hide the deprecated `--language` flag and maintain backward compatibility for the `BT_EVAL_RUNNER` environment variable via `--runner-js-legacy-env`. Update test fixtures to use `runners_js` and `runners_python` instead of `runtime` and `runners`.
1 parent cfcfec3 commit 2bfad84

24 files changed

Lines changed: 1304 additions & 669 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ Files inside `node_modules`, `.venv`, `venv`, `site-packages`, `dist-packages`,
138138
**Runners:**
139139

140140
- By default, `bt eval` auto-detects a JavaScript runner from your project (`tsx`, `vite-node`, `ts-node`, then `ts-node-esm`).
141-
- Set a runner explicitly with `--runner` / `BT_EVAL_RUNNER`:
142-
- `bt eval --runner vite-node tutorial.eval.ts`
143-
- `bt eval --runner tsx tutorial.eval.ts`
141+
- Set a JavaScript runner explicitly with `--runner-js` / `BT_EVAL_JS_RUNNER`:
142+
- `bt eval --runner-js vite-node tutorial.eval.ts`
143+
- `bt eval --runner-js tsx tutorial.eval.ts`
144+
- Set a Python runner explicitly with `--runner-python` / `BT_EVAL_PYTHON_RUNNER`:
145+
- `bt eval --runner-python python tutorial.eval.py`
144146
- `bt` resolves local `node_modules/.bin` entries automatically — no need for a full path.
145147
- If eval execution fails with ESM/top-level-await related errors, retry with:
146-
- `bt eval --runner vite-node tutorial.eval.ts`
148+
- `bt eval --runner-js vite-node tutorial.eval.ts`
147149

148150
**Passing arguments to the eval file:**
149151

0 commit comments

Comments
 (0)