Usage
Description
Brings a window to the front and gives it keyboard focus. Windows can be identified by window ID, application name, or partial title match.Parameters
Window ID from
list-windows (e.g., “w-4521”)Application name (e.g., “Safari”) — focuses the first window from this app
Window title or partial match (e.g., “Settings”) — focuses the first matching window
Response
Examples
Focus window by ID
Focus any window from app
Focus window by title
Focus window by partial title match
Chain focus with snapshot
Error Codes
WINDOW_NOT_FOUND— No window matches the specified criteriaINVALID_ARGS— No identification method provided (must specify--window-id,--app, or--title)ACTION_FAILED— Failed to bring window to front
Notes
- At least one identification parameter is required (
--window-id,--app, or--title) - If multiple windows match, the first one found is focused
- On macOS, requires Accessibility permission
- Use
list-windowsto discover available window IDs and titles