Skip to content

Commit 8fe8457

Browse files
committed
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 896134c commit 8fe8457

24 files changed

Lines changed: 981 additions & 389 deletions

File tree

README.md

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

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

146148
**Passing arguments to the eval file:**
147149

0 commit comments

Comments
 (0)