Run terminal commands on your computer through OpenHome voice — cross-platform, minimal setup.
Local Connect is a lightweight alternative to OpenClaw — a single Python script you run on your computer that executes voice-generated terminal commands. Works on Windows, macOS, and Linux.
The Ability uses a small system prompt to convert natural language into a shell command, executes it, then uses a second prompt to convert the output into a spoken response.
Tune this for your OS and use case. Default (macOS/Linux):
system_prompt = """You are a terminal command generator. Your ONLY purpose is to convert userrequests into valid shell commands.Rules:- Respond ONLY with the terminal command, nothing else- Use POSIX-compatible commands (bash/zsh)- Do not include explanations, quotes, or markdown formatting- Do not use sudo unless absolutely necessary- Make sure commands are safe and won't harm the systemExamples:User: "list all files" -> ls -laUser: "show current directory" -> pwdUser: "find python files" -> find . -name "*.py"User: "check disk space" -> df -h"""
For Windows, swap the examples to PowerShell or cmd equivalents.
async def first_function(self): user_inquiry = await self.capability_worker.wait_for_complete_transcription() if "start dev environment" in user_inquiry.lower(): await self.capability_worker.speak("Starting development environment...") commands = [ "cd ~/Projects/my-app", "code .", # Opens VS Code "npm run dev &", # Background dev server "open http://localhost:3000", # macOS — use `start` on Windows, `xdg-open` on Linux ] for cmd in commands: await self.capability_worker.exec_local_command(cmd, timeout=15.0) await self.capability_worker.speak("Development environment is ready!") self.capability_worker.resume_normal_flow()
try: response = await self.capability_worker.exec_local_command(terminal_command) if "error" in response.lower() or "permission denied" in response.lower(): await self.capability_worker.speak("That command failed. Try a different approach?") 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.")finally: self.capability_worker.resume_normal_flow()
This runs real terminal commands on your machine with your user permissions. Anyone with access to your OpenHome account can run commands via your client. Protect your API key.
ALLOWED_COMMANDS = ['ls', 'pwd', 'df', 'du', 'cat', 'grep', 'find']if not any(cmd in terminal_command for cmd in ALLOWED_COMMANDS): await self.capability_worker.speak("That command is not allowed.") return