Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.
Rust chatgptclaudeclidesktopdesktop-appelectron-alternativegeminilinuxmacosnativefierno-electronrusttauriweb-to-desktopwebsite-to-appwebviewwindowsyoutube
feat: ship pake skill via claude code plugin marketplace
Tw93e615b35b857a
diff --git a/.agents/skills/pake b/.agents/skills/pakenew file mode 120000index 00000000..5c1408b3--- /dev/null+++ b/.agents/skills/pake@@ -0,0 +1 @@+../../plugins/pake/skills/pake\ No newline at end of filediff --git a/.agents/skills/use-pake/SKILL.md b/.agents/skills/use-pake/SKILL.mddeleted file mode 100644index dc32a032..00000000--- a/.agents/skills/use-pake/SKILL.md+++ /dev/null@@ -1,188 +0,0 @@-----name: use-pake-description: "Package any website into a lightweight desktop app using Pake (Tauri/Rust). Use when the user wants to: wrap a URL as a native app, build a desktop app from a website, use Pake CLI to package a page, set up proxy for a packaged app, customize app icons or bundle IDs, or mentions 'pake', 'tauri package', 'website to app', 'wrap site'. Also trigger when the user asks about Pake CLI options, proxy configuration for packaged apps, or icon handling."-version: 1.0.0-allowed-tools:- - Bash- - Read------# 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:--| Parameter | Why it matters |-| -------------------------- | ----------------------------------------------------------------------------------------------------------------- |-| URL | The target website |-| Name | Becomes 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` |-| Icon | Auto-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--| Option | Default | Description |-| ------------------------ | ------------------ | --------------------------------- |-| `--name <string>` | — | App name |-| `--icon <string>` | auto-fetch | Icon 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>` | 1200 | Window width |-| `--height <number>` | 780 | Window height |-| `--app-version <string>` | 1.0.0 | App version |--### Window Behavior--| Option | Default | Description |-| --------------------------- | ------- | ----------------------------------------------- |-| `--fullscreen` | false | Start fullscreen |-| `--maximize` | false | Start maximized |-| `--always-on-top` | false | Pin window on top |-| `--hide-title-bar` | false | Hide macOS title bar |-| `--hide-window-decorations` | false | Hide native window decorations on Windows/Linux |--### Advanced--| Option | Default | Description |-| ----------------------------- | ------- | -------------------------------------------- |-| `--inject <files>` | — | Inject CSS/JS files (comma-separated paths) |-| `--user-agent <string>` | — | Custom user agent |-| `--debug` | false | Enable devtools and verbose logging |-| `--multi-arch` | false | Build for both Intel and Apple Silicon |-| `--multi-instance` | false | Allow multiple app instances |-| `--multi-window` | false | Multiple windows in one instance |-| `--new-window` | false | Allow popup windows (needed for OAuth flows) |-| `--safe-domain <domains>` | none | Keep trusted SSO/workspace domains in-app |-| `--incognito` | false | Private browsing mode |-| `--dark-mode` | false | Force macOS dark mode |-| `--zoom <number>` | 100 | Initial zoom level (50-200) |-| `--wasm` | false | Enable WebAssembly |-| `--enable-drag-drop` | false | Drag & drop support |-| `--camera` | false | Camera permission (macOS) |-| `--microphone` | false | Microphone permission (macOS) |-| `--ignore-certificate-errors` | false | Ignore TLS errors |-| `--targets <string>` | auto | Build target format |-| `--use-local-file` | false | Package local HTML file |--## Platform Notes--### Proxy Support--| Platform | Status | Notes |-| -------- | --------- | -------------------------------------------------------------------- |-| Windows | Full | Via `--proxy-server` browser arg |-| Linux | Full | Via `--proxy-server` browser arg |-| macOS | macOS 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.--### Linux Wayland Input Issues--If an AppImage opens but buttons cannot be clicked or keyboard input does not reach the page on a pure Wayland compositor, especially niri, first rebuild with the latest `pake-cli`. Then try the native WebKit path:--```bash-PAKE_LINUX_WEBKIT_SAFE_MODE=0 ./YourApp.AppImage-```--If that produces a blank window on the same system, re-enable the conservative WebKit workaround:--```bash-PAKE_LINUX_WEBKIT_SAFE_MODE=1 ./YourApp.AppImage-```--Do not diagnose this from GTK, appindicator, or GStreamer warnings alone; those can be optional runtime warnings unrelated to the input failure.--## 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-```diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonnew file mode 100644index 00000000..4326322d--- /dev/null+++ b/.claude-plugin/marketplace.json@@ -0,0 +1,13 @@+{+ "$schema": "https://code.claude.com/schemas/marketplace.json",+ "name": "pake",+ "owner": { "name": "tw93" },+ "description": "Pake: turn any webpage into a lightweight desktop app.",+ "plugins": [+ {+ "name": "pake",+ "source": "./plugins/pake",+ "description": "Package any website or local web build into a lightweight desktop app with Pake CLI."+ }+ ]+}diff --git a/.claude/skills/pake b/.claude/skills/pakenew file mode 120000index 00000000..f111934d--- /dev/null+++ b/.claude/skills/pake@@ -0,0 +1 @@+../../.agents/skills/pake\ No newline at end of filediff --git a/.claude/skills/use-pake b/.claude/skills/use-pakedeleted file mode 120000index aebe89d0..00000000--- a/.claude/skills/use-pake+++ /dev/null@@ -1 +0,0 @@-../../.agents/skills/use-pake\ No newline at end of filediff --git a/AGENTS.md b/AGENTS.mdindex fcd96ad5..998e7f35 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,6 +1,6 @@# AGENTS.md - Pake Project Knowledge Base-> Project-specific Rust + Tauri rules: `.claude/rules/rust.md`. Release runbook: `.agents/skills/release/SKILL.md` (run `/release`; `.claude/skills/*` are symlinks into `.agents/skills/`, edit the `.agents` copy only).+> Project-specific Rust + Tauri rules: `.claude/rules/rust.md`. Release runbook: `.agents/skills/release/SKILL.md` (run `/release`; `.claude/skills/*` are symlinks into `.agents/skills/`, edit the `.agents` copy only). Exception: the `pake` skill's real source is `plugins/pake/skills/pake/SKILL.md` (shipped to users via the Claude Code plugin marketplace, `.claude-plugin/marketplace.json`); `.agents/skills/pake` is a symlink to it.## Project Identity@@ -29,6 +29,9 @@ Pake/│ ├── cli-usage.md # CLI parameters│ ├── advanced-usage.md # Customization guide│ └── faq.md # Troubleshooting+├── schema/ # pake.schema.json: --config JSON schema (public contract)+├── plugins/ # Claude Code plugin source (user-facing pake skill)+├── llms.txt # Agent-facing contract summary (--json, --config, exit codes)├── scripts/ # Utility scripts├── tests/ # Unit, integration, and release-flow tests├── .github/workflows/ # quality/test and release automation@@ -92,9 +95,11 @@ Execution rules:## Current Risk Areas-- CLI options are user-facing and must stay synchronized across `bin/helpers/cli-program.ts`, `bin/types.ts`, `bin/defaults.ts`, `bin/helpers/merge.ts`, generated `dist/cli.js`, and `docs/cli-usage*.md`.+- CLI options are user-facing and must stay synchronized across `bin/helpers/cli-program.ts`, `bin/types.ts`, `bin/defaults.ts`, `bin/helpers/merge.ts`, generated `dist/cli.js`, `schema/pake.schema.json`, and `docs/cli-usage*.md`. Schema-to-CLI sync is enforced by `tests/unit/config-file.test.ts`; the rest is manual discipline.+- The `--json` machine contract is public API for agents: stdout carries exactly one JSON result (nothing else may write to stdout in machine mode), and the exit codes (0/2/3/4/1) plus error codes (`INVALID_INPUT`, `ENV_MISSING`, `BUILD_FAILED`, `NETWORK`, `UNEXPECTED`) must stay stable. `logger.warn` feeds the JSON `warnings` array, so warn is for real warnings only, not status lines. Owners: `bin/utils/output.ts`, `bin/cli.ts`, `bin/utils/shell.ts`.+- Local file/directory packaging stages user content into the package's own `dist/` (moving it to `dist_bak` and restoring only `cli.js`). Local build runs can strand `dev.js` and test fixtures in `dist_bak`; restore them before committing. Owner: `stageLocalTree` in `bin/helpers/merge.ts`.- New user-visible CLI surface (a new flag, alias, subcommand, or extra help variant) needs a stated justification before implementation: name the user problem and why an existing flag, config key, or default cannot cover it, then get maintainer sign-off. Prefer quieter defaults over new options; never split help output into parallel variants.-- Recent window/runtime options include `--incognito`, `--new-window`, `--min-width`, `--min-height`, `--maximize`, multi-window behavior, notification click handling, and Linux/Wayland WebKit compositing defaults.+- Window/runtime options with platform-sensitive behavior include `--incognito`, `--new-window`, `--min-width`, `--min-height`, `--maximize`, multi-window behavior, notification click handling, and Linux/Wayland WebKit compositing defaults.- `--incognito` intentionally trades persistence for clean private sessions; be careful around login, cookies, local storage, and WeChat-style WebView detection.- `--new-window` and `--multi-window` do not bypass every provider policy. Google OAuth and similar embedded-WebView restrictions may still require a normal browser or native client.- macOS auth-popup behavior is fragile. Auth/sign-in URLs that trigger WebKit `SOAuthorization` popup creation should stay in the current window when that path can abort the app; changes in `src-tauri/src/inject/event.js` need targeted tests. Apple Sign-In (`appleid.apple.com` / `AppleAuthentication` named windows) is the exception and must keep the native `window.open` popup.@@ -142,6 +147,8 @@ Four files must be updated in sync for every release:| `src-tauri/Cargo.lock` | `version` for package `pake` || `src-tauri/tauri.conf.json` | `"version"` |+A version bump must also rebuild and commit `dist/cli.js` (it embeds the package version); see Troubleshooting.+Tag format: `V<major.minor.patch>` with uppercase `V` (e.g. `V3.13.1`). Current version: check `package.json`.Find the previous release tag with `git tag --list 'V*' --sort=-version:refname | head -1`. A bare `git tag --sort` is polluted by stray non-version tags (`list`, `continuous`, `0.1.0`) and silently picks the wrong log range.@@ -173,6 +180,8 @@ For release follow-through, keep these boundaries explicit:`.github/workflows/quality-and-test.yml` runs auto-format on push, Rust quality checks, and CLI/build validation across Linux, Windows, and macOS.+Deployment-surface note: the Claude Code plugin (`.claude-plugin/marketplace.json` + `plugins/pake`) ships from `main` via git, independent of `V*` releases. Skill and manifest edits reach new installs as soon as they land on `main`; npm and app assets still wait for their release workflows.+### Network Mirror BehaviorPake uses official npm and Rust sources by default. CN mirrors are explicit opt-in only:diff --git a/plugins/pake/.claude-plugin/plugin.json b/plugins/pake/.claude-plugin/plugin.jsonnew file mode 100644index 00000000..83e6a4a6--- /dev/null+++ b/plugins/pake/.claude-plugin/plugin.json@@ -0,0 +1,7 @@+{+ "name": "pake",+ "description": "Package any website or local web build into a lightweight desktop app with Pake CLI.",+ "version": "1.0.0",+ "author": { "name": "tw93" },+ "homepage": "https://github.com/tw93/Pake"+}diff --git a/plugins/pake/skills/pake/SKILL.md b/plugins/pake/skills/pake/SKILL.mdnew file mode 100644index 00000000..24271a9f--- /dev/null+++ b/plugins/pake/skills/pake/SKILL.md@@ -0,0 +1,147 @@+---+name: pake+description: "Package any website or local web build into a lightweight desktop app using Pake (Tauri/Rust). Use when the user wants to: wrap a URL as a native app, build a desktop app from a website or a local dist/ folder, use Pake CLI to package a page, set up proxy for a packaged app, customize app icons or bundle IDs, or mentions 'pake', 'tauri package', 'website to app', 'wrap site'. Also trigger when the user asks about Pake CLI options, proxy configuration for packaged apps, or icon handling."+version: 2.0.0+allowed-tools:+ - Bash+ - Read+---++# Pake - Website to Desktop App++Pake wraps any webpage or local web build into a native desktop app via Tauri (Rust + system WebView). Output is ~5MB (vs Electron's ~150MB).++## Pick the right command first++- **Inside a Pake repository checkout** (package.json has `"name": "pake-cli"`): build once with `pnpm run cli:build`, then use `node dist/cli.js`.+- **Anywhere else**: use the published CLI. Install with `npm install -g pake-cli` and run `pake`, or run without installing via `npx pake-cli`.++All examples below use `pake`; substitute `node dist/cli.js` inside a checkout.++## Agent Mode (always use this from scripts)++Pass `--json` on every automated run: logs move to stderr and stdout carries exactly one JSON result object.++```bash+pake "https://example.com" --name MyApp --json+# stdout -> {"ok":true,"name":"MyApp","platform":"darwin","arch":"arm64",+# "outputs":[{"path":"/abs/MyApp.dmg","sizeBytes":5242880,"format":"dmg"}],+# "warnings":[],"error":null}+```++`--json` (and any non-TTY stdin) disables every interactive prompt.++### Handle results by code, not by scraping text++Exit codes: `0` success, `2` invalid input, `3` build failure, `4` missing environment or dependency setup failure, `1` unexpected. On failure `error` carries `{code, message, hint}`:++| `error.code` | What to do |+| --------------- | ----------------------------------------------------------------------------------------------- |+| `INVALID_INPUT` | Fix the flag, name, or config field named in `message`; `hint` states the accepted form |+| `ENV_MISSING` | Environment setup needed (usually Rust); relay `hint` to the user, or install and rerun |+| `BUILD_FAILED` | Rerun once with `--debug` for verbose logs; check platform notes below before changing anything |+| `NETWORK` | Retry once; if it persists, ask about proxy/network before touching build options |+| `UNEXPECTED` | Report the message upstream; do not loop on retries |++On success, report `outputs[].path` to the user; that is the installer/bundle they need. On Linux multi-target builds, `ok: true` can carry fewer outputs than requested formats (failed targets land in `warnings`); check `outputs[].format` before declaring all formats built.++## Declarative config (preferred over long flag lists)++```bash+cat > app.json <<'EOF'+{+ "$schema": "https://raw.githubusercontent.com/tw93/Pake/main/schema/pake.schema.json",+ "url": "https://example.com",+ "name": "MyApp",+ "width": 1280,+ "hideTitleBar": true+}+EOF+pake --config app.json --json+```++Fields are the camelCase CLI option names plus `url`; an explicit CLI flag wins over a config field. Unknown fields and wrong types fail fast with `INVALID_INPUT`.++For the full option list, run `pake --help` or read the schema above. Do not guess option names; the schema is the source of truth. Complete reference: https://github.com/tw93/Pake/blob/main/docs/cli-usage.md++## Local content (AI-generated apps)++Pake packages local web artifacts, not just URLs:++```bash+# A directory of static files (must contain index.html at its root)+pake ./dist --name MyTool --json++# A single HTML file+pake ./page.html --name MyPage --json+```++Hash-based routing works out of the box; history-mode SPA routing is not yet supported for local packaging.++## Workflow++### 1. Gather requirements++Confirm with the user before building:++| Parameter | Why it matters |+| -------------------------- | ----------------------------------------------------------------------------------------------------------------- |+| URL or local path | The target website or build output |+| Name | Becomes 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` |+| Icon | Auto-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+pake "<URL>" --icon /tmp/icon.png --json+```++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+- Inside a repo checkout, an old `src-tauri/icons/<name>.icns` is reused; rename or remove it to force re-fetch++### 3. Build and verify++Build takes ~40s with cache, ~2min cold; the very first build on a fresh machine compiles Tauri dependencies and can take 10+ minutes. After a successful build:++- Report the artifact path from `outputs[].path`+- Ask the user to open the app and check the icon+- Bundle ID check: `mdls -name kMDItemCFBundleIdentifier <path-to>.app` (macOS)++## Platform notes++### Proxy support++| Platform | Status | Notes |+| -------- | --------- | -------------------------------------------------------------------- |+| Windows | Full | Via `--proxy-server` browser arg |+| Linux | Full | Via `--proxy-server` browser arg |+| macOS | macOS 14+ | Uses Tauri native `macos-proxy` feature; auto-detected at build time |++### Chrome extensions++Not supported. Pake uses the 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.++### OAuth-dependent sites++`--new-window` allows popup auth windows and `--safe-domain` keeps SSO callbacks in-app, but some providers (especially Google) block sign-in inside embedded webviews regardless of flags. Warn the user before promising OAuth support.++### Linux Wayland input issues++If an AppImage opens but clicks or keyboard input do not reach the page on a pure Wayland compositor (especially niri), first rebuild with the latest `pake-cli`, then try the native WebKit path:++```bash+PAKE_LINUX_WEBKIT_SAFE_MODE=0 ./YourApp.AppImage+```++If that produces a blank window on the same system, re-enable the conservative workaround with `PAKE_LINUX_WEBKIT_SAFE_MODE=1`. Do not diagnose this from GTK, appindicator, or GStreamer warnings alone; those are often unrelated optional runtime warnings.