Skip to content

Add optional Electron desktop packaging with bundled mini-bash#202

Open
yeyan00 wants to merge 1 commit into
agegr:mainfrom
yeyan00:desktop-electron-mini-bash
Open

Add optional Electron desktop packaging with bundled mini-bash#202
yeyan00 wants to merge 1 commit into
agegr:mainfrom
yeyan00:desktop-electron-mini-bash

Conversation

@yeyan00

@yeyan00 yeyan00 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

This adds an optional Electron desktop wrapper for Pi Web while leaving the existing web/CLI runtime unchanged.

Closes #201.

What changed

  • Added electron/main.cjs desktop launcher that:
    • starts the existing Next.js server locally,
    • opens it in an Electron BrowserWindow,
    • defaults PI_CODING_AGENT_DIR to Electron userData/agent,
    • supports --agent-dir <path> and --portable,
    • adds bundled Windows mini-bash to PATH when present,
    • initializes desktop settings.json.shellPath to bundled bash.exe when no valid shell path exists.
  • Added desktop packaging scripts:
    • desktop:dev
    • desktop:pack
    • desktop:dist
  • Added electron-builder config for a Windows x64 portable exe.
  • Added vendor/mini-bash for Windows bash/coreutils support.
  • Documented desktop packaging and runtime behavior in English and Chinese READMEs.

Validation

  • node_modules/.bin/tsc --noEmit
  • npm run desktop:dist
  • Smoke-tested unpacked app with:
    • dist-desktop/win-unpacked/Pi Web.exe --portable --port 30142
    • confirmed http://127.0.0.1:30142/ returns 200 OK
    • confirmed portable data dir and settings.json.shellPath point at bundled mini-bash

Notes

  • The desktop wrapper is optional and does not change the existing npm CLI/browser flow.
  • Bundled mini-bash covers common bash/coreutils commands, but does not include Git, Node, npm, or npx.
  • Git/worktree functionality still requires Git on PATH.
  • Skill install/search may still require Node/npm/npx.
  • The committed mini-bash binaries may require additional license/third-party notice review before merging/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add optional Electron desktop packaging with Windows mini-bash support

1 participant