What Programming Language and Runtime Does Dexter Use?

Dexter is authored in TypeScript and executes exclusively on the Bun runtime, leveraging modern ECMAScript modules for high-performance AI agent operations.

The virattt/dexter repository represents a modern approach to building AI agents, and understanding its technical foundation is crucial for contributors and users. If you're investigating what programming language and runtime Dexter uses, you'll find a stack designed for speed and type safety. This analysis examines the source code to confirm Dexter's implementation in TypeScript and its dependency on the Bun runtime environment.

TypeScript as the Core Language

Dexter's entire codebase is written in TypeScript, a statically-typed superset of JavaScript that compiles to plain JavaScript. The presence of tsconfig.json in the repository root confirms the TypeScript configuration, specifying compiler options for modern ESNext output and strict type checking.

TypeScript provides Dexter with enhanced developer experience through static type checking, interfaces for AI agent configurations, and improved IDE support. The source files use .ts extensions and modern import syntax, reflecting contemporary TypeScript best practices.

Bun Runtime Environment

Unlike traditional Node.js applications, Dexter requires the Bun runtime (version 1.0 or higher) for execution. The README.md explicitly lists Bun as a prerequisite in the installation section, stating that Dexter depends on Bun's unique performance characteristics and built-in TypeScript support.

The package.json file confirms this dependency through its scripts section. All execution commands—including start, dev, and test—utilize the bun command rather than node or npm. For example, the development script likely reads "dev": "bun run --watch src/index.ts", leveraging Bun's native TypeScript execution capabilities without pre-compilation.

ECMAScript Modules Configuration

Dexter adopts modern ECMAScript modules (ESM) exclusively, abandoning the legacy CommonJS module system. The package.json declares "type": "module", enabling the use of import and export syntax throughout the codebase rather than require and module.exports.

This ESM-first approach aligns with Bun's native architecture, which prioritizes ES modules for better tree-shaking and performance. The TypeScript source files consistently use standard ESM import paths, including support for path aliases (such as @/agent/agent) configured in tsconfig.json.

Practical Execution Examples

You can run Dexter's TypeScript code directly without compilation steps. Consider this example from the source:

// src/example.ts
import { Agent } from '@/agent/agent';

// Simple entry point that runs a one‑shot query
async function run() {
  const agent = new Agent();
  const answer = await agent.run('What is Apple’s latest revenue?');
  console.log(answer);
}

run();

Execute this file immediately using Bun:

bun src/example.ts

Bun handles the TypeScript transpilation internally, offering faster startup times than traditional Node.js workflows that require ts-node or pre-compilation to JavaScript.

Summary

  • Dexter is written entirely in TypeScript, configured via tsconfig.json for modern ESNext output and strict type checking.
  • The project requires the Bun runtime (v1.0+) as specified in README.md and package.json scripts, which exclusively use bun commands.
  • Dexter uses ECMAScript modules exclusively, declared in package.json with "type": "module", enabling modern import/export syntax.
  • Bun executes TypeScript directly without pre-compilation, leveraging its built-in TypeScript support for optimal performance.

Frequently Asked Questions

Can Dexter run on Node.js instead of Bun?

No, Dexter is designed specifically for the Bun runtime. The package.json scripts explicitly invoke bun commands for all operations, and the README.md lists Bun as a mandatory prerequisite. While TypeScript can technically run on Node.js using ts-node or compilation, Dexter's architecture assumes Bun's specific performance characteristics and built-in APIs.

What version of Bun is required for Dexter?

Dexter requires Bun version 1.0 or higher. The README.md explicitly states this requirement in the prerequisites section, ensuring compatibility with Dexter's modern ECMAScript module system and TypeScript execution capabilities. Earlier versions of Bun may lack critical features or APIs that Dexter depends upon.

Does Dexter require TypeScript compilation before running?

No, Dexter does not require pre-compilation because it runs on Bun, which has native TypeScript support. You can execute .ts files directly using commands like bun src/example.ts. The Bun runtime handles TypeScript transpilation internally, offering faster startup times compared to traditional Node.js TypeScript workflows that require explicit compilation steps or ts-node.

Why does Dexter use ECMAScript modules instead of CommonJS?

Dexter adopts ECMAScript modules (ESM) to align with modern JavaScript standards and Bun's native ESM-first architecture. The package.json declares "type": "module", enabling better tree-shaking for optimized bundles and supporting modern import/export syntax. This approach matches contemporary TypeScript best practices and leverages Bun's superior module resolution performance compared to legacy CommonJS require/module.exports patterns.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →