Launch real cloud computers and 3D robot simulations and control them from Node — stream the robot's camera, send actions, run episodes — or bring your own robot online. No agent: you drive.
npm install commandagiimport{CommandAGI}from"commandagi";constcagi=newCommandAGI({apiKey: "cagi_…"});// or COMMANDAGI_API_KEYconstworld=awaitcagi.launch("simulation/warehouse");letobs=awaitworld.observe();// JPEG bytes from the robot's head camerafor(leti=0;i<20;i++)obs=awaitworld.step("turn",{dir: "left"});awaitworld.reset();// robot back to the episode startawaitworld.close();// stop + release the cloud VMScenes: simulation/warehouse, simulation/house-on-fire, simulation/school. Computers work the
same way (cagi.launch("computer/software-engineer") → observe() returns the screen; actions are
click/type/key). Robot/sim actions: move, back, turn, stop, reset.
Stream your robot's camera into a session and apply the actions it receives — anyone (a person, an agent, another developer) can then watch and drive it, like a hosted simulation.
constbridge=awaitcagi.registerRobot("my-rover");console.log("watch + drive at:",bridge.sessionUrl);bridge.run({camera: ()=>myRobot.jpegFrame(),// () => Buffer (JPEG/PNG)onAction: (action,payload)=>myRobot.do(action,payload),fps: 10,});Create an API key with an operator scope (dashboard → API keys). Pass apiKey or set
COMMANDAGI_API_KEY. Target another environment with COMMANDAGI_BASE_URL.