CAP General is a framework-agnostic Code-as-Policy runtime for building, serving, and testing robot controls. A CAP scene can host one or more controls, route generated Python tasks to them, expose the scene through MCP, record execution history, and run configurable policy pipelines such as training jobs.
The repository currently integrates Genesis, LIBERO, and Robosuite. Genesis is one supported backend rather than the scope of the whole project.
For a runnable Genesis grasp walkthrough, see docs/quick_start.md.
- Scene-level routing for single-control and multi-control execution
- Configurable controls, robots, policies, operators, and computation graphs
- Ordered pipelines for training and other policy transformation jobs
- Asynchronous task dispatch with status monitoring
- MCP server tools for execution, retry, observation, reset, recording, and pipelines
- Scene-level request/response history and robot execution artifacts
- Recursive YAML overrides from the command line
- Framework integrations for Genesis, LIBERO, and Robosuite
cap_general/
├── core/
│ ├── control/ # Control execution and policy ownership
│ ├── operator/ # Graph operators and model adapters
│ ├── pipeline/ # Ordered jobs such as training
│ ├── policy/ # Policy runtime and graph representation
│ ├── robot/ # Framework-independent robot contract
│ ├── scene/ # Multi-control routing, monitoring, MCP, and history
│ └── utils/
├── frameworks/
│ ├── genesis/ # GO2, drone, grasp, and multi-control scenes
│ ├── libero/ # LIBERO VLA control and training pipeline
│ └── robosuite/ # Robosuite control integration
├── interface/ # capcmd CLI
└── skills/ # MCP-facing task, state, reset, and training skills
Runtime composition is configuration-driven:
Scene
└── Control(s)
├── Robot
├── Policy graph(s)
│ └── Operator nodes
└── Pipeline (optional)
└── Job(s)
Install the core package and test dependencies:
pip install -e ".[test]"Framework dependencies are intentionally environment-specific:
- Genesis: install Genesis, PyTorch, and RSL-RL in a simulation environment.
- LIBERO: install the LIBERO repository and its Robosuite dependencies. The optional package dependencies can be installed with
pip install -e ".[libero]". - Robosuite: install the version required by the target environment and model stack.
Paths to external repositories, checkpoints, and models are configured in configs/.
Ready-to-run configurations are grouped by framework:
configs/
├── genesis/
│ ├── genesis_drone.yaml
│ ├── genesis_go2.yaml
│ ├── genesis_grasp.yaml
│ ├── genesis_humanoid.yaml
│ └── genesis_multi_grasp.yaml
├── libero/libero_base.yaml
└── robosuite/robosuite_base.yaml
Configuration values can be overridden recursively when starting a server:
capcmd server \
--config configs/genesis/genesis_grasp.yaml \
--show_viewer false \
--controls[0].robot.num_envs 1The humanoid configuration ports the HumanoidBench G1 locomotion tasks to Genesis. Set
paths.humanoid_bench_home in the scene YAML to the HumanoidBench checkout before running it.
Start a CAP scene as an MCP server:
capcmd server --config configs/genesis/genesis_grasp.yaml --client codex--client selects an agent from cap_general/skills/config.yaml and defaults to nanobot.
The scene exposes tools including:
control_docexecuteretrymonitorget_obsresetrecordrun_pipewhen a pipeline is configuredupdate_history
Task calls support multiple controls. Requests are routed by configured name or alias, while responses use each control's scene-visible mark.
The test suite covers the general CAP runtime as well as framework-specific integration cases.
These tests do not require a simulator:
pytest \
tests/test_core.py \
tests/test_graph.py \
tests/test_interface.py \
tests/test_robot.py \
tests/test_scene.pyCoverage includes registration, graph execution, operators, policies, robots, pipelines, configuration overrides, multi-control scene routing, task monitoring, and history tracing.
Run these from an environment containing Genesis and RSL-RL:
python tests/genesis/test_genesis_go2.py
python tests/genesis/test_genesis_drone.py
python tests/genesis/test_genesis_grasp.py
python tests/genesis/test_genesis_multi_grasp.pyTraining smoke tests use --train_ep:
python tests/genesis/test_genesis_grasp.py --task-num 0 --train_ep 1The multi-control case supports round-robin execution by default and concurrent batches with --parallel:
python tests/genesis/test_genesis_multi_grasp.py --task-num 3
python tests/genesis/test_genesis_multi_grasp.py --task-num 1 --parallelRun from the environment containing LIBERO and its matching Robosuite installation:
python tests/libero/test_libero_base.pyRun from the environment containing the configured Robosuite stack:
python tests/robosuite/test_robosuite_base.pyFramework tests also support --remote. Start the configured server first, then run the matching test:
capcmd server --config configs/genesis/genesis_go2.yaml
python tests/genesis/test_genesis_go2.py --remoteEach scene writes runtime data beneath its configured record_dir. Depending on the control and trace level, outputs include:
history.jsonwith scene tool requests and responses- per-control execution metadata and generated code
- observations, images, and videos
- pipeline exports and training checkpoints beneath
export_dir
MIT License