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: Optional[str] = None, workspace_id: Optional[str] = None) -> CodeSession

Start (or resume) an interactive code session.

Args: project_name: Name of the project. project_description: Description of the project. project_id: Create the session's workspace inside this existing project (clones project files and mounts its volumes). workspace_id: 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).