AptlyStar

Daytona

Run code and commands in secure cloud sandboxes

使用说明

Integrate Daytona into your workflow to run AI-generated code in secure, isolated sandboxes. Create and manage sandboxes, execute shell commands, run Python, JavaScript, or TypeScript code, transfer files, and clone Git repositories.

工具

daytona_create_sandbox

Create a new Daytona sandbox for running AI-generated code in isolation

输入

参数类型必填描述
apiKeystring是Daytona API key
snapshotstring否ID or name of the snapshot to create the sandbox from (uses default if empty)
namestring否Name for the sandbox (defaults to the sandbox ID)
targetstring否Region where the sandbox will be created (e.g., us, eu)
userstring否User associated with the sandbox
envjson否Environment variables to set in the sandbox as key-value pairs
labelsjson否Labels to attach to the sandbox as key-value pairs
cpunumber否CPU cores to allocate to the sandbox
memorynumber否Memory to allocate to the sandbox in GB
disknumber否Disk space to allocate to the sandbox in GB
autoStopIntervalnumber否Auto-stop interval in minutes (0 disables auto-stop)
autoArchiveIntervalnumber否Auto-archive interval in minutes (0 uses the maximum interval)
autoDeleteIntervalnumber否Auto-delete interval in minutes (negative disables, 0 deletes immediately on stop)
publicboolean否Whether the sandbox HTTP preview is publicly accessible

输出

参数类型描述
sandboxjsonThe created sandbox

daytona_list_sandboxes

List Daytona sandboxes in the organization

输入

参数类型必填描述
apiKeystring是Daytona API key
limitnumber否Maximum number of sandboxes to return (1-200)
namestring否Filter sandboxes by name prefix (case-insensitive)
labelsjson否Filter sandboxes by labels as key-value pairs
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
sandboxesarraySandboxes in the organization
nextCursorstringCursor for the next page of results

daytona_get_sandbox

Get details of a Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID or name of the sandbox

输出

参数类型描述
sandboxjsonThe sandbox details

daytona_start_sandbox

Start a stopped Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID or name of the sandbox

输出

参数类型描述
sandboxjsonThe started sandbox

daytona_stop_sandbox

Stop a running Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID or name of the sandbox

输出

参数类型描述
sandboxjsonThe stopped sandbox

daytona_delete_sandbox

Delete a Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID or name of the sandbox

输出

参数类型描述
sandboxjsonThe deleted sandbox

daytona_execute_command

Execute a shell command inside a Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID of the sandbox to execute the command in
commandstring是Shell command to execute
cwdstring否Working directory for the command (defaults to the sandbox working directory)
envjson否Environment variables to set for the command as key-value pairs
timeoutnumber否Timeout in seconds (defaults to 10 seconds)

输出

参数类型描述
exitCodenumberExit code of the command (-1 if missing from the response)
resultstringCombined stdout/stderr output of the command

daytona_run_code

Run Python, JavaScript, or TypeScript code inside a Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID of the sandbox to run the code in
codestring是Code to run
languagestring是Language of the code: python, javascript, or typescript
envjson否Environment variables to set for the run as key-value pairs
timeoutnumber否Timeout in seconds (defaults to 10 seconds)

输出

参数类型描述
exitCodenumberExit code of the code run (-1 if missing from the response)
resultstringCombined stdout/stderr output of the code run
artifactsjsonArtifacts produced by the run (e.g., matplotlib charts)

daytona_upload_file

Upload a file to a Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID of the sandbox to upload the file to
destinationPathstring是Destination path in the sandbox (a trailing slash uploads into that directory using the file name)
filefile否The file to upload
fileContentstring否Legacy: base64 encoded file content
fileNamestring否Optional file name override

输出

参数类型描述
uploadedPathstringPath of the uploaded file in the sandbox
namestringName of the uploaded file
sizenumberSize of the uploaded file in bytes

daytona_download_file

Download a file from a Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID of the sandbox to download the file from
filePathstring是Path of the file in the sandbox

输出

参数类型描述
filefileDownloaded file stored in execution files
namestringName of the downloaded file
mimeTypestringMIME type of the downloaded file
sizenumberSize of the downloaded file in bytes

daytona_list_files

List files in a directory of a Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID of the sandbox to list files in
pathstring否Directory path to list (defaults to the sandbox working directory)

输出

参数类型描述
filesarrayFiles and directories at the given path
↳ namestringFile or directory name
↳ isDirbooleanWhether the entry is a directory
↳ sizenumberSize in bytes
↳ modestringFile mode string
↳ permissionsstringPermission string
↳ ownerstringOwning user
↳ groupstringOwning group
↳ modifiedAtstringLast modification timestamp

daytona_git_clone

Clone a Git repository into a Daytona sandbox

输入

参数类型必填描述
apiKeystring是Daytona API key
sandboxIdstring是ID of the sandbox to clone the repository into
urlstring是URL of the Git repository to clone
pathstring是Path in the sandbox to clone the repository into
branchstring否Branch to clone (defaults to the default branch)
commitIdstring否Specific commit to check out after cloning
usernamestring否Username for authenticating to private repositories
passwordstring否Password or personal access token for private repositories

输出

参数类型描述
repoUrlstringURL of the cloned repository
clonePathstringPath the repository was cloned into

On this page