commandagi — the CommandAGI Python SDK
Drive the whole CommandAGI platform as code: agent threads, memory and integrations, and live embodiments (cloud computers, robots, simulated worlds) that you watch and control.
pip install commandagi
export COMMANDAGI_API_KEY=cagi_... # Settings → API keys
from commandagi import CommandAGI
cagi = CommandAGI() # reads COMMANDAGI_API_KEY
# Agents: start one on a goal and follow along.
t = cagi.threads.create(intent="Summarise this week's robotics news in five bullets")
cagi.threads.send(t["threadId"], "Add a link for each one.")
# Embodiments: launch a world YOU drive (no agent in it), watch it, control it.
with cagi.launch("simulation/warehouse") as world:
print(world.controls()) # what it accepts right now, with payload schemas
world.sim.ik(target=[0.3, 0.0, 0.4]) # typed robot/sim control
jpeg = world.observe(fresh=True) # the next frame, after the move
# leaving the block stops the world and releases the machine
# Anything else: every platform tool by name.
cagi.call("list_snapshots")
One surface, generated
This SDK, the TypeScript SDK (npm i commandagi) and the commandagi CLI all come from one
schema, commandagi-sdk.schema.json, so they can't drift apart:
-
Tools:
cagi.threads,cagi.embodiments,cagi.memory,cagi.integrations,cagi.social(platform, account),whoami,search,runandpost. Each one is a typed wrapper overcall(tool, args). Options are passed as keyword arguments, e.g.snapshot_id=…, and sent over the wire as camelCase (snapshotId). -
Control vocabularies on a live
Session:session.desktopfor computers:click,double_click,move,scroll,type,key,waitsession.robotfor physical robots:joint,gripper,move,turn,home,stop, …session.simfor simulated worlds:reset,sim_mode,ctrl,actuator,ik,trajectory,grab,force,add_robot, …
Every method sends one action to that embodiment. The platform checks it against the controls the embodiment is currently declaring, which
session.controls()lists along with their payload schemas. For anything a runtime declares that no vocabulary covers, usesession.act(action, payload).
The generated part is commandagi/_generated.py. Don't edit it: it is regenerated from the schema in
the CommandAGI monorepo.
Sessions
cagi.launch(snapshot_id, title=, wait=True, timeout=600) |
a new agentless thread running that snapshot; waits until it declares controls |
cagi.session(thread_id, embodiment_id) |
attach to an embodiment that already exists |
session.frame(fresh=False) / observe() / observe_array() / frames() |
the latest frame, as {url, channel_id, at}, image bytes, or a numpy array (pip install "commandagi[vision]"); frames() yields each new one |
session.describe() |
the live world a sim or robot runtime reports |
session.close() / stop() |
stop watching / also stop a world this session launched |
Snapshot ids come from cagi.call("list_snapshots"), e.g. simulation/warehouse or
computer/software-engineer.
Reinforcement learning
commandagi.gym_env.CommandAGIEnv wraps a sim session as a Gymnasium env (pip install "commandagi[gym]"), and commandagi.lerobot records rollouts as LeRobot datasets (pip install "commandagi[lerobot]").
Environment
| variable | meaning |
|---|---|
COMMANDAGI_API_KEY |
your cagi_… key. Its scopes decide what every call may do |
COMMANDAGI_BASE_URL |
API origin (default https://api.commandagi.com) |
COMMANDAGI_THREAD_ID |
default thread for self-thread methods. Set automatically when your code runs inside the platform |
Metadata
Release files for commandagi 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| commandagi-0.4.0.tar.gz | 22.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| commandagi-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.3 kB
Release files / commandagi-0.4.0.tar.gz
| Download URL | commandagi-0.4.0.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef0b713711b3bbb1279f554ae2fe01a57f815a289031b7f34b56f0b8b1f367be
|
|
BLAKE2b-256 checksum How to use checksums |
f99fe127e2d324c8709ed0304268b6886f8ee8f264f2152eeec1f37b661e421a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency logRelease files / commandagi-0.4.0-py3-none-any.whl
| Download URL | commandagi-0.4.0-py3-none-any.whl |
|---|---|
| Size | 19.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c9586b443f6ef289949661beaad6897c58250739221f3ddb0468c494c2e71e0
|
|
BLAKE2b-256 checksum How to use checksums |
6b06e6b5b65491c162326a19d80d4fd134646ba29b3fdd02243a7a369eede00a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency logSecurity for commandagi 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for commandagi-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.