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 TypeScript/JavaScript Code
Executing Shell Commands
Code Interpreter (Stateful Execution)
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
API Reference
Daytona Class
Methods
create(params?)- Create a new sandboxget(sandboxIdOrName)- Get a sandbox by ID or namelist(options?)- List sandboxes with paginationdelete(sandbox)- Delete a sandbox
Sandbox Class
Properties
fs: FileSystem- File system operations interfacegit: Git- Git operations interfaceprocess: Process- Process execution interfacecodeInterpreter: CodeInterpreter- Code interpreter interfacecomputerUse: ComputerUse- Computer use operations for desktop automationid: string- Sandbox IDstate: SandboxState- Current statelabels: Record<string, string>- Custom labelsenv: Record<string, string>- Environment variables
Methods
setLabels(labels)- Set custom labelsgetPreviewLink(port)- Get port preview URLstart()- Start the sandboxstop()- Stop the sandboxdelete()- Delete the sandboxcreateLspServer(language, workingDir)- Create an LSP server
Process Class
Methods
executeCommand(command, cwd?, env?, timeout?)- Execute a shell commandcodeRun(code, params?)- Execute code directly
FileSystem Class
Methods
uploadFile(content, path)- Upload a fileuploadFiles(files)- Upload multiple filesdownloadFile(path)- Download a filedownloadFiles(requests)- Download multiple fileslistFiles(path)- List files in a directorycreateFolder(path, mode?)- Create a foldersearchFiles(root, pattern)- Search for filesreplaceInFiles(files, oldStr, newStr)- Replace content in files
Git Class
Methods
clone(url, path, commitId?, branch?, username?, password?)- Clone a repositorystatus(path)- Get repository statusbranches(path)- List branchesadd(path, files)- Add files to stagingcommit(path, message, author, email)- Commit changespush(path, username?, password?)- Push changes
Best Practices
Always Use Try-Finally for Cleanup
Check Exit Codes
Use TypeScript for Type Safety
Handle Promise Rejections
Next Steps
SDK Overview
Compare all available SDKs
API Reference
Complete API documentation
Examples
Browse TypeScript examples on GitHub
Python SDK
Learn about the Python SDK