> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# grid-nexus-program

> Author distributed robot programs in Python

Author distributed robot programs in Python — the `@program` decorator compiles a restricted Python function into a computation graph whose nodes run across cloud, edge, and your machine, wired by Zenoh topics.

## Install

```bash theme={null}
# Preinstalled in every GRID session workspace. For local use, install
# from the GRID package index with your organization's read-only
# credentials (the same pair `grid robot setup` provisions on robots):
export UV_INDEX_GRID_PYPI_USERNAME=<username>
export UV_INDEX_GRID_PYPI_PASSWORD=<token>
uv pip install grid-nexus-program --index grid-pypi=https://pypi.generalrobotics.dev/simple/
```

## Quickstart

```python theme={null}
from grid_nexus_program import Cortex, Robot, program, tick

@program()
def find_object(robot: Robot, cortex: Cortex, prompt: str):
    while tick(hz=2):
        image = robot.getImage("front")
        detections = cortex.run("owlv2", image_input=image, prompt=prompt)

# Deploy it from grid-nexus-client: connect("<robot-id>", program=find_object)
```

Deploying and monitoring a program happens through **grid-nexus-client**; model calls inside programs use the hosted models in the **Cortex Models** section.

## Classes

* [`tick`](/python-api/grid-nexus-program/tick)
* [`Sub`](/python-api/grid-nexus-program/sub)
* [`SubOnce`](/python-api/grid-nexus-program/subonce)
* [`Robot`](/python-api/grid-nexus-program/robot)
* [`ZenohProgram`](/python-api/grid-nexus-program/zenohprogram)
* [`ProgramCaptureError`](/python-api/grid-nexus-program/programcaptureerror)

## Functions

* [`program`](/python-api/grid-nexus-program/program)
* [`func`](/python-api/grid-nexus-program/func)
* [`wait`](/python-api/grid-nexus-program/wait)
* [`sequence`](/python-api/grid-nexus-program/sequence)
* [`debug_image`](/python-api/grid-nexus-program/debug_image)
* [`debug_active`](/python-api/grid-nexus-program/debug_active)


## Related topics

- [Your first skill](/get-started/first-skill.md)
- [Get started](/get-started/installation.md)
- [The Intelligence Grid for Physical AI](/introduction.md)
- [Your first session](/get-started/first-session.md)
- [GRID Cortex Client](/models/cortex.md)
