Installation
Quick Start
Configuration
Using Environment Variables
Set the following environment variables:Using Configuration Object
Sandbox Management
Creating Sandboxes
Basic Sandbox Creation
Customized Sandbox Creation
Listing Sandboxes
Getting a Sandbox
Sandbox Lifecycle
Setting Labels
Code Execution
Running Ruby Code
Executing Shell Commands
File Operations
Uploading Files
Downloading Files
File System Operations
Git Operations
Cloning Repositories
Git Status and Branches
Committing Changes
Language Server Protocol
Starting an LSP Server
Code Intelligence
Stopping LSP Server
Error Handling
Complete Example
Working with Rails
API Reference
Daytona Class
Methods
create(params = {})- Create a new sandboxget(sandbox_id_or_name)- Get a sandbox by ID or namelist(options = {})- List sandboxes with paginationdelete(sandbox)- Delete a sandboxstart(sandbox)- Start a stopped sandboxstop(sandbox)- Stop a running sandbox
Sandbox Class
Properties
fs- FileSystem operations interfacegit- Git operations interfaceprocess- Process execution interfaceid- Sandbox IDstate- Current statelabels- Custom labels (readable and writable)env- Environment variables
Methods
get_preview_link(port)- Get port preview URL
Process Class
Methods
exec(command:, cwd: nil, timeout: nil)- Execute a shell commandcode_run(code:, params: nil)- Execute code directly
FileSystem Class
Methods
upload_file(content, path)- Upload a fileupload_files(files)- Upload multiple filesdownload_file(path)- Download a filedownload_files(requests)- Download multiple fileslist_files(path)- List files in a directorycreate_folder(path, mode: '755')- Create a foldersearch_files(root, pattern)- Search for filesreplace_in_files(files, old_str, new_str)- Replace content in files
Git Class
Methods
clone(url, path, options = {})- Clone a repository- Options:
:branch,:username,:password
- Options:
status(path)- Get repository statusbranches(path)- List branchesadd(path, files)- Add files to stagingcommit(path, message, author, email)- Commit changespush(path, options = {})- Push changes- Options:
:username,:password
- Options:
Best Practices
Always Use Begin-Ensure for Cleanup
Check Exit Codes
Use Symbols for Hash Keys
Use Heredocs for Multi-line Code
Integration Examples
Sinatra Application
Background Job (Sidekiq)
Rake Task
Next Steps
SDK Overview
Compare all available SDKs
API Reference
Complete API documentation
Examples
Browse Ruby examples on GitHub
Python SDK
Learn about the Python SDK