Golem Interactive REPL (Rust)
The golem repl command starts an interactive REPL for testing and scripting agents. It supports both an interactive mode and a script execution mode.
There is no Rust REPL language in Golem. Use the TypeScript REPL (the default) to interact with your Rust agents — all agent types are available as TypeScript classes regardless of the agent's source language.
Interactive Mode
golem repl
Starts a TypeScript REPL with all agent client classes preconfigured in the global scope — including your Rust agents. You can address keyed agents with upsert, create agents with create, connect to agents by ID with getById, invoke methods, and see logs streamed during invocations, all with full type safety.
Example: Invoking a Rust counter agent from the TypeScript REPL
const c1 = CounterAgent.upsert("c1")
await c1.increment()
await c1.increment()
const value = await c1.getValue()
Built-in Commands
The REPL provides built-in commands that mirror CLI functionality. Commands accept both . and : prefixes:
.build/:build— build the project.deploy/:deploy— deploy components.help/:help— show available commands
This lets you build, deploy, and test agents without leaving the REPL.
Script Mode
Run a TypeScript file non-interactively:
golem repl --script-file test.ts --yes
The --yes flag auto-confirms any prompts. The script has the same global scope as the interactive REPL — all agent client classes are available, including Rust agents.
Run the script after creating it, unless the user explicitly asked not to.
Example script (`test.ts`)
const c2 = CounterAgent.upsert("c2")
await c2.increment()
await c2.increment()
Run it:
golem repl --script-file test.ts --yes
Available REPL Languages
| Language | Flag | Interactive | Script | Notes |
|----------|------|-------------|--------|-------|
| TypeScript | (default) | ✅ | ✅ | Recommended — works with all agent languages |
No Rust REPL is available. The TypeScript REPL is recommended for interacting with Rust agents.
Prerequisites
- The Golem server must be running (
golem server run) - Run from the application directory —
golem replbuilds the components and deploys them automatically if they are not deployed yet