Install
PS Generator Bridge is a monorepo with three published packages:
@ps-generator-bridge/sdk: isomorphic client SDK and protocol contract@ps-generator-bridge/generator: Photoshop Generator plugin and WebSocket service@ps-generator-bridge/cli: command-line tools, including a Windows smoke harness for Photoshop andgenerator-core
Requirements
- Node.js 18 or newer
- pnpm 11.5.0 for repository development
- Photoshop with Generator support for real Photoshop runs
- Windows for the
@ps-generator-bridge/clirun/dev smoke commands
Repository Setup
pnpm install
pnpm setuppnpm setup prepares Adobe generator-core and the latest published generator runtime in the shared per-user cache. On Windows it lives under %LOCALAPPDATA%\ps-generator-bridge; repository-local core checkouts are ignored.
The published generator runtime is a standalone Windows x64 package. Its JavaScript runtime dependencies are bundled, while sharp and its native vendor files remain package-private. The CLI rejects legacy dependency-based or incomplete native caches before launch.
Generator Runtime Install
Users do not need to clone this repository to install the Photoshop Generator runtime. Run the published CLI directly:
pnpm dlx @ps-generator-bridge/cli setupBy default this installs the minimal runtime into ./generator-bridge. Pass --dir to choose another location:
pnpm dlx @ps-generator-bridge/cli setup --dir D:\Tools\generator-bridgeRe-running setup updates installer-managed files while preserving package-local .env, logs/, plugins/, and other user-owned files. It refuses to replace a non-empty directory that is not a managed runtime.
On Windows, the CLI can also install the runtime into a selected Photoshop installation:
pnpm dlx @ps-generator-bridge/cli setup-photoshop
pnpm dlx @ps-generator-bridge/cli setup-photoshop --version 2025 --yessetup-photoshop requires Photoshop to be closed and installs to <Photoshop install dir>\Plug-ins\Generator\generator-bridge. It atomically updates only the existing MachinePrefs.psp entries needed to enable Generator and Remote Connections, without creating a backup. The Remote Connections password comes from --password, PS_GENERATOR_REMOTE_PASSWORD, or the default password. Managed runtime updates preserve .env, logs/, plugins/, and other user-owned files. If the target contains unmanaged files, the command asks before replacing it; --yes authorizes that replacement without prompting.
SDK Consumer Install
npm install @ps-generator-bridge/sdkIf the Node runtime does not provide a global WebSocket (for example, Node 18), install and inject ws:
npm install wsimport { Connection } from "@ps-generator-bridge/sdk";
import WebSocket from "ws";
const connection = new Connection({
WebSocket: WebSocket as unknown as typeof globalThis.WebSocket,
});Development Commands
pnpm build
pnpm typecheck
pnpm test
pnpm format:checkFocused package checks:
pnpm --filter @ps-generator-bridge/sdk test
pnpm --filter @ps-generator-bridge/generator test
pnpm --filter @ps-generator-bridge/cli typecheck