Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

docs: add shortcuts, scripts and agents, and contributing pages

Tw93794a999ba017
diff --git a/docs/README.md b/docs/README.md
index d7b2c10f..117d2227 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -14,11 +14,13 @@ Guides and reference documentation for building lightweight desktop apps with Pa
- **[CLI Command Reference](cli-usage.md)**: Full command-line options and examples
- **[GitHub Actions Online Build](github-actions-usage.md)**: Build apps online without a local toolchain
- **[Pake Action Integration](pake-action.md)**: Use Pake as a GitHub Action in CI workflows
+- **[Scripts and AI Agents](ai-agents.md)**: JSON output, config files and the official skill
+- **[Keyboard Shortcuts](shortcuts.md)**: Shortcuts in every app Pake builds
## Developer Guides
- **[Advanced Usage & Development](advanced-usage.md)**: Code customization, project structure, build environments, and testing
-- **[Contributing Guide](../CONTRIBUTING.md)**: How to develop and contribute to Pake
+- **[Contributing](contributing.md)**: Pull requests, gallery recipes and the trademark policy
## Resources
diff --git a/docs/README_CN.md b/docs/README_CN.md
index 6aeef5cc..ab5711bf 100644
--- a/docs/README_CN.md
+++ b/docs/README_CN.md
@@ -14,11 +14,13 @@ Pake 应用打包与开发的参考指南。
- **[CLI 命令参考](cli-usage_CN.md)**:完整命令行参数说明与基础用法
- **[GitHub Actions 在线构建](github-actions-usage_CN.md)**:无需本地环境的在线构建方式
- **[Pake Action 集成](pake-action_CN.md)**:在 CI 工作流中使用 Pake 进行自动化打包
+- **[脚本与 AI 智能体](ai-agents_CN.md)**:JSON 输出、配置文件和官方 skill
+- **[快捷键](shortcuts_CN.md)**:Pake 打包的应用里都能用的快捷键
## 开发指南
- **[高级用法与开发](advanced-usage_CN.md)**:代码自定义、项目结构、开发环境配置与测试指南
-- **[贡献指南](../CONTRIBUTING.md)**:如何参与 Pake 开发
+- **[参与贡献](contributing_CN.md)**:提交 PR、推荐精选网站和商标政策
## 相关资源
diff --git a/docs/ai-agents.md b/docs/ai-agents.md
new file mode 100644
index 00000000..42446253
--- /dev/null
+++ b/docs/ai-agents.md
@@ -0,0 +1,45 @@
+# Scripts and AI Agents
+
+<div align="center">
+
+**English** · [中文](ai-agents_CN.md)
+
+</div>
+
+Pake has a machine-readable mode, so a script or an AI agent can package an app and read the result without parsing build logs.
+
+## What to use
+
+- [`--json`](cli-usage.md#json): stdout carries exactly one JSON result, every log line goes to stderr, and interactive prompts are off. The same section lists the exit codes and error codes.
+- [`--config app.json`](cli-usage.md#config): describe the app in a file instead of a row of flags. Fields are the camelCase option names plus `url`, checked against the [published schema](../schema/pake.schema.json), and a flag on the command line wins over the file.
+- `pake ./dist --name MyTool`: package local build output directly. The folder needs an `index.html` at its root.
+
+```bash
+pake --config app.json --json
+```
+
+## The agent contract
+
+[llms.txt](../llms.txt) sums up what an agent needs in one page: the JSON shape, exit codes, config rules and the platform notes. The copy that ships with the latest release is at `https://unpkg.com/pake-cli@latest/llms.txt`.
+
+## Install the skill
+
+The official Pake skill teaches Claude Code and Codex the steps above.
+
+```text
+# Claude Code
+/plugin marketplace add tw93/Pake
+/plugin install pake@pake
+
+# Codex
+codex plugin marketplace add tw93/Pake
+codex plugin add pake@pake
+```
+
+## A prompt to start with
+
+Without the skill, paste this to your agent and fill in the last line:
+
+```text
+Use Pake (npm i -g pake-cli) to package webpages as desktop apps. Read https://unpkg.com/pake-cli@latest/llms.txt first; always run pake with --json and parse stdout as a single JSON object. Package <url-or-local-dist> into an app named <AppName>.
+```
diff --git a/docs/ai-agents_CN.md b/docs/ai-agents_CN.md
new file mode 100644
index 00000000..cc1665ba
--- /dev/null
+++ b/docs/ai-agents_CN.md
@@ -0,0 +1,45 @@
+# 脚本与 AI 智能体
+
+<div align="center">
+
+[English](ai-agents.md) · **中文**
+
+</div>
+
+Pake 有一套机器可读的模式,脚本或 AI 智能体可以直接打包应用、读取结果,不用去解析构建日志。
+
+## 用到的三样东西
+
+- [`--json`](cli-usage_CN.md#json):stdout 只输出一个 JSON 结果,日志全部走 stderr,交互式提问也会关掉,退出码和错误码在同一节里。
+- [`--config app.json`](cli-usage_CN.md#config):把应用写进一个文件,不用拼一长串参数。字段是驼峰写法的参数名加上 `url`,按[公开的 schema](../schema/pake.schema.json) 校验,命令行上显式给的参数优先于文件里的值。
+- `pake ./dist --name MyTool`:直接打包本地构建产物,目录根部要有 `index.html`。
+
+```bash
+pake --config app.json --json
+```
+
+## 智能体约定
+
+[llms.txt](../llms.txt) 用一页讲清智能体需要知道的内容,包括 JSON 结构、退出码、配置规则和各平台的注意事项。随最新版本发布的那一份在 `https://unpkg.com/pake-cli@latest/llms.txt`。
+
+## 安装 skill
+
+官方的 Pake skill 会教 Claude Code 和 Codex 按上面的方式来做。
+
+```text
+# Claude Code
+/plugin marketplace add tw93/Pake
+/plugin install pake@pake
+
+# Codex
+codex plugin marketplace add tw93/Pake
+codex plugin add pake@pake
+```
+
+## 拿来就用的提示词
+
+没装 skill 的话,把下面这段发给你的智能体,填好最后一句就行:
+
+```text
+用 Pake(npm i -g pake-cli)把网页打包成桌面应用。先阅读 https://unpkg.com/pake-cli@latest/llms.txt,运行 pake 时始终加 --json 并把 stdout 解析为单个 JSON 对象。把 <url-or-local-dist> 打包成名为 <AppName> 的应用。
+```
diff --git a/docs/contributing.md b/docs/contributing.md
new file mode 100644
index 00000000..488dc172
--- /dev/null
+++ b/docs/contributing.md
@@ -0,0 +1,36 @@
+# Contributing
+
+<div align="center">
+
+**English** · [中文](contributing_CN.md)
+
+</div>
+
+Pull requests for fixes, docs, examples and suggestions are welcome. For a new feature, open an [issue](https://github.com/tw93/Pake/issues) first so we can talk about whether it is needed; a typo or a clearer sentence can go straight to a pull request.
+
+## Working on the code
+
+All work happens on `main`, and pull requests go to `main` too. [Development workflow](advanced-usage.md#development-workflow) covers the toolchain, the project layout and the commands. The two you will use most:
+
+```bash
+# Run the CLI and the app together, the quickest loop for CLI changes
+pnpm run cli:dev -- https://web.telegram.org/k/
+
+# Build the CLI, run the test suite, then the real build smoke tests
+pnpm test
+```
+
+## Proposing a site for the gallery
+
+The Pake apps for Mac and Windows show a gallery of sites that work well as desktop apps. Each one is a small recipe in [`gallery/apps`](https://github.com/tw93/Pake/tree/main/gallery/apps), and anyone can propose one:
+
+1. Package the site with the Pake CLI and use it for a few days: sign in, open links, download a file, and check that you are still signed in after a restart.
+2. Add `gallery/apps/<id>.json`. Leave the window options out unless one fixed a problem you saw, and keep injected CSS or JavaScript to the smallest change that fixes it.
+3. Run `npx vitest run tests/unit/gallery.test.ts`.
+4. Open a pull request that says what you tested and on which platform.
+
+Describe what the site does in plain words, without ratings or slogans. Sites that need a paid account are fine; sites that mainly serve ads or ask for another service's credentials are not accepted. Every field is explained in the [gallery guide](../gallery/README.md).
+
+## Name and logo
+
+The code license covers the code, not the brand. If you publish a fork or a product built on Pake, give it your own name and icon, and do not suggest that it is endorsed by Pake. The full text is in the [trademark policy](../TRADEMARK.md).
diff --git a/docs/contributing_CN.md b/docs/contributing_CN.md
new file mode 100644
index 00000000..b9b89c7e
--- /dev/null
+++ b/docs/contributing_CN.md
@@ -0,0 +1,36 @@
+# 参与贡献
+
+<div align="center">
+
+[English](contributing.md) · **中文**
+
+</div>
+
+欢迎提交修复、文档、示例和建议的 PR。新功能先开一个 [issue](https://github.com/tw93/Pake/issues) 聊聊有没有必要做,错别字或者把一句话写得更清楚,直接提 PR 就行。
+
+## 改代码
+
+所有开发都在 `main` 上进行,PR 也提到 `main`。环境准备、项目结构和常用命令都在[开发工作流](advanced-usage_CN.md#开发工作流)里,最常用的是这两条:
+
+```bash
+# 同时跑 CLI 和应用,改 CLI 时最快的调试方式
+pnpm run cli:dev -- https://web.telegram.org/k/
+
+# 构建 CLI,跑测试,再跑真实构建的冒烟测试
+pnpm test
+```
+
+## 推荐网站进精选
+
+Mac 和 Windows 版 Pake 里有一个精选,放的是适合做成桌面应用的网站。每个网站对应 [`gallery/apps`](https://github.com/tw93/Pake/tree/main/gallery/apps) 里一份很小的配方,谁都可以推荐:
+
+1. 先用 Pake CLI 把网站打包出来用几天,登录一下,点开几个链接,下载一个文件,重启后看看是否还保持登录。
+2. 新增 `gallery/apps/<id>.json`,窗口参数只在确实解决了问题时才加,注入的 CSS 或 JavaScript 也只做最小的改动。
+3. 运行 `npx vitest run tests/unit/gallery.test.ts`。
+4. 提一个 PR,写清楚测了什么、在哪个平台上测的。
+
+描述就用大白话写网站是做什么的,不写评分和口号。需要付费账号的网站可以收,主要靠广告的网站、要你填别家服务账号密码的网站不收。每个字段的说明见[精选配方说明](../gallery/README.md)。
+
+## 名字和图标
+
+开源协议管的是代码,不管品牌。发布 Pake 的分支或基于它做的产品时,请用自己的名字和图标,也不要暗示它得到了 Pake 的认可,完整内容见[商标政策](../TRADEMARK.md)。
diff --git a/docs/shortcuts.md b/docs/shortcuts.md
new file mode 100644
index 00000000..e3de138b
--- /dev/null
+++ b/docs/shortcuts.md
@@ -0,0 +1,40 @@
+# Keyboard Shortcuts
+
+<div align="center">
+
+**English** · [中文](shortcuts_CN.md)
+
+</div>
+
+Every app Pake builds has these shortcuts, on top of the ones the website itself defines.
+
+| Mac | Windows and Linux | Action |
+| --------- | ----------------- | ----------------------------------- |
+| `⌘ [` | `Ctrl [` | Go back |
+| `⌘ ]` | `Ctrl ]` | Go forward |
+| `⌘ ↑` | `Ctrl ↑` | Scroll to the top of the page |
+| `⌘ ↓` | `Ctrl ↓` | Scroll to the bottom of the page |
+| `⌘ R` | `Ctrl R` | Reload the page |
+| `⌘ W` | `Ctrl W` | Hide the window without quitting |
+| `⌘ -` | `Ctrl -` | Zoom out |
+| `⌘ =` | `Ctrl =` | Zoom in |
+| `⌘ 0` | `Ctrl 0` | Reset zoom |
+| `⌘ L` | `Ctrl L` | Copy the current page URL |
+| `⌘ ⇧ ⌥ V` | `Ctrl Shift V` | Paste and match style |
+| `⌘ ⇧ H` | `Ctrl Shift H` | Go to the home page |
+| `⌘ ⇧ ⌫` | `Ctrl Shift Del` | Clear the cache and restart |
+| `⌃ ⌘ F` | `F11` | Toggle fullscreen |
+| `⌘ ⌥ I` | `Ctrl Shift I` | Toggle developer tools (debug only) |
+
+## Shortcuts that need an option
+
+| Mac | Windows and Linux | Action | Build with |
+| ------- | ----------------- | --------------------- | --------------------------------------------- |
+| `⌘ F` | `Ctrl F` | Find in the page | [`--enable-find`](cli-usage.md#enable-find) |
+| `⌘ G` | `Ctrl G` | Find the next match | [`--enable-find`](cli-usage.md#enable-find) |
+| `⌘ ⇧ G` | `Ctrl Shift G` | Find the previous one | [`--enable-find`](cli-usage.md#enable-find) |
+| `⌘ N` | | Open a new window | [`--multi-window`](cli-usage.md#multi-window) |
+
+## Mouse and trackpad
+
+Double-click the title bar to toggle fullscreen. On Mac, swipe to go back or forward and drag the title bar to move the window; the menu bar also has navigation, zoom and window controls. On Windows and Linux, [`--hide-window-decorations`](cli-usage.md#hide-window-decorations) gives a frameless window with a drag region at the top.
diff --git a/docs/shortcuts_CN.md b/docs/shortcuts_CN.md
new file mode 100644
index 00000000..a453d6b2
--- /dev/null
+++ b/docs/shortcuts_CN.md
@@ -0,0 +1,40 @@
+# 快捷键
+
+<div align="center">
+
+[English](shortcuts.md) · **中文**
+
+</div>
+
+Pake 打包出来的每个应用都带下面这些快捷键,网站自己定义的快捷键照常可用。
+
+| Mac | Windows 和 Linux | 功能 |
+| --------- | ---------------- | -------------------------- |
+| `⌘ [` | `Ctrl [` | 返回上一页 |
+| `⌘ ]` | `Ctrl ]` | 前进到下一页 |
+| `⌘ ↑` | `Ctrl ↑` | 滚动到页面顶部 |
+| `⌘ ↓` | `Ctrl ↓` | 滚动到页面底部 |
+| `⌘ R` | `Ctrl R` | 刷新页面 |
+| `⌘ W` | `Ctrl W` | 隐藏窗口,不退出应用 |
+| `⌘ -` | `Ctrl -` | 缩小页面 |
+| `⌘ =` | `Ctrl =` | 放大页面 |
+| `⌘ 0` | `Ctrl 0` | 重置缩放 |
+| `⌘ L` | `Ctrl L` | 复制当前页面网址 |
+| `⌘ ⇧ ⌥ V` | `Ctrl Shift V` | 粘贴并匹配样式 |
+| `⌘ ⇧ H` | `Ctrl Shift H` | 回到首页 |
+| `⌘ ⇧ ⌫` | `Ctrl Shift Del` | 清除缓存并重启 |
+| `⌃ ⌘ F` | `F11` | 切换全屏 |
+| `⌘ ⌥ I` | `Ctrl Shift I` | 开关开发者工具(仅调试版) |
+
+## 需要打包参数的快捷键
+
+| Mac | Windows 和 Linux | 功能 | 打包时加上 |
+| ------- | ---------------- | ------------ | ------------------------------------------------ |
+| `⌘ F` | `Ctrl F` | 在页面中查找 | [`--enable-find`](cli-usage_CN.md#enable-find) |
+| `⌘ G` | `Ctrl G` | 查找下一个 | [`--enable-find`](cli-usage_CN.md#enable-find) |
+| `⌘ ⇧ G` | `Ctrl Shift G` | 查找上一个 | [`--enable-find`](cli-usage_CN.md#enable-find) |
+| `⌘ N` | | 打开新窗口 | [`--multi-window`](cli-usage_CN.md#multi-window) |
+
+## 鼠标和触控板
+
+双击标题栏可以切换全屏。Mac 上可以用手势滑动返回和前进,拖动标题栏移动窗口,菜单栏里也有导航、缩放和窗口控制。Windows 和 Linux 上加 [`--hide-window-decorations`](cli-usage_CN.md#hide-window-decorations) 会得到无边框窗口,顶部留一块拖拽区域。