Skip to main content
We’ve added a new 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
None of these are great. They’re slow, error-prone, and bypass your business logic.

The Solution

First, start your dev server with the --repl flag:
Then, in another terminal:
That’s it. The command:
  1. Connects to your already-running dev server over HTTP
  2. Evaluates your expression with full access to getInstance and all registered services
  3. Prints the result as JSON
No extra boot time, no port conflicts, and you’re working against the actual live app state.

Examples

Query a service

Count documents in a collection

Run a quick data fix

How It Works

When you run orion 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:
This lets Claude interact with your app directly — querying data, testing services, and running migrations on your behalf.

Get Started

Update to the latest @orion-js/core and try it:
See the full REPL guide for more details.