Create a new session on a remote resource
The pw session create command creates a new session on a remote resource.
Supported session types:
By default, the command returns immediately after creating the session. Use --wait to wait for the session to be running before exiting. --open and --connect imply --wait.
Resource names can be specified in the following formats:
pw sessions create --type TYPE <resource> [flags]
pw session create --type desktop workspace
# Create a desktop session on a resource
pw session create --type desktop my-cluster
# Create a VS Code session
pw session create --type vscode my-cluster
# Create a tunnel session forwarding a remote port
pw session create --type tunnel --remote-port 8080 my-cluster
# Create and immediately open in the browser
pw session create --type desktop --open my-cluster
# Create a session with a custom name
pw session create --type tunnel --name my-tunnel --remote-port 8080 my-cluster
# Create and immediately connect (port forward)
pw session create --type tunnel --connect --port 8080 --remote-port 3000 my-cluster
--connect Connect (port forward) after creation (desktop and tunnel only, implies --wait)
-h, --help help for create
--name string Custom session name (default: <type>_<timestamp>)
--open Open the session in the browser after creation (implies --wait)
--port int Local port for --connect (0 = auto-select)
--remote-host string Remote host for tunnel type (default "localhost")
--remote-port int Remote port (required for tunnel type)
--type string Session type: desktop, vscode, tunnel (required)
--wait Wait for the session to be running before exiting
--context string The context to use. Overrides PW_CONTEXT environment variable and current context from config.
--platform-host string The Parallel Works ACTIVATE platform host to use. Will override any other platform host settings.
-v, --verbose Enable verbose logging