Skip to main content

Code Sessions

Interactive code execution sessions.

Access it as client.code_sessions on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.

Methods​

Core​

create​

create(*, project_name: str, project_description: str, project_id: str | None = None, workspace_id: str | None = None) -> CodeSession

Start (or resume) an interactive code session.

Parameters

  • project_name (str): Name of the project.
  • project_description (str): Description of the project.
  • project_id (str | None, optional): Create the session's workspace inside this existing project (clones project files and mounts its volumes).
  • workspace_id (str | None, optional): Attach to this existing code-session-enabled workspace instead of creating a new one.

retrieve​

retrieve(session_id: str) -> CodeSession

Retrieve the state of a code session.

delete​

delete(session_id: str) -> None

Terminate and delete a code session. Raises on failure; returns nothing.

Lifecycle & actions​

deploy​

deploy(session_id: str) -> dict[str, Any]

Materialize the session's code as a deployable app or workflow.

Other​

output​

output(session_id: str, **params) -> CodeSessionOutput

Poll buffered stdout/stderr from the session.

send_input​

send_input(session_id: str, *, text: str) -> dict[str, Any]

Send text input to the session's terminal (PTY).