repl command to the Orionjs CLI. It lets you evaluate TypeScript expressions against your running dev server — services, repositories, database connections, and all.
The Problem
Sometimes you need to quickly query a service, inspect data, or run a one-off fix. Until now, you’d either:- Write a throwaway script that imports your app and runs some code
- Add temporary code to a route or resolver and hit it with curl
- Open a MongoDB shell and work around your application layer
The Solution
First, start your dev server with the--repl flag:
- Connects to your already-running dev server over HTTP
- Evaluates your expression with full access to
getInstanceand all registered services - Prints the result as JSON
Examples
Query a service
Count documents in a collection
Run a quick data fix
How It Works
When you runorion dev --repl, the dev server registers a POST /__repl endpoint on the same Express app. The orion repl CLI sends your expression to that endpoint, where it’s evaluated as an async function body with getInstance in scope. The result is returned as JSON.
Port discovery is automatic — the server writes its port to .orion/port, and the CLI reads it. You can also specify --port explicitly.
Claude Code Integration
If you use Claude Code, you can teach it to use the REPL by adding a custom command at.claude/commands/orion-repl.md:
Get Started
Update to the latest@orion-js/core and try it: