Golem 1.5 features - Part 12: REPL
Posted on April 20, 2026
Introduction
I am writing a series of short posts showcasing the new features of Golem 1.5, to be released at the end of April, 2026. The episodes of this series will be short and assume the reader knows what Golem is. Check my other Golem-related posts for more information!
Parts released so far:
- Part 1: Code-first routes
- Part 2: Webhooks
- Part 3: MCP
- Part 4: Node.js compatibility
- Part 5: Scala support
- Part 6: User-defined snapshotting
- Part 7: Configuration and Secrets
- Part 8: Template simplifications and automatic updates
- Part 9: Agent skills
- Part 10: WebSocket client
- Part 11: Bridge libraries
- Part 12: REPL
- Part 13: Per-agent configuration
- Part 14: OpenTelemetry
- Part 15: MoonBit
- Part 16: Quotas
- Part 17: Semantic retry policies
Testing agents with a REPL
The Golem REPL was an important element of testing agents during development. The REPL allows you to get or create agent instances, invoke methods on them, and see their logs streamed during these invocations.
In previous Golem versions, the REPL used our own scripting language called Rib. The same language was used for implementing HTTP APIs, but we changed that to be directly expressed in the agent's code. It did not make much sense to keep a custom scripting language just for interacting with agent instances, because it required learning a completely new syntax and mapping between its data types and the "real" data types in the agent's source code.
TypeScript REPL
We decided to completely remove Rib from Golem, make it available as a standalone tool, and offer it for integration with wasmtime. We no longer need to use Rib for anything in Golem, and our primary REPL is now a real TypeScript REPL.
The TypeScript REPL behaves just like you would expect, and it has all the agent client classes from the bridge libraries in the global scope, preconfigured. The following example shows how we can invoke the default counter example through it:
Note that the TypeScript REPL is not restricted to only agents written in TypeScript. We can call any agent from it in the same, type-safe way, even if they are Rust, Scala or MoonBit agents.
CLI commands from the REPL
In addition to the TypeScript classes for calling the agents, the REPL also provides a large set of built-in commands. These accept both . and : prefixes, and many of them match CLI commands directly. This means we can run all the usual commands such as build, deploy, or inspecting agent logs without leaving the REPL:
Running scripts
It is also possible to run whole TypeScript scripts through the REPL in a non-interactive way.
$ cat test.ts
const c2 = await CounterAgent.get("c2")
await c2.increment()
await c2.increment()
$ golem repl --script-file test.ts --yes
2Rust REPL
We wanted to bring a first-class REPL experience to every supported language, but with Golem 1.5 we are not there yet. We do have a Rust REPL, but, as expected, it is very slow because it has to continuously recompile things. We kept it mainly because it can also run Rust "scripts". In that mode the slowness is much less of an issue, and it lets these test scripts (potentially generated by a coding agent on the fly) use the same language as the agents themselves.
The following example demonstrates this:
$ cat test.rs
let c3 = CounterAgent::get("c3").await.unwrap();
c3.increment().await;
c3.increment().await;
$ golem repl --script-file test.rs --language rust --yes
2What about Scala and MoonBit?
Unfortunately we don't have any REPL implementation for Scala and MoonBit in Golem 1.5. This means we cannot use Scala or MoonBit syntax in the interactive REPL or in test scripts, but the TypeScript and Rust REPLs have full support for any agent, even if implemented in another language.