Skip to content

Environment Reference

Environment variables are deployment-time overrides. Structured runtime parameters should usually be passed through PluginConfig.

The generator entry packages/generator/main.js loads the package-local .env file before requiring the bundled host code. Use that file for local Photoshop Generator launches; existing process environment variables are not overwritten.

VariableRequiredPurposeDefault
PS_BRIDGE_PORTNoOverrides the generator service port when valid.7700
PS_BRIDGE_PLUGINSNoOrdered absolute plugin package paths.none
PS_BRIDGE_PLUGINS_DIRNoDirectory whose direct children are plugin packages.package-local plugins/
PS_BRIDGE_LOG_DIRNoDirectory for generator runtime logs.package-local logs/
PS_BRIDGE_SESSION_RESUME_TTL_MSNoUnexpected-disconnect resume TTL in milliseconds.1800000
PS_BRIDGE_COS_SECRET_IDCOS onlyTencent Cloud COS secret id.none
PS_BRIDGE_COS_SECRET_KEYCOS onlyTencent Cloud COS secret key.none
PS_BRIDGE_COS_BUCKETCOS onlyTencent Cloud COS bucket.none
PS_BRIDGE_COS_REGIONCOS onlyTencent Cloud COS region.none
PS_BRIDGE_COS_KEY_PREFIXNoObject key prefix for COS uploads.ps-bridge/exports
PS_BRIDGE_COS_URL_EXPIRESNoSigned URL lifetime in seconds.315360000

PS_BRIDGE_PLUGINS is a platform-delimited list (; on Windows, : on POSIX). These explicit packages load before PluginConfig.plugins and the collection selected by pluginsDir / PS_BRIDGE_PLUGINS_DIR. Paths must be absolute; empty and duplicate real paths are ignored.

COS Enablement

COS upload support is enabled only when these four variables are all present and non-empty:

text
PS_BRIDGE_COS_SECRET_ID
PS_BRIDGE_COS_SECRET_KEY
PS_BRIDGE_COS_BUCKET
PS_BRIDGE_COS_REGION

When COS is not enabled, image results use inline data URLs.

Invalid Port

PS_BRIDGE_PORT must be an integer from 1 to 65535. Invalid values are ignored and logged as warnings.

PS_BRIDGE_SESSION_RESUME_TTL_MS must be a non-negative integer. Invalid values are ignored and logged as warnings.

CLI Environment

PS_GENERATOR_REMOTE_PASSWORD supplies the Photoshop Remote Connections password for setup-photoshop, setup-generator-settings, run, and dev. An explicit --password takes precedence; when neither is provided, the CLI uses password. This variable is read by the CLI process and is separate from the generator package-local .env loading described above.