A unified Python framework for building, training, and deploying intelligent operators across digital and physical environments.
Warning
Early Alpha — APIs and behavior will change without notice.
optr provides a flexible architecture for creating operators that can:
- Automate desktop applications via GUI interaction
- Control physical robots through simulation and hardware interfaces
- Learn from demonstrations using imitation learning and reinforcement learning
- Record and replay episodes for testing and training
- Bridge multiple environments with unified connector interfaces
- Desktop Automation - Click, type, and interact with GUI elements
- Robot Control - MuJoCo simulation and physical robot support (Brewie)
- Learning Algorithms - Imitation learning, Pi0, and custom algorithms
- Episode Recording - Capture and replay operator sequences
- Modular Connectors - Extensible interface for any environment
- Validation & Safety - Built-in sentinel guards and validators
- Training Pipeline - Dataset management and model training
pip install optr# Desktop automation
pip install optr[desktop]
# MuJoCo simulation
pip install optr[simulation]
# Physical robot control (Brewie)
pip install optr[robot]
# All features
pip install optr[desktop,simulation,robot]git clone https://github.com/codecflow/optr
cd optr
uv sync --devCreate an operator that automates login:
# my_app/operators/login.py
from optr.operator import Operator
from optr.connector.desktop import DesktopConnector
async def login_operator():
op = Operator({"desktop": DesktopConnector()})
# Click username field
await op.execute_action("click", selector="#username")
await op.execute_action("type", text="demo_user")
# Click password field
await op.execute_action("click", selector="#password")
await op.execute_action("type", text="secure_pass")
# Submit form
await op.execute_action("click", selector="#submit")
return opControl a simulated robot:
# my_app/operators/robot_sim.py
from optr.operator import Operator
from optr.simulator.mujoco import MuJoCoSimulation
async def robot_operator():
sim = MuJoCoSimulation("models/robot.xml")
op = Operator({"robot": sim.get_connector()})
# Move to target position
await op.execute_action("move",
connector_name="robot",
position=[0.5, 0.3, 0.2])
# Grasp object
await op.execute_action("grasp",
connector_name="robot",
force=10.0)
return opControl a physical Brewie robot:
# my_app/operators/brewie_robot.py
from optr.operator import Operator
from optr.connector.robot import BrewieRobot
async def brewie_operator():
# Initialize Brewie robot connector
robot = BrewieRobot(host="192.168.1.100", port=9090)
op = Operator({"brewie": robot})
# Connect to robot
await op.execute_action("connect", connector_name="brewie")
# Get current robot state
state = await op.get_state("brewie")
print(f"Joint positions: {state.metadata['joint_positions']}")
# Move robot joints to target positions
await op.execute_action("move",
connector_name="brewie",
positions={13: 800, 14: 200, 15: 700},
duration=2.0)
# Disconnect
await op.execute_action("disconnect", connector_name="brewie")
return opThe main abstraction for defining automated behaviors. Operators can work with multiple connectors simultaneously.
Interfaces to different environments (desktop, robot, web, etc.). Each connector provides state observation and action execution.
Learning algorithms for training operators from demonstrations or through reinforcement learning.
Recorded sequences of states and actions that can be replayed or used for training.
Safety and validation layer that ensures operators behave within defined constraints.
- Cloud API connectors
- Distributed operator coordination
- Model zoo with pre-trained operators
- Real-time monitoring dashboard
MIT © CodecFlow