Back to Pake

Pake - Website to Desktop App

.agents/skills/use-pake/SKILL.md

3.11.87.1 KB
Original Source

Pake - Website to Desktop App

Pake wraps any webpage into a native desktop app via Tauri (Rust + system WebView). Output is ~5MB (vs Electron's ~150MB). Run the commands below from the root of this Pake repository.

Quick Start

bash
# Build the CLI once (produces dist/cli.js); skip if dist/ already exists
pnpm run cli:build

node dist/cli.js "<URL>" --name <AppName> [options]

Workflow

1. Gather Requirements

Before running the build, confirm these with the user:

ParameterWhy it matters
URLThe target website
NameBecomes the .app / .exe name and productName
Bundle ID (--identifier)Defaults to com.pake.a{md5hash} — set explicitly for clean installs (e.g. com.pake.youtube)
Proxy (--proxy-url)Baked into the binary at build time; not runtime-configurable. Format: http://host:port or socks5://host:port
IconAuto-fetched from website if omitted; can be a local path or URL

2. Handle Icons

Pake auto-fetches icons from multiple services (logo.dev, brandfetch, clearbit, Google favicons, direct favicon.ico). However:

The icon download does NOT use --proxy-url. That flag only configures the packaged app's WebView proxy. If the icon URL requires a proxy to reach (e.g. Google/GitHub assets from China), download it manually first:

bash
curl -x http://<proxy-host>:<proxy-port> -o /tmp/icon.png "<icon-url>" --connect-timeout 15 -s

Then pass the local file:

bash
node dist/cli.js "<URL>" --icon /tmp/icon.png ...

Icon tips:

  • Prefer 256x256 or larger PNGs; SVG also works
  • Pake auto-converts to platform format: .icns (macOS), .ico (Windows), .png (Linux)
  • macOS icons get a squircle mask automatically
  • If an old icon exists in src-tauri/icons/<name>.icns, Pake reuses it — rename/remove it to force re-fetch

3. Build

bash
node dist/cli.js "<URL>" \
  --name <AppName> \
  --identifier <com.pake.xxx> \
  --proxy-url "http://host:port" \
  --icon /path/to/icon.png

Build takes ~40s with cache, ~2min cold. Output: <AppName>.dmg in the project root.

4. Verify

After build, confirm:

  • DMG path printed in output
  • Icon correctness (user should open and check)
  • Bundle ID via: mdls -name kMDItemCFBundleIdentifier <path-to>.app

CLI Options Reference

Common Options

OptionDefaultDescription
--name <string>App name
--icon <string>auto-fetchIcon path (local file or URL)
--identifier <string>com.pake.a{hash}Bundle ID / app identifier
--proxy-url <url>WebView proxy (http/https/socks5)
--width <number>1200Window width
--height <number>780Window height
--app-version <string>1.0.0App version

Window Behavior

OptionDefaultDescription
--fullscreenfalseStart fullscreen
--maximizefalseStart maximized
--always-on-topfalsePin window on top
--hide-title-barfalseHide macOS title bar

Advanced

OptionDefaultDescription
--inject <files>Inject CSS/JS files (comma-separated paths)
--user-agent <string>Custom user agent
--debugfalseEnable devtools and verbose logging
--multi-archfalseBuild for both Intel and Apple Silicon
--multi-instancefalseAllow multiple app instances
--multi-windowfalseMultiple windows in one instance
--new-windowfalseAllow popup windows (needed for OAuth flows)
--incognitofalsePrivate browsing mode
--dark-modefalseForce macOS dark mode
--zoom <number>100Initial zoom level (50-200)
--wasmfalseEnable WebAssembly
--enable-drag-dropfalseDrag & drop support
--camerafalseCamera permission (macOS)
--microphonefalseMicrophone permission (macOS)
--ignore-certificate-errorsfalseIgnore TLS errors
--targets <string>autoBuild target format
--use-local-filefalsePackage local HTML file

Platform Notes

Proxy Support

PlatformStatusNotes
WindowsFullVia --proxy-server browser arg
LinuxFullVia --proxy-server browser arg
macOSmacOS 14+Uses Tauri native macos-proxy feature; auto-detected at build time

Chrome Extensions

Not supported. Pake uses system WebView (WKWebView on macOS, WebView2 on Windows, WebKitGTK on Linux), not a full Chrome browser. Use --inject to add custom JS/CSS as an alternative.

Common Patterns

Website behind proxy (icon also needs proxy)

bash
# Step 1: Download icon via proxy
curl -x http://127.0.0.1:7890 -o /tmp/icon.png "<icon-url>" -s

# Step 2: Build with local icon
node dist/cli.js "https://example.com" \
  --name MyApp \
  --identifier com.pake.myapp \
  --proxy-url "http://127.0.0.1:7890" \
  --icon /tmp/icon.png

Force icon re-fetch

bash
# Remove cached icon, then build without --icon
mv src-tauri/icons/<name>.icns src-tauri/icons/<name>.icns.bak
node dist/cli.js "https://example.com" --name MyApp

OAuth-dependent site

bash
node dist/cli.js "https://accounts.google.com" \
  --name GoogleApp \
  --new-window \
  --ignore-certificate-errors