Launch real cloud computers and 3D robot simulations and control them from Python — stream the robot's camera, send actions, run episodes. No agent required: you drive.
pip install commandagi # + `pip install commandagi[vision]` for numpy framesfromcommandagiimportCommandAGIcagi=CommandAGI(api_key="cagi_...") # or set COMMANDAGI_API_KEYwithcagi.launch("simulation/warehouse") asworld:
obs=world.observe() # JPEG bytes from the robot's head camerafor_inrange(20):
obs=world.step("turn", dir="left") # act, then get the next frameworld.reset() # robot back to the episode start# leaving the block stops the world and releases the cloud VMlaunch() provisions a real GCE VM running a PyBullet world, waits until it's streaming, and gives
you a World. Built-in scenes: simulation/warehouse, simulation/house-on-fire,
simulation/school (a mobile robot in each).
| World kind | actions |
|---|---|
| robot / sim | move(speed), back(speed), turn(dir, rate), stop, reset |
| computer | click(x, y), type(text), key(key), move(x, y), scroll(x, y, dy) |
world.act("move", speed=0.8) # fire-and-forgetobs=world.step("move", speed=0.8) # act + return the next observation (settles 0.8s)obs=world.observe(fresh=True) # wait for a frame newer than nowarr=world.observe_array() # HxWx3 uint8 numpy (needs commandagi[vision])forframeinworld.stream(): # live generator of frames
...withcagi.launch("computer/software-engineer") aspc:
pc.act("type", text="hello")
pc.act("key", key="Return")
screenshot=pc.observe() # PNG bytes of the live Ubuntu desktopCreate an API key with an operator scope (dashboard → API keys, or POST /me/api-keys). Pass it to
CommandAGI(api_key=...) or set COMMANDAGI_API_KEY. Point at another environment with
COMMANDAGI_BASE_URL (e.g. https://api-dev.commandagi.com).
Full HTTP + WebSocket reference (what the SDK wraps): docs/ROBOT_DEVELOPER_API.md.