Caveman Cloud· Hosted & VPCSDKs
Go SDK: Manage Caveman Cloud, Agents, and Sandboxes
Install github.com/caveman-ai/sdk-go to call Caveman Cloud operations, drive Agent sessions, and manage Firecracker Sandboxes from Go.
github.com/caveman-ai/sdk-go is the standalone Go client for Caveman Cloud, Agents, and Firecracker Sandboxes. It ships with typed inputs and outputs generated from the public OpenAPI contracts.
Install#
go get github.com/caveman-ai/sdk-goCall Caveman Cloud operations#
package main
import (
"context"
"fmt"
"os"
caveman "github.com/caveman-ai/sdk-go"
)
func main() {
ctx := context.Background()
client := caveman.NewCloud(caveman.CloudConfig{
ControlURL: "https://api.caveman.so",
Token: os.Getenv("CAVE_TOKEN"),
})
projects, err := client.Projects.List(ctx, caveman.ProjectsListInput{})
if err != nil {
panic(err)
}
fmt.Printf("Found %d projects\n", len(projects.Projects))
}Run commands in a Firecracker Sandbox#
package main
import (
"context"
"fmt"
"os"
caveman "github.com/caveman-ai/sdk-go"
)
func main() {
ctx := context.Background()
sandboxes, err := caveman.NewSandboxes(caveman.SandboxesConfig{
ControlURL: "https://api.caveman.so",
APIKey: os.Getenv("CAVE_TOKEN"),
})
if err != nil {
panic(err)
}
sb, err := sandboxes.Create(ctx, caveman.CreateSandboxInput{
Name: "go-worker",
Size: "2cpu-4gb",
})
if err != nil {
panic(err)
}
defer sandboxes.Delete(ctx, sb.ID)
out, err := sandboxes.Exec(ctx, sb.ID, []string{"uname", "-a"})
if err != nil {
panic(err)
}
fmt.Print(out.Stdout)
}Next steps#
Sandbox CLI & SDKs
Full sandbox lifecycle, snapshots, forks, and port forwarding.
cvm CLI Reference
Inspect schemas and test operations interactively from the terminal.