SDKs
Go SDK
Use the native run.cloud sandbox API from Go.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use the native run.cloud sandbox API from Go.
go get github.com/newly-app/run-cloud-go
export RUN_CLOUD_API_KEY="rc_live_..."
package main
import (
"context"
"fmt"
"log"
runcloud "github.com/newly-app/run-cloud-go"
)
func main() {
client, err := runcloud.NewClient(runcloud.ClientOptions{})
if err != nil {
log.Fatal(err)
}
box, err := client.CreateSandbox(
context.Background(),
runcloud.CreateSandboxOptions{
Image: "runcloud/agent-base",
CPU: 2,
Memory: 4096,
},
)
if err != nil {
log.Fatal(err)
}
defer box.Destroy(context.Background())
result, err := box.Exec(
context.Background(),
"go version",
runcloud.ExecOptions{},
)
if err != nil {
log.Fatal(err)
}
fmt.Print(result.Stdout)
}