Computer use

From vm0-ai/vm0-skills · View interactive version

Computer use is an AI agent skill from the GitHub repository vm0-ai/vm0-skills. Operate apps on a desktop host through Computer Use, whether surfaced as Okou Desktop or the still-supported legacy Zero Desktop, when APIs are not enough. Not for remote browser sessions (`okou browser use`), surfaced as Okou Browser or legacy Zero Browser.

How to use this skill

Skill file

Computer Use

Overview

Use okou computer-use <command> to inspect and operate apps on the connected desktop host. Current clients present this as Okou Desktop; still-supported legacy clients may call it Zero Desktop. Treat it as an accessibility-first GUI control surface: read the app state, act through accessibility elements, and inspect screenshots only when visual information is required or the accessibility state is insufficient.

--app accepts an app bundle id only, such as com.apple.Safari or com.google.Chrome. App names like Safari, Google Chrome, Slack, or WeChat are display labels only and must not be passed to --app.

Core Workflow

  1. List apps and choose the target app's bundleId:
okou computer-use list-apps

Use the name field only to identify the app for yourself, then copy the bundleId field. Apps listed without a bundleId cannot be targeted.

  1. Set the bundle id you found:
app_bundle_id="com.apple.Safari"
  1. If the app is not running, open it by bundle id:
okou computer-use open-app --app "$app_bundle_id" --timeout 10
  1. Inspect the target app by bundle id:
okou computer-use get-app-state --app "$app_bundle_id" --timeout 10
  1. Read the JSON result:
  1. Act on elements first, using the same bundle id and snapshot:
okou computer-use click --app "$app_bundle_id" --snapshot-id <snapshotId> --element-index <index>
okou computer-use set-value --app "$app_bundle_id" --snapshot-id <snapshotId> --element-index <index> --value "text"
okou computer-use type-text --app "$app_bundle_id" --snapshot-id <snapshotId> --text "literal text"
okou computer-use press-key --app "$app_bundle_id" --snapshot-id <snapshotId> --key Command+L
okou computer-use scroll --app "$app_bundle_id" --snapshot-id <snapshotId> --element-index <index> --direction down --pages 1
  1. Re-read state after every meaningful UI change. Element indexes and coordinates can become stale after navigation, scrolling, or opening a new window.

If a post-action command returns a new snapshotId and appState, use that new snapshot. Otherwise, explicitly run get-app-state again before choosing the next element index or coordinate.

Accessibility-First Policy

App Identity Rules

To search the list-apps output for a likely target:

apps_json=/tmp/computer-use-apps.json
okou computer-use list-apps > "$apps_json"
node -e "const fs=require('fs'); const q=(process.argv[2]||'').toLowerCase(); const apps=JSON.parse(fs.readFileSync(process.argv[1],'utf8')).apps || []; for (const a of apps) { if (!q || String(a.name || '').toLowerCase().includes(q)) console.log([a.name || '', a.bundleId || 'NO_BUNDLE_ID', a.running ? 'running' : 'not running'].join('\t')); }" "$apps_json" "Slack"

Copy the exact bundleId from the matching row into app_bundle_id.

Reading App State

Accessibility trees can be very large. Prefer the appState file returned by the command:

app_bundle_id="com.apple.Safari"
state_json=/tmp/computer-use-state.json
okou computer-use get-app-state --app "$app_bundle_id" --timeout 10 > "$state_json"
app_state_path=$(node -e "const fs=require('fs'); const r=JSON.parse(fs.readFileSync(process.argv[1],'utf8')); console.log(r.appState)" "$state_json")
rg -n "Ethan|showcase|sites\\.vm0|Send now" "$app_state_path"

If the CLI still returns inline app state instead of a path, use the transition workaround:

state_json=/tmp/computer-use-state.json
okou computer-use get-app-state --app "$app_bundle_id" --timeout 10 > "$state_json"
node -e "const fs=require('fs'); const s=JSON.parse(fs.readFileSync(process.argv[1],'utf8')).appState; s.split('\\n').forEach((l,i)=>{ if(/Ethan|showcase|sites\\.vm0|Send now/.test(l)) console.log((i+1)+': '+l) })" "$state_json"

Use filtered output to locate clickable link, button, text field, checkbox, or outline row entries and their element indexes.

Action Rules

Browser Pattern

After clicking a link from another app:

  1. Use list-apps to find the browser bundle id, such as com.apple.Safari, com.google.Chrome, or the Arc bundle id returned by the host.
  2. Read or filter the browser appState for the address field, page title, links, controls, and focused element.
  3. Use press-key --app <browserBundleId> --snapshot-id <snapshotId> --key Command+L plus type-text and Enter when direct navigation is faster than finding a link.
  4. Inspect the screenshot only when the task depends on layout, design, images, canvas content, or another detail that the accessibility tree does not represent reliably.

Failure Handling

Reporting Back

State what was actually done through Computer Use: apps inspected by bundle id, whether screenshot fallback was needed, and whether actions succeeded. If a desktop action times out or the host is unavailable, say that directly and use a stable fallback only when it still satisfies the user request.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.