Skip to content
niyongshengPublic

Repository files navigation

PinShell

English · 简体中文

Release Platform

logo

A real-time desktop window built for AI. PinShell gives agents an always-on-top HTML interface on the user's screen for real-time communication, presentation, questions, and responses. The interface is built with HTML/CSS/JS; PinShell itself is only a lightweight native shell (NSPanel + WKWebView).

Website · Download · Templates

Nov-23-2026.12-19-15.mp4

Features

  • Always-on-top HTML overlay across Spaces, with click-through, opacity, radius, and hot reload.
  • Two display modes: a Desktop Overlay pinned to the screen, or a Menu Bar Popover anchored below the menu-bar icon (left-click to show, right-click for the menu).
  • MCP server and CLI share one control socket; pages can push events back to the agent.
  • Control console (⌃⌥C): the template library, local templates with live preview and editor, General settings, MCP setup, command-line setup with a downloadable Agent Skill, shortcuts, and About.
  • Online template library: eleven first-party templates (badges, goals, todo list, system monitor, desktop pet, pomodoro, decision maker, vinyl radio, gomoku, stock board, workday calendar) with per-template versions, checksums, and install/update/ignore actions in the console. Add other HTTPS libraries in Console → General → Template Libraries; all sources merge into one library page. The workday calendar is bundled on first install so the app stays usable without the online library; install the others from the console.
  • Menu-bar only, no Dock icon; update check against GitHub Releases, with in-app installer download (SHA-256 verified) handed off to the system Installer, then an automatic restart into the new version.

Install

Download PinShell-<version>-mac-universal.pkg from Releases, or use the stable alias https://github.com/niyongsheng/PinShell/releases/latest/download/PinShell.pkg.

The .pkg installs to /Applications and clears quarantine. Builds are ad-hoc signed, not notarized; if macOS blocks it, use System Settings → Privacy & Security → Open Anyway or:

xattr -dr com.apple.quarantine ~/Downloads/PinShell-*.pkg

Build

macOS 13+ with Xcode command-line tools.

make build      # release binary
make run        # build, assemble, launch
make install    # install to /Applications and launch
make pkg        # package build/PinShell.pkg (run make app first)
make universal  # arm64 + x86_64
make site       # build the website and template catalog into website/public
make serve-site # build and preview the site at http://127.0.0.1:8000

Usage

Launch PinShell, then use the menu-bar icon:

Menu item Shortcut Action
Console ⌃⌥C Open the console
Display Mode ▸ ⌃⌥D Switch between Desktop Overlay and Menu Bar Popover
Window Position ▸ Place the overlay in a screen corner
Window State: Interactive / Passthrough ⌃⌥T Toggle click-through
Window Shown / Window Hidden ⌃⌥P Toggle the overlay (switch on = shown)
Check for Updates… ⌘U Check GitHub Releases; download and install updates
Quit PinShell ⌘Q Quit

Global shortcuts work in any app and can be changed in Console → Shortcuts; the Check for Updates and Quit shortcuts only apply while the menu is open.

In Desktop Overlay mode, click and type inside the overlay; hold ⌘ and drag to move it; resize from the bottom-right grip (min 80×40). Passthrough sends mouse events to the app below.

In Menu Bar Popover mode, left-click the icon to show or hide the template below it (with no template loaded, left-click opens this menu), and right-click (or Control-click) for this menu. The template stays anchored to the icon: window position, click-through, ⌘-drag and resizing are disabled. Launching PinShell or switching back from another app does not open the panel until you click the icon; applying a template or an explicit CLI/MCP show opens it.

MCP

Open Console → MCP to copy the config, or add it manually:

{
  "mcpServers": {
    "pinshell": {
      "command": "/Applications/PinShell.app/Contents/MacOS/PinShell",
      "args": ["mcp"]
    }
  }
}

Tools cover window and content (pinshell_html, pinshell_show, pinshell_set, pinshell_status, pinshell_close), page interaction (pinshell_eval, pinshell_emit, pinshell_poll_events, pinshell_await_event, pinshell_state), and templates (pinshell_templates and pinshell_template_*). MCP prompts package common workflows; the server and CLI share ~/Library/Application Support/PinShell/control.sock.

Desktop pet

Install desktop-pet.html from Console (⌃⌥C) → Online Template Library first. It keeps itself alive with moods, idle behaviors, petting, and sleep, and an agent can drive it over the event channel. Page events are queued for the next agent poll; the pet cannot start a turn.

PinShell emit pet:hello '{"name":"Claude"}'
PinShell emit pet:mood '{"mood":"thinking"}'
PinShell emit pet:task '{"label":"Running tests","progress":0.4,"status":"running"}'
PinShell emit pet:say '{"text":"Two cases left","mood":"working"}'
PinShell emit pet:celebrate '{"text":"All green 🎉"}'

Agent events: pet:hello, pet:say, pet:mood, pet:task, pet:animate, pet:celebrate, pet:alert, pet:reset. Page events: pet:ready, pet:tap, pet:pet, pet:sleep, pet:wake. The pet's AI badge lights only while an agent is blocked in pinshell_await_event / pinshell_poll_events; it has no chat input, and page events wait in the queue until the agent next polls. The pet-companion MCP prompt wires the whole loop up.

CLI

If the app is not running, the command launches it and waits for the control socket.

PinShell show ./panel.html --watch
PinShell eval 'document.querySelector("#status").textContent = "done"'
PinShell emit agent:message '{"text":"next step"}'
PinShell listen --json
PinShell mcp

The console's CLI page can install PinShell into ~/.local/bin and download a ready-to-use SKILL.md for shell-capable agents.

Run PinShell --help for commands, options, and exit codes.

HTML authoring

Local file:// files only. Use html, body { background: transparent; overflow: hidden; }; relative CSS/JS/images in the same folder work. Hold ⌘ to drag the window; audio autoplay is allowed.

Window metadata (applied before load, re-applied on show/reload):

<title>Subscriber Goal</title>
<meta name="description" content="Shows the subscriber goal and current progress">
<meta name="pinshell:size" content="280x64">
<meta name="pinshell:position" content="bottom-right">
<meta name="pinshell:passthrough" content="false">
<meta name="pinshell:opacity" content="0.85">
<meta name="pinshell:radius" content="18">
<meta name="pinshell:order" content="10">

Position accepts top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right, or x,y. CLI flags override metadata for the session. pinshell:order is not a window property; it only controls the template library sort order.

Templates live in PinShell's templates folder, where design-tokens.css and pinshell-i18n.js are seeded by the app. Reuse those shared tokens for the design system.

Templates

The official online library is generated from website/templates. To build a template, see the template contribution guide.

License

Apache License 2.0