Documentation
¶
Overview ¶
Package vxsdk is the official Go SDK for the vxcloud platform.
It provides a typed, ergonomic client over the FastAPI control plane at api.vxcloud.io (Infinity) and per-tenant nodes (e.g. node1.vxcloud.io).
The SDK is preview / research quality. It is additive to existing tooling — vxcli, the API gateway, and the FastAPI backend are not modified by this package. External Go services may import it via:
go get github.com/prodxcloud/vxcloud@latest
Basic usage ¶
c, err := vxsdk.New(ctx,
vxsdk.WithAPIKey("xc_dev_..."),
vxsdk.WithUsername("joelwembo"),
)
if err != nil { return err }
pipelines, err := c.CICD().Pipelines().List(ctx)
Auth precedence ¶
If WithAPIKey is provided, the SDK exchanges it for a JWT on first call and caches both. Subsequent requests carry both Authorization: Bearer and X-API-Key headers — the same pattern vxcli uses today, which keeps the SDK compatible with all existing FastAPI auth dependencies without requiring any backend change.
Index ¶
- Constants
- type Client
- func (c *Client) AgentControl() *agentcontrol.Client
- func (c *Client) Agents() *agents.Client
- func (c *Client) Authenticate(ctx context.Context) error
- func (c *Client) Billing() *billing.Client
- func (c *Client) CICD() *cicd.Client
- func (c *Client) Chat() *chat.Client
- func (c *Client) Cloud() *cloud.Client
- func (c *Client) Deploy() *deploy.Client
- func (c *Client) InfinityURL() string
- func (c *Client) Install() *install.Client
- func (c *Client) Marketplace() *marketplace.Client
- func (c *Client) MetalDB() *metaldb.Client
- func (c *Client) Networks() *networks.Client
- func (c *Client) NodeURL() string
- func (c *Client) Nodes() *nodes.Client
- func (c *Client) Observability() *observability.Client
- func (c *Client) Robotic() *robotic.Client
- func (c *Client) Services() *services.Client
- func (c *Client) Sessions() *sessions.Client
- func (c *Client) TenantID() string
- func (c *Client) VxChrono() *vxchrono.Client
- func (c *Client) VxComputer() *vxcomputer.Client
- func (c *Client) Whoami() auth.User
- func (c *Client) Workflow() *workflow.Client
- func (c *Client) Workspace() *workspace.Client
- type Option
- func WithAPIKey(apiKey string) Option
- func WithHTTPClient(h *http.Client) Option
- func WithInfinityURL(u string) Option
- func WithJWT(access, refresh string) Option
- func WithNodeURL(u string) Option
- func WithTenantID(id string) Option
- func WithTimeout(d time.Duration) Option
- func WithUserAgent(ua string) Option
- func WithUsername(u string) Option
Constants ¶
const Version = "0.1.0-preview"
Version is the SDK version string. Bumped manually on tag.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the entry point of the SDK. Construct one with New, hold it for the life of your process, and acquire resource modules with the methods Sessions(), CICD(), etc.
Client is safe for concurrent use by multiple goroutines.
func LoadFromVxcli ¶
LoadFromVxcli is a convenience constructor that reads ~/.vxcloud/credentials.json (the file `vxcli auth login` writes) and returns a Client using the same identity. opts may add overrides.
func New ¶
New constructs a Client. At least one of WithAPIKey or WithJWT must be supplied — or LoadFromVxcli (which reads ~/.vxcloud/credentials.json).
The constructor does not perform a network round-trip. The first method call on a resource module triggers credential exchange if needed.
func (*Client) AgentControl ¶
func (c *Client) AgentControl() *agentcontrol.Client
AgentControl returns the AgentControl module — fine-tuning, training, knowledge bases, datasets, server-side agents, and GitHub import.
Every AgentControl call sends an X-Tenant-ID header. The tenant id is taken from WithTenantID / LoadFromVxcli; override per use by setting the returned client's TenantID field.
func (*Client) Agents ¶
Agents returns the AI-agent resource module (coding/devops/git/ parallel/presets/tool/tools).
func (*Client) Authenticate ¶
Authenticate proactively exchanges the configured API key for a fresh JWT pair. Optional — the SDK refreshes automatically on the first 401 — but useful for fail-fast startup checks.
func (*Client) InfinityURL ¶
InfinityURL returns the control-plane base URL the Client is targeting.
func (*Client) Marketplace ¶
func (c *Client) Marketplace() *marketplace.Client
Marketplace returns the agents/models/solutions resource module.
func (*Client) MetalDB ¶
MetalDB returns the MetalDB module — self-managed PostgreSQL provisioned over SSH onto a customer VM (test-connection + provision).
func (*Client) Networks ¶
Networks returns the network-diagnostic resource module — list and remote-execute the embedded scripts (DNS, bandwidth, port checks, security audits).
func (*Client) Nodes ¶
Nodes returns the tenant-node management resource module.
Note: nodes endpoints live on the Infinity control plane (not on a per-tenant node), so the InfinityURL is used.
func (*Client) Observability ¶
func (c *Client) Observability() *observability.Client
Observability returns the backups + migrations + sync module.
func (*Client) Robotic ¶
Robotic returns the Robotic control-cloud module — register robots, send commands, push telemetry, request plans, issue fleet commands.
func (*Client) Services ¶
Services returns the lifecycle plane: start/stop/restart/remove a container, plus host-level operations under c.Services().VM().
Mirrors the `vxcli services` CLI surface.
func (*Client) TenantID ¶
TenantID returns the tenant id used for the agentcontrol surface. Empty unless set via WithTenantID or loaded by LoadFromVxcli.
func (*Client) VxChrono ¶
VxChrono returns the VxChrono module — the autonomous goal executor and scheduler (goals, cron/interval schedules, run lifecycle).
func (*Client) VxComputer ¶
func (c *Client) VxComputer() *vxcomputer.Client
VxComputer returns the VXCOMPUTER control-plane module — the node-local policy-governed agent runtime (Plan→Act→Reflect loop, risk policy, signed approvals, hash-chained audit ledger).
type Option ¶
type Option func(*config)
Option configures a Client. Use WithAPIKey, WithJWT, WithBaseURL, etc.
func WithAPIKey ¶
WithAPIKey authenticates the client using a developer API key ("xc_dev_*", "xc_test_*", or "xc_live_*"). The key is exchanged for a short-lived JWT on first call and cached for the lifetime of the Client.
func WithHTTPClient ¶
WithHTTPClient supplies a custom *http.Client. Use this to inject a transport with mTLS, custom proxies, or test fakes. The SDK still applies its own retry/timeout policy on top.
func WithInfinityURL ¶
WithInfinityURL overrides the control-plane base URL (default https://api.vxcloud.io).
func WithNodeURL ¶
WithNodeURL overrides the tenant-node base URL. If unset, it is resolved from the API key exchange response (one round trip on first call).
func WithTenantID ¶
WithTenantID pins the tenant id used for the agentcontrol surface (the X-Tenant-ID header). LoadFromVxcli populates this automatically from credentials.json when present.
func WithTimeout ¶
WithTimeout sets the per-request timeout (default 30s).
func WithUserAgent ¶
WithUserAgent overrides the User-Agent header (default "vxsdk-go/<version>").
func WithUsername ¶
WithUsername pins the workspace username. If unset, the SDK derives it from the API key exchange response.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agentcontrol is the resource module for the AgentControl surface — fine-tuning jobs, model training, knowledge bases, datasets, server-side agents, and GitHub dataset import.
|
Package agentcontrol is the resource module for the AgentControl surface — fine-tuning jobs, model training, knowledge bases, datasets, server-side agents, and GitHub dataset import. |
|
Package agents is the resource module for the AI-agent surface that vxcli exposes via `vxcli agent {coding, devops, git, parallel, presets, tool, tools}`.
|
Package agents is the resource module for the AI-agent surface that vxcli exposes via `vxcli agent {coding, devops, git, parallel, presets, tool, tools}`. |
|
Package auth holds the authentication contract for the SDK.
|
Package auth holds the authentication contract for the SDK. |
|
Package billing wraps the platform's multicloud billing endpoints.
|
Package billing wraps the platform's multicloud billing endpoints. |
|
Package chat exposes multi-provider AI chat — the same surface `vxcli chat` ships.
|
Package chat exposes multi-provider AI chat — the same surface `vxcli chat` ships. |
|
Package cicd is the resource module for CI/CD pipelines and builds.
|
Package cicd is the resource module for CI/CD pipelines and builds. |
|
Package cloud is the resource module for cloud-side provisioning.
|
Package cloud is the resource module for cloud-side provisioning. |
|
Package deploy is the resource module for deploying applications and containers onto VMs the tenant node can SSH into.
|
Package deploy is the resource module for deploying applications and containers onto VMs the tenant node can SSH into. |
|
Package errors is the typed error hierarchy returned by the SDK.
|
Package errors is the typed error hierarchy returned by the SDK. |
|
examples
|
|
|
cicd_smoke
command
Smoke test: drive cicd Pipeline.Trigger + Build.Show via the Go SDK to confirm the CLI-observed failure is server-side, not CLI-side.
|
Smoke test: drive cicd Pipeline.Trigger + Build.Show via the Go SDK to confirm the CLI-observed failure is server-side, not CLI-side. |
|
Package install is the resource module for running install scripts and docker-compose stacks against a remote VM via the tenant node.
|
Package install is the resource module for running install scripts and docker-compose stacks against a remote VM via the tenant node. |
|
internal
|
|
|
cred
Package cred is an internal helper that loads ~/.vxcloud/credentials.json — the same file vxcli writes during `vxcli auth login`.
|
Package cred is an internal helper that loads ~/.vxcloud/credentials.json — the same file vxcli writes during `vxcli auth login`. |
|
Package marketplace is the resource module for the vxcloud marketplace.
|
Package marketplace is the resource module for the vxcloud marketplace. |
|
Package metaldb is the resource module for MetalDB — self-managed PostgreSQL provisioned over SSH onto a customer VM.
|
Package metaldb is the resource module for MetalDB — self-managed PostgreSQL provisioned over SSH onto a customer VM. |
|
Package networks is the resource module for vxcli's network-diagnostic scripts (DNS, bandwidth, port checks, security audits).
|
Package networks is the resource module for vxcli's network-diagnostic scripts (DNS, bandwidth, port checks, security audits). |
|
Package nodes is the resource module for tenant-node management.
|
Package nodes is the resource module for tenant-node management. |
|
Package observability is the resource module for backups, migrations, and resource synchronization.
|
Package observability is the resource module for backups, migrations, and resource synchronization. |
|
Package robotic is the resource module for the Robotic control cloud — register robots, send commands, push telemetry, request motion plans, and issue fleet-wide commands.
|
Package robotic is the resource module for the Robotic control cloud — register robots, send commands, push telemetry, request motion plans, and issue fleet-wide commands. |
|
Package services is the resource module for managing already-running services on a remote VM.
|
Package services is the resource module for managing already-running services on a remote VM. |
|
Package sessions is the resource module for tenant deployment sessions.
|
Package sessions is the resource module for tenant deployment sessions. |
|
Package transport is the SDK's HTTP layer.
|
Package transport is the SDK's HTTP layer. |
|
Package vxchrono is the resource module for VxChrono — the autonomous goal executor and scheduler.
|
Package vxchrono is the resource module for VxChrono — the autonomous goal executor and scheduler. |
|
Package vxcomputer is the resource module for VXCOMPUTER — the node-local, policy-governed agent runtime.
|
Package vxcomputer is the resource module for VXCOMPUTER — the node-local, policy-governed agent runtime. |
|
Package vxsdktest provides a stub HTTP server for unit-testing code that uses vxsdk-go without a live tenant or control plane.
|
Package vxsdktest provides a stub HTTP server for unit-testing code that uses vxsdk-go without a live tenant or control plane. |
|
Package workflow is the resource module for the node-local Workflow orchestration service — the n8n-style visual workflow engine that executes ReactFlow DAGs in parallel waves.
|
Package workflow is the resource module for the node-local Workflow orchestration service — the n8n-style visual workflow engine that executes ReactFlow DAGs in parallel waves. |
|
Package workspace covers the entire /api/v2/setup/* surface — workspace + organization lifecycle, cloud provider credential storage (AWS / GCP / Azure), AI provider credential storage (16 providers), Git provider connections, payment / SMTP / SSL / OAuth / OKTA / CyberArk creds, and the API token lifecycle.
|
Package workspace covers the entire /api/v2/setup/* surface — workspace + organization lifecycle, cloud provider credential storage (AWS / GCP / Azure), AI provider credential storage (16 providers), Git provider connections, payment / SMTP / SSL / OAuth / OKTA / CyberArk creds, and the API token lifecycle. |