#How to default to bun and typescript?

1 messages · Page 1 of 1 (latest)

midnight flax
#

I'm not a huge fan of python... or all the mess it creates when it's executed.. Bun runs typescript natively.. wondering if there's any way to make my bot produce any scripts/code it does in typescript instead of python?

limpid tangleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

rocky whaleBOT
#

There isn’t a “global default language = X” switch, but you can push it pretty hard to prefer TypeScript for any little helper scripts it writes/runs.

What works best:

  • Add a rule to your agent’s AGENTS.md (in that agent’s workspace) saying something like:

    • “When you need to write/run a script, use TypeScript (Node).”
    • “Use tsx to run .ts files.”
    • “Do not use Python unless I explicitly ask.”
  • Make TS actually runnable in the workspace, otherwise the model tends to fall back to Python because it’s “always available”:

    • In your workspace folder, install a TS runner:
      • pnpm add -D typescript tsx @types/node
    • Then the agent can do: pnpm tsx scripts/foo.ts
  • If your main complaint is the filesystem mess, consider enabling sandboxing so the temp files land in a sandbox workspace instead of littering your host FS: