Give your OpenHome agent the ability to control your computer through OpenClaw — full setup, SDK reference, and example abilities.
OpenClaw lets your OpenHome agent control your local machine through voice — launch apps, monitor system status, manage files, run developer workflows, and more. The Ability sends a command through OpenHome’s exec_local_command() call; the OpenClaw client executes it on your machine; the result comes back as a spoken response.For a short task-oriented quickstart, see Getting Started → OpenClaw. This page is the full reference.
# Trigger: "start coding session"# Opens IDE, starts local servers, opens documentationasync def first_function(self): commands = [ "open Visual Studio Code", "start local dev server on port 3000", "open browser to localhost:3000", ] for cmd in commands: await self.capability_worker.exec_local_command(cmd) await self.capability_worker.speak("Development environment is ready.") self.capability_worker.resume_normal_flow()
# Trigger: "take screenshot of active window"async def first_function(self): user_inquiry = await self.capability_worker.wait_for_complete_transcription() if "full screen" in user_inquiry.lower(): cmd = "screenshot fullscreen save to ~/Desktop" elif "active window" in user_inquiry.lower(): cmd = "screenshot active window save to ~/Desktop" else: cmd = "screenshot selection save to ~/Desktop" response = await self.capability_worker.exec_local_command(cmd, timeout=15.0) await self.capability_worker.speak(f"Screenshot saved: {response}") self.capability_worker.resume_normal_flow()
if "restart" in user_inquiry.lower() or "shutdown" in user_inquiry.lower(): confirmed = await self.capability_worker.run_confirmation_loop( "This will restart your computer. Are you sure?" ) if not confirmed: await self.capability_worker.speak("Cancelled.") return
try: response = await self.capability_worker.exec_local_command(user_inquiry, timeout=15.0) if "error" in response.lower() or "failed" in response.lower(): await self.capability_worker.speak("That command didn't work. Try something else.") else: # process success ...except asyncio.TimeoutError: await self.capability_worker.speak("That took too long. It might still be running.")except Exception as e: self.worker.editor_logging_handler.error(f"Command failed: {e}") await self.capability_worker.speak("Something went wrong. Check the logs.")