Computer use agent
Skill kjuhwa/skills-hub/skills/integration/computer-use-agent
Build an agent that controls a computer (screenshots, clicks, keyboard) using ComputerTool.From its SKILL.md
npx -y skills add kjuhwa/skills-hub --skill computer-use-agentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.6 KB, 481 tokens by cl100k_base, as published. Nobody here has run it
computer-use-agent
Use ComputerTool with a Computer implementation to give an agent the ability to take screenshots, click, type, and navigate a computer environment.
When to apply
Browser automation, desktop GUI testing, or any task requiring interaction with a visual computer interface. Used with models that support computer use (e.g., computer-use-preview).
Core snippet
import asyncio
from agents import Agent, Runner
from agents.tool import ComputerTool
from agents.computer import AsyncComputer
class MyComputer(AsyncComputer):
async def screenshot(self) -> str:
"""Return base64-encoded PNG screenshot."""
# Implement using pyautogui, Playwright, etc.
return take_screenshot_base64()
async def click(self, x: int, y: int, button: str = "left") -> None:
"""Click at coordinates."""
pyautogui.click(x, y, button=button)
async def type(self, text: str) -> None:
"""Type text."""
pyautogui.write(text)
async def key(self, key: str) -> None:
"""Press a key combination."""
pyautogui.hotkey(*key.split("+"))
@property
def dimensions(self) -> tuple[int, int]:
return (1920, 1080)
@property
def environment(self) -> str:
return "mac" # "windows" | "linux" | "mac"
async def main():
agent = Agent(
name="Computer operator",
instructions="Complete the task using the computer.",
tools=[ComputerTool(computer=MyComputer())],
model="computer-use-preview",
)
result = await Runner.run(agent, "Open a browser and navigate to python.org")
print(result.final_output)
asyncio.run(main())
Key notes
- Must implement
AsyncComputer(orComputerfor sync); required methods:screenshot,click,type,key,dimensions,environment - Use models that support computer use (check OpenAI model docs)
ComputerToolhandles the low-level protocol; yourComputerimpl handles actual execution- For sandboxed environments,
SandboxAgentwithcapabilitiesmay be more appropriate
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.