Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

CommandAGI Python SDK

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 frames

Robot testing in a 3D world

fromcommandagiimportCommandAGIcagi=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 VM

launch() 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).

The control vocabulary

World kindactions
robot / simmove(speed), back(speed), turn(dir, rate), stop, reset
computerclick(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
...

Computers too

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 desktop

Auth

Create 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.

About

Official Python SDK for commandAGI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages