Electron screenshot

From keybase/client · View interactive version

Electron screenshot is an AI agent skill from the GitHub repository keybase/client. This skill should be used when the user asks to "take a desktop screenshot", "screenshot the electron app", "show me the desktop app", "what does the app look like", or mentions checking the Electron/desktop UI visually.

How to use this skill

Skill file

Take a screenshot of the running Electron app with playwright-cli and display it. The playwright-cli skill's "Connecting to the Electron App" section has the details on attaching and tab selection.

Prerequisites

The Electron app must be running with remote debugging enabled:

cd shared && KB_ENABLE_REMOTE_DEBUG=1 yarn desktop:start:hot

This launches Electron with --remote-debugging-port=9222.

Steps

  1. Attach (once per session; --persistent is required for Electron):

```

PLAYWRIGHT_MCP_CDP_ENDPOINT=http://localhost:9222 playwright-cli open --persistent

```

  1. Select the main app window. Tab order is not stable, so never reuse a remembered index: run playwright-cli tab-list, playwright-cli tab-select <index> on the row whose URL contains main.html, and confirm with playwright-cli eval "location.href".
  1. Take the screenshot:

```

playwright-cli screenshot --filename=/tmp/electron-screenshot-full.png

```

  1. Resize it for token efficiency:

```

sips -Z 800 /tmp/electron-screenshot-full.png --out /tmp/electron-screenshot.png

```

  1. Use the Read tool to display /tmp/electron-screenshot.png to the user. If it shows the menubar or DevTools instead of the main window, go back to step 2.

Error Handling

Notes

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.