Why agent-native is built for AI
agent-native is specifically designed for AI agent workflows. Unlike traditional automation tools built for human use, agent-native provides:- Structured, parseable output with JSON format for every command
- Stable refs (
@n1,@n2) that AI agents can track between operations - Self-contained commands that work in stateless environments
- Rich element metadata including roles, labels, actions, and accessibility attributes
- Predictable workflow patterns that match how LLMs reason about UI automation
The core workflow (snapshot → interact → re-snapshot) mirrors how AI agents naturally break down UI automation tasks.
Integration patterns
There are three main ways to integrate agent-native with AI agents:1. Tool calling / function calling
Map each agent-native command to a function/tool in your LLM framework:Python (OpenAI)
TypeScript (Vercel AI SDK)
2. Direct shell commands
For agents with shell access (like OpenCode, Aider, Claude Code):Instructions
3. MCP (Model Context Protocol) server
Create an MCP server that wraps agent-native commands:MCP server example
Example workflows
Toggle Wi-Fi in System Settings
Search and message in Slack
Fill a web form in Safari
Multi-step automation
AI agents excel at breaking down complex tasks into steps:Handling uncertainty
AI agents should handle cases where the AX tree doesn’t provide enough information:Best practices
For detailed guidance on using agent-native effectively with AI agents, see:JSON output mode
Learn about structured output formats for each command
Best practices
Essential patterns for reliable AI automation
OpenCode skill
Install the pre-built OpenCode skill for instant integration