Go SDK
Use the Go SDK to manage OpenShell resources from Go applications, operators, and controllers. Its typed subclients follow familiar Kubernetes client patterns. Use the SDK and gateway from the same OpenShell release when possible.
Install the SDK
The SDK requires Go 1.25.13 or later. Add it to your Go module:
Connect to a Gateway
Pass a host:port address to NewClient. For a local gateway that allows
unauthenticated plaintext connections:
For an authenticated TLS gateway, provide the bearer token and TLS settings:
Omit CAFile to use system roots. For renewable OIDC service credentials, use
oidc.NewClientCredentialsAuth from
github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/oidc.
Create and Use a Sandbox
Resource methods take an explicit workspace. The following example creates a
sandbox in default, waits for readiness, runs a command, and requests
deletion:
The root client also exposes subclients for providers, services, files, SSH, TCP forwarding, policy, configuration, templates, and workspaces. List methods return lazy pagers so callers choose when to fetch the next page.
Next Steps
- Review Gateway Authentication before connecting a service to a production gateway.
- Review API Errors for the gateway error model.
- Browse the Go package reference for all exported types and methods.