The Process API provides endpoints for executing commands, managing pseudo-terminal (PTY) sessions, shell sessions, and interpreter contexts within Daytona sandboxes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/daytonaio/daytona/llms.txt
Use this file to discover all available pages before exploring further.
Command Execution
Execute Command
Execute a shell command synchronously and return the output.| Field | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Shell command to execute |
cwd | string | No | Working directory for command execution |
timeout | integer | No | Timeout in seconds (default: 10) |
PTY Sessions
Pseudo-terminal (PTY) sessions provide interactive terminal access with WebSocket support.Create PTY Session
Create a new PTY session for interactive terminal access.List PTY Sessions
Get all active PTY sessions.Get PTY Session
Get information about a specific PTY session.Connect to PTY Session
Establish a WebSocket connection for interactive terminal access.Resize PTY Session
Change the terminal dimensions.rows: Terminal height (1-1000)cols: Terminal width (1-1000)
Delete PTY Session
Terminate and delete a PTY session.Shell Sessions
Shell sessions allow executing multiple commands within the same session context.Create Session
Create a new shell session.List Sessions
Get all active shell sessions.Get Session
Get details of a specific session.Execute in Session
Execute a command within an existing session.Get Session Command
Get details of a specific command in a session.Get Command Logs
Get logs for a specific command. Supports WebSocket streaming.follow: Stream logs in real-time via WebSocket (boolean)
Send Input to Command
Send input to a running interactive command.Delete Session
Delete a shell session.Interpreter Contexts
Manage isolated code interpreter contexts for executing code.Create Interpreter Context
Create a new isolated interpreter context.List Interpreter Contexts
Get all user-created interpreter contexts.Execute Code
Execute code in an interpreter context via WebSocket.Delete Interpreter Context
Delete an interpreter context.Best Practices
- Set appropriate timeouts for long-running commands
- Clean up sessions when no longer needed
- Use WebSocket connections for real-time output streaming
- Handle exit codes to detect command failures
- Specify working directory to ensure commands run in correct context
Example Usage
Prefer using the official Daytona SDKs over direct API calls for better type safety and error handling.