Parallel Works

pw sessions create

Create a new session on a remote resource

Synopsis

The pw session create command creates a new session on a remote resource.

Supported session types:

  • desktop - VNC desktop session
  • vscode - VS Code server session
  • tunnel - TCP port tunnel (requires --remote-port)

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:

  • workspace or user-workspace - your user workspace
  • pw://username/name - full format with explicit username
  • pw://name - managed cluster by name in your organization
  • name - short format where username defaults to your username
pw sessions create --type TYPE <resource> [flags]

Examples

  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 VS Code session opening a specific directory
  pw session create --type vscode --directory '~/projects' 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

Options

      --connect              Connect (port forward) after creation (desktop and tunnel only, implies --wait)
      --directory string     Directory to open in VS Code
  -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

Options inherited from parent commands

      --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

SEE ALSO