PsyCloud

Interoperability

PsyCloud's authoring surfaces — Studio, the Python SDK, the R SDK, and imports from other frameworks — all converge on one bundle format. That shared format is what makes round-tripping possible.

The common artifact

Whatever you author with, the result is a bundle: a set of JSON artifacts (bundle.json, designProgram.json, screenProgram.json, bindings.json, and optionally counterbalancePolicy.json) plus any assets. The runtime, Studio, and the CLI all read this same format, so a study's source (Studio vs. code) doesn't change how it runs.

Code → Studio

A bundle authored with psycloudpy or psycloudr can be opened in Studio:

  1. Write the bundle

    write_bundle(...) (R) or write_bundle(...) / pc_bundle_write(...) (Python) emits the bundle directory.

  2. Import it

    In Studio, choose New Study → Import bundle (.zip from psycloudr / psycloudpy), or use the Import page. Studio reads the design program and bindings and builds an editable study.

  3. Keep editing visually

    From there it's a normal Studio study — preview, launch, and monitor as usual.

Studio → Code

You can also go the other direction. The CLI's export-code command generates idiomatic SDK code from an imported study or bundle, in any of the three languages:

# Generate Python (psycloudpy)
psycloud export-code ./study.json --lang python -o design.py
 
# Generate R (psycloudr)
psycloud export-code ./study.json --lang r -o design.R
 
# Or all surfaces at once
psycloud export-code ./study --lang all -o ./export/

The output uses the fluent style of each SDK (Python method chaining, R |> pipelines, or the @psycloud/authoring-ts contract helpers), so it's a real starting point you can keep editing in code.

Stable IDs and provenance

Bundles carry stable IDs and provenance through these conversions, so a study keeps its identity as it moves between Studio and code. Round-tripping is for collaboration and reuse — not every hand-tuned visual nuance is guaranteed to survive a full code → Studio → code loop, so treat generated code as a faithful starting point rather than a byte-exact mirror.

Validate anywhere with the CLI

Because the format is shared, the same CLI commands work on any bundle regardless of how it was authored:

psycloud validate ./my-study      # structural validation
psycloud inspect  ./my-study      # show the design/screens/bindings
psycloud compile  ./my-study      # compile to a runnable Study Bundle

This is what lets you put authoring in CI: generate a bundle from code, validate and compile it, and fail the build on any regression.

Next