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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ kernel

# QA testing directories
qa-*


__pycache__
3 changes: 2 additions & 1 deletion pkg/templates/python/openai-computer-use/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Copy this file to .env and fill in your API key
# Copy this file to .env and fill in your API keys
OPENAI_API_KEY=your_openai_api_key_here
KERNEL_API_KEY=your_kernel_api_key_here
29 changes: 26 additions & 3 deletions pkg/templates/python/openai-computer-use/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
# Kernel Python Sample App - OpenAI Computer Use

This is a Kernel application that demonstrates using the Computer Use Agent (CUA) from OpenAI.
This is a Kernel application that demonstrates using the Computer Use Agent (CUA) from OpenAI with Kernel's native browser control API.

It generally follows the [OpenAI CUA Sample App Reference](https://github.com/openai/openai-cua-sample-app) and uses Playwright via Kernel for browser automation.
It uses Kernel's computer control endpoints (screenshot, click, type, scroll, batch, etc.) and includes a `batch_computer_actions` tool that executes multiple actions in a single API call for lower latency.

See the [docs](https://www.kernel.sh/docs/quickstart) for more information.
## Local testing

You can test against a remote Kernel browser without deploying:

```bash
cp .env.example .env
# Fill in OPENAI_API_KEY and KERNEL_API_KEY in .env
uv run run_local.py
# JSONL event output
uv run run_local.py --output jsonl
```

The local runner defaults to human-readable logs (`text`). Use `--output jsonl` for one structured event per line (including backend events). Add `--debug` to include verbose in-flight events.

## Deploy to Kernel

```bash
kernel deploy main.py --env-file .env
kernel invoke python-openai-cua cua-task -p '{"task":"go to https://news.ycombinator.com and list top 5 articles"}'
# JSONL logs for invocation
kernel invoke python-openai-cua cua-task -p '{"task":"go to https://news.ycombinator.com and list top 5 articles","output":"jsonl"}'
```

See the [docs](https://www.kernel.sh/docs/quickstart) for more information.
Loading
Loading