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

# Agent Deployment Job

> Deploy a minimal local agent project as a Nullspace job.

This example uses
`examples/python/agent_deployments/minimal_job/nullspace.agent.toml` to package a
small Python project, run it as a job, and collect declared outputs.

## Setup

```bash theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
uv pip install "nullspace-sdk[cli]==1.0.0"
export NULLSPACE_API_KEY=ns_live_...
export NULLSPACE_API_URL=https://api.your-nullspace-domain
cd examples/python/agent_deployments/minimal_job
```

## CLI

```bash theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
nullspace agent deploy .

nullspace agent run minimal-job-agent \
  --input-json '{"subject":"agent deployments"}' \
  --env EXAMPLE_AGENT_GREETING=hello \
  --json

nullspace agent logs minimal-job-agent --run adrun_123
nullspace agent outputs minimal-job-agent --run adrun_123
nullspace agent status minimal-job-agent --run adrun_123
nullspace agent delete minimal-job-agent --yes
```

Expected output includes a successful run status, a stdout line beginning with
`minimal job wrote result.json`, and output metadata for `result.json` plus
`reports/summary.txt`.

## Python

The companion `run.py` script uses the same deployment contract through the SDK:

```python theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
from pathlib import Path

from nullspace import AgentDeployment

project = Path(__file__).resolve().parent
deployment, version, manifest = AgentDeployment.deploy(path=project)
run = deployment.run(
    input={"subject": "agent deployments"},
    envs={"EXAMPLE_AGENT_GREETING": "hello"},
    retain_on_failure=True,
)
outputs = deployment.run_outputs(run.id)
print(deployment.name, version.id, len(manifest.entries), len(outputs.outputs))
```

Run the complete script:

```bash theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
python run.py
```

## Project Files

```text theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
examples/python/agent_deployments/minimal_job/
  README.md
  main.py
  run.py
  nullspace.agent.toml
```

Related: [Agent Deployments](../agents/deployments) and
[CLI reference](../reference/cli).
