Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/minimal-agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.11-slim

WORKDIR /app
COPY example_agent.py /app

RUN useradd -m agent && chown -R agent:agent /app
USER agent

CMD ["python", "example_agent.py"]

13 changes: 13 additions & 0 deletions examples/minimal-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Minimal Example Agent

A tiny example showing how to run an agent inside a container:
- Creates `input.txt` if missing
- Reads it, uppercases content
- Writes the result to `output.txt`

## Run

### Linux/macOS
```bash
docker build -t cua-agent-example examples/minimal-agent
docker run --rm -v $(pwd)/examples/minimal-agent:/app cua-agent-example
22 changes: 22 additions & 0 deletions examples/minimal-agent/example_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os

INPUT_FILE = "input.txt"
OUTPUT_FILE = "output.txt"

def run_agent():
if not os.path.exists(INPUT_FILE):
with open(INPUT_FILE, "w") as f:
f.write("Hello from Cua!\n")

with open(INPUT_FILE, "r") as f:
data = f.read()

processed = data.upper()

with open(OUTPUT_FILE, "w") as f:
f.write(processed)

print(f"Processed file written to {OUTPUT_FILE}")

if __name__ == "__main__":
run_agent()
1 change: 1 addition & 0 deletions examples/minimal-agent/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello from Cua!
1 change: 1 addition & 0 deletions examples/minimal-agent/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HELLO FROM CUA!