opp_repl is built around an IPython shell that has all simulation functions pre-loaded. This page describes REPL-specific features that go beyond the standard IPython experience.
opp_repl --load ~/workspace/omnetpp/omnetpp.opp \
--load ~/workspace/inet/inet.oppKey command-line options:
--load OPP_FILE— load.oppdescriptor file(s); accepts single files, directories (loads all*.oppinside), glob patterns, or the special token@oppfor the bundled files. Can be repeated.-p PROJECT— set the default simulation project by name.--mcp-port PORT— start an MCP server on the given TCP port for AI assistant integration. Default is 0, which disables the MCP server entirely. Setting a non-zero port also requires--mcp-token-hash(unless running insideopp_sandbox).--mcp-token-hash HEX— SHA-256 hex hash of the bearer token that MCP clients must present to authenticate. Required when--mcp-portis set, except insideopp_sandbox.--mcp-bypass-token-hash-check— disable bearer-token authentication for the MCP server. Use only in trusted environments; normally--mcp-token-hashis required outsideopp_sandbox.
About
opp_sandbox: a bubblewrap-based sandbox wrapper shipped with opp_repl (bin/opp_sandbox). It runs opp_repl inside a restricted namespace where the only writable paths are the working directory and explicitly mounted ones. Several features (MCP authentication, overlay-build mounts) treat the sandbox as a trusted environment and relax their requirements when they detect it.
-l LEVEL— log level (ERROR,WARN,INFO,DEBUG). Note thatopp_repldefaults toINFO, while theopp_*command-line tools default toWARN.--external-command-log-level LEVEL— log level for output from simulations and build tools.--no-handle-exception— show full Python tracebacks instead of short error messages.
When the REPL starts, every public function from opp_repl is imported
into the top-level namespace — run_simulations, build_project,
run_fingerprint_tests, etc. — so you can call them without any prefix.
Every loaded simulation project is injected as a variable named
{name}_project (hyphens and dots become underscores). For example,
loading inet.opp creates inet_project, and loading simu5g.opp
creates simu5g_project. Use get_simulation_project_variable_names()
to list them all.
IPython's %autoreload 2 is enabled at startup. If you edit Python source
files (e.g. a user module or opp_repl itself), changes are picked up
automatically before each command — no need to restart the REPL.
At startup the REPL tries to import a Python module named after the current
OS login user (e.g. import levy). All public names from that module are
injected into the namespace. This lets you define personal helper functions,
set project defaults, or customize the environment without modifying
opp_repl itself. If no such module exists, the import is silently skipped.
Call stop_execution() (or stop_execution(value)) anywhere in a REPL
script to abort the current cell cleanly, without a full traceback. This
is useful in multi-line REPL scripts where you want to bail out early.
When started with --mcp-port, the REPL exposes its functions to AI
assistants via the Model Context Protocol. See MCP server
for details.