Cloudsmith SDK

Cloudsmith SDK

Cloudsmith API (v1) client, generated from the OpenAPI spec.

The API to the Cloudsmith Service

Learn more about Cloudsmith API (v1) at cloudsmith.io.

This is an unofficial SDK for the Cloudsmith API (v1) public API, generated by Voxgig with @voxgig/sdkgen. It is not affiliated with, endorsed by, or sponsored by the upstream API provider.

Learn more about Voxgig SDKs at voxgig.com/sdk.

TypeScript, Python, Golang, Ruby SDKs, and an interactive REPL — all generated from one OpenAPI spec by @voxgig/sdkgen.

Entities, not endpoints

This SDK exposes the API as a small set of semantic entities — Abort, Alpine, AuditLog, Basic, Cargo, Cocoapod, Complete, Composer, Conan, Conda, Copy, Cran, Dart, Deb, DenyPolicy, Dependency, Disable, DistributionFull, Distro, Docker, DynamicMapping, Ecdsa, Enable, Entitlement, Evaluation, File, Format, Geoip, Gon, Gon2, Gon3, Gon4, Gon5, Gon6, Gon7, Gon8, Gon9, Gpg, Group, Helm, Hex, History, Huggingface, Info, Invite, LicensePolicy, Limit, Luarock, Maven, Member, Move, Namespace, NamespaceAuditLog, Npm, Nuget, OpenidConnect, Org, OrganizationGroupSync, OrganizationGroupSyncStatus, OrganizationInvite, OrganizationInviteExtend, OrganizationMembership, OrganizationMembershipRoleUpdate, OrganizationMembershipVisibilityUpdate, OrganizationPackageLicensePolicy, OrganizationPackageVulnerabilityPolicy, OrganizationSamlAuth, OrganizationTeam, OrganizationTeamMember, Oss, P2n, P2n2, Package, PackageDenyPolicy, PackageFilePartsUpload, PackageFileUpload, PackageLicensePolicyEvaluation, PackageVersionBadge, PackageVulnerabilityPolicyEvaluation, Privilege, Profile, ProviderSetting, ProviderSettingsWrite, Python, Quarantine, Quota, Raw, Refresh, Regenerate, Repo, RepositoryAuditLog, RepositoryEcdsaKey, RepositoryGeoIpRule, RepositoryGeoIpStatus, RepositoryGeoIpTestAddress, RepositoryGpgKey, RepositoryPrivilegeInput, RepositoryRetentionRule, RepositoryRsaKey, RepositoryToken, RepositoryTokenRefresh, RepositoryTokenSync, RepositoryWebhook, RepositoryX509EcdsaCertificate, RepositoryX509RsaCertificate, Reset, ResourcesRateCheck, Resync, Retention, Rpm, Rsa, Ruby, SamlGroupSync, Scan, Self, Service, Status, StatusBasic, StorageRegion, Swift, Sync, Tag, Team, Terraform, Test, Token, TransferRegion, User, UserAuthToken, UserAuthenticationToken, UserBrief, UserProfile, Vagrant, Validate, Version, Vulnerability, VulnerabilityPolicy, Webhook, X509Ecdsa and X509Rsa — that you call directly, instead of assembling URL paths and query strings. Entities are Capitalised to mark them as the primary surface, each with the operations they support (list, load, create, update, remove, patch):

const client = new CloudsmithSDK()

Thinking in entities keeps the mental model small — for people and AI agents alike — rather than reasoning about raw HTTP routes and query parameters.

Offline unit testing

Every SDK ships a built-in test mode that swaps the HTTP transport for an in-memory mock, so your unit tests run fully offline — no server, no network, and no credentials:

TypeScript

const client = CloudsmithSDK.test()
const cargos = await client.Cargo().list()
// cargos is an array of bare Cargo records populated with mock data
console.log(cargos)

Python

client = CloudsmithSDK.test()
cargos = client.Cargo().list()
print(cargos)

Golang

client := sdk.Test()
result, err := client.Cargo(nil).List(
    nil, nil,
)

Ruby

# Seed fixture data so offline calls resolve without a live server.
client = CloudsmithSDK.test({
  "entity" => { "cargo" => { "test01" => { "id" => "test01" } } },
})
cargos = client.Cargo.list()

Packages

LanguagePackageInstall
TypeScript@voxgig-sdk/cloudsmithpublish pending — install from git tag
Pythonvoxgig-sdk-cloudsmithpublish pending — install from git tag
Golanggithub.com/voxgig-sdk/cloudsmith-sdk/gogo get github.com/voxgig-sdk/cloudsmith-sdk/go@latest
Rubyvoxgig-sdk-cloudsmithpublish pending — install from git tag

Quickstart

TypeScript

import { CloudsmithSDK } from '@voxgig-sdk/cloudsmith'

const client = new CloudsmithSDK({
  apikey: process.env.CLOUDSMITH_APIKEY,
})


// Load a specific cargo (returns a Cargo)
const cargo = await client.Cargo().load({
  identifier: 'example_identifier',
  owner: 'example_owner',
  id: 'example_id',
})
console.log(cargo)

See the TypeScript README for the full guide.

Surfaces

SurfacePath
SDK (TypeScript, Python, Golang, Ruby)ts/ py/ go/ rb/

Entities

The API exposes 140 entities:

EntityDescriptionAPI path
AbortThe Abort entity.
AlpineThe Alpine entity.
AuditLogThe AuditLog entity.
BasicThe Basic entity.
CargoThe Cargo entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/cargo/
CocoapodThe Cocoapod entity.
CompleteThe Complete entity.
ComposerThe Composer entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/composer/
ConanThe Conan entity.
CondaThe Conda entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/conda/
CopyThe Copy entity.
CranThe Cran entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/cran/
DartThe Dart entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/dart/
DebThe Deb entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/deb/
DenyPolicyThe DenyPolicy entity.
DependencyThe Dependency entity.
DisableThe Disable entity.
DistributionFullThe DistributionFull entity (list, load)./distros/
DistroThe Distro entity.
DockerThe Docker entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/docker/
DynamicMappingThe DynamicMapping entity (list, load)./orgs/{org}/openid-connect/{provider_setting}/dynamic-mappings/
EcdsaThe Ecdsa entity.
EnableThe Enable entity.
EntitlementThe Entitlement entity (create, load, remove)./entitlements/{owner}/{repo}/{identifier}/reset/
EvaluationThe Evaluation entity.
FileThe File entity (create)./files/{owner}/{repo}/{identifier}/abort/
FormatThe Format entity (list, load)./formats/
GeoipThe Geoip entity.
GonThe Gon entity.
Gon2The Gon2 entity.
Gon3The Gon3 entity (list)./repos/{owner}/{identifier}/upstream/go/
Gon4The Gon4 entity.
Gon5The Gon5 entity (create)./repos/{owner}/{identifier}/upstream/go/
Gon6The Gon6 entity (load)./repos/{owner}/{identifier}/upstream/go/{slug_perm}/
Gon7The Gon7 entity.
Gon8The Gon8 entity (update)./repos/{owner}/{identifier}/upstream/go/{slug_perm}/
Gon9The Gon9 entity (update)./repos/{owner}/{identifier}/upstream/go/{slug_perm}/
GpgThe Gpg entity.
GroupThe Group entity.
HelmThe Helm entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/helm/
HexThe Hex entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/hex/
HistoryThe History entity.
HuggingfaceThe Huggingface entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/huggingface/
InfoThe Info entity.
InviteThe Invite entity.
LicensePolicyThe LicensePolicy entity.
LimitThe Limit entity.
LuarockThe Luarock entity.
MavenThe Maven entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/maven/
MemberThe Member entity.
MoveThe Move entity.
NamespaceThe Namespace entity (list, load)./namespaces/
NamespaceAuditLogThe NamespaceAuditLog entity (load)./audit-log/{owner}/
NpmThe Npm entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/npm/
NugetThe Nuget entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/nuget/
OpenidConnectThe OpenidConnect entity.
OrgThe Org entity (create, list, load, remove, update)./orgs/{org}/members/{member}/refresh/
OrganizationGroupSyncThe OrganizationGroupSync entity (create, list)./orgs/{org}/saml-group-sync/
OrganizationGroupSyncStatusThe OrganizationGroupSyncStatus entity (load)./orgs/{org}/saml-group-sync/status/
OrganizationInviteThe OrganizationInvite entity (create, list, update)./orgs/{org}/invites/
OrganizationInviteExtendThe OrganizationInviteExtend entity (create)./orgs/{org}/invites/{slug_perm}/extend/
OrganizationMembershipThe OrganizationMembership entity (list, load, update)./orgs/{org}/members/
OrganizationMembershipRoleUpdateThe OrganizationMembershipRoleUpdate entity (update)./orgs/{org}/members/{member}/update-role/
OrganizationMembershipVisibilityUpdateThe OrganizationMembershipVisibilityUpdate entity (update)./orgs/{org}/members/{member}/update-visibility/
OrganizationPackageLicensePolicyThe OrganizationPackageLicensePolicy entity (create, list, load, patch, update)./orgs/{org}/license-policy/
OrganizationPackageVulnerabilityPolicyThe OrganizationPackageVulnerabilityPolicy entity (create, list, load, patch, update)./orgs/{org}/vulnerability-policy/
OrganizationSamlAuthThe OrganizationSamlAuth entity (load, update)./orgs/{org}/saml-authentication
OrganizationTeamThe OrganizationTeam entity (create, list, load, update)./orgs/{org}/teams/
OrganizationTeamMemberThe OrganizationTeamMember entity (create, list)./orgs/{org}/teams/{team}/members
OssThe Oss entity.
P2nThe P2n entity.
P2n2The P2n2 entity.
PackageThe Package entity (create, list, load, remove)./packages/{owner}/{repo}/{identifier}/copy/
PackageDenyPolicyThe PackageDenyPolicy entity (create, list, load, patch, update)./orgs/{org}/deny-policy/
PackageFilePartsUploadThe PackageFilePartsUpload entity (load)./files/{owner}/{repo}/{identifier}/info/
PackageFileUploadThe PackageFileUpload entity (create)./files/{owner}/{repo}/{identifier}/complete/
PackageLicensePolicyEvaluationThe PackageLicensePolicyEvaluation entity (create, list, load)./orgs/{org}/license-policy/{policy_slug_perm}/evaluation/
PackageVersionBadgeThe PackageVersionBadge entity (load)./badges/version/{owner}/{repo}/{package_format}/{package_name}/{package_version}/{package_identifiers}/
PackageVulnerabilityPolicyEvaluationThe PackageVulnerabilityPolicyEvaluation entity (create, list, load)./orgs/{org}/vulnerability-policy/{policy_slug_perm}/evaluation/
PrivilegeThe Privilege entity.
ProfileThe Profile entity.
ProviderSettingThe ProviderSetting entity (list, load)./orgs/{org}/openid-connect/
ProviderSettingsWriteThe ProviderSettingsWrite entity (create, patch, update)./orgs/{org}/openid-connect/
PythonThe Python entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/python/
QuarantineThe Quarantine entity.
QuotaThe Quota entity (load)./quota/{owner}/
RawThe Raw entity.
RefreshThe Refresh entity.
RegenerateThe Regenerate entity.
RepoThe Repo entity (create, list, load, patch, remove, update)./repos/{owner}/{identifier}/geoip/disable/
RepositoryAuditLogThe RepositoryAuditLog entity (list)./audit-log/{owner}/{repo}/
RepositoryEcdsaKeyThe RepositoryEcdsaKey entity (create, load)./repos/{owner}/{identifier}/ecdsa/
RepositoryGeoIpRuleThe RepositoryGeoIpRule entity (load, patch, update)./repos/{owner}/{identifier}/geoip
RepositoryGeoIpStatusThe RepositoryGeoIpStatus entity (load)./repos/{owner}/{identifier}/geoip/status/
RepositoryGeoIpTestAddressThe RepositoryGeoIpTestAddress entity (create)./repos/{owner}/{identifier}/geoip/test/
RepositoryGpgKeyThe RepositoryGpgKey entity (create, load)./repos/{owner}/{identifier}/gpg/
RepositoryPrivilegeInputThe RepositoryPrivilegeInput entity (list)./repos/{owner}/{identifier}/privileges
RepositoryRetentionRuleThe RepositoryRetentionRule entity (load, update)./repos/{owner}/{repo}/retention/
RepositoryRsaKeyThe RepositoryRsaKey entity (create, load)./repos/{owner}/{identifier}/rsa/
RepositoryTokenThe RepositoryToken entity (create, list, load, update)./entitlements/{owner}/{repo}/
RepositoryTokenRefreshThe RepositoryTokenRefresh entity (create)./entitlements/{owner}/{repo}/{identifier}/refresh/
RepositoryTokenSyncThe RepositoryTokenSync entity (create)./entitlements/{owner}/{repo}/sync/
RepositoryWebhookThe RepositoryWebhook entity (create, list, update)./webhooks/{owner}/{repo}/
RepositoryX509EcdsaCertificateThe RepositoryX509EcdsaCertificate entity (load)./repos/{owner}/{identifier}/x509-ecdsa/
RepositoryX509RsaCertificateThe RepositoryX509RsaCertificate entity (load)./repos/{owner}/{identifier}/x509-rsa/
ResetThe Reset entity.
ResourcesRateCheckThe ResourcesRateCheck entity (load)./rates/limits/
ResyncThe Resync entity.
RetentionThe Retention entity.
RpmThe Rpm entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/rpm/
RsaThe Rsa entity.
RubyThe Ruby entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/ruby/
SamlGroupSyncThe SamlGroupSync entity.
ScanThe Scan entity.
SelfThe Self entity.
ServiceThe Service entity (create, list, load, update)./orgs/{org}/services/
StatusThe Status entity.
StatusBasicThe StatusBasic entity (load)./status/check/basic/
StorageRegionThe StorageRegion entity (list, load)./storage-regions/
SwiftThe Swift entity (create, list, load, patch, update)./repos/{owner}/{identifier}/upstream/swift/
SyncThe Sync entity.
TagThe Tag entity.
TeamThe Team entity.
TerraformThe Terraform entity.
TestThe Test entity.
TokenThe Token entity.
TransferRegionThe TransferRegion entity.
UserThe User entity (list)./user/tokens/
UserAuthTokenThe UserAuthToken entity (create)./user/token/
UserAuthenticationTokenThe UserAuthenticationToken entity (create, update)./user/tokens/
UserBriefThe UserBrief entity (load)./user/self/
UserProfileThe UserProfile entity (load)./users/profile/{slug}/
VagrantThe Vagrant entity.
ValidateThe Validate entity.
VersionThe Version entity.
VulnerabilityThe Vulnerability entity (list, load)./vulnerabilities/{owner}/{repo}/{package}/
VulnerabilityPolicyThe VulnerabilityPolicy entity.
WebhookThe Webhook entity (remove)./webhooks/{owner}/{repo}/{identifier}/
X509EcdsaThe X509Ecdsa entity.
X509RsaThe X509Rsa entity.

The operations available across these entities are load, list, create, update, remove — see each entity’s own list above for exactly which it supports.

Quickstart in other languages

Python

import os
from cloudsmith_sdk import CloudsmithSDK

client = CloudsmithSDK({
    "apikey": os.environ.get("CLOUDSMITH_APIKEY"),
})

Golang

import sdk "github.com/voxgig-sdk/cloudsmith-sdk/go"

client := sdk.NewCloudsmithSDK(map[string]any{
    "apikey": os.Getenv("CLOUDSMITH_APIKEY"),
})


// Load a specific cargo
cargo, err := client.Cargo(nil).Load(
    map[string]any{"identifier": "example_identifier", "owner": "example_owner", "id": "example_id"}, nil,
)
if err != nil {
    panic(err)
}
fmt.Println(cargo)

Ruby

require_relative "Cloudsmith_sdk"

client = CloudsmithSDK.new({
  "apikey" => ENV["CLOUDSMITH_APIKEY"],
})

Direct and prepare

For endpoints the entity model doesn’t cover, use the low-level methods:

  • direct(fetchargs) — build and send an HTTP request in one step.
  • prepare(fetchargs) — build the request without sending it.

Both accept a map with path, method, params, query, headers, and body. See the How-to guides below.

How-to guides

Make a direct API call

When the entity interface does not cover an endpoint, use direct:

TypeScript:

const result = await client.direct({
  path: '/api/resource/{id}',
  method: 'GET',
  params: { id: 'example' },
})
if (result instanceof Error) {
  throw result
}
console.log(result.data)

Python:

result = client.direct({
    "path": "/api/resource/{id}",
    "method": "GET",
    "params": {"id": "example"},
})

Go:

result, err := client.Direct(map[string]any{
    "path":   "/api/resource/{id}",
    "method": "GET",
    "params": map[string]any{"id": "example"},
})
if err != nil {
    panic(err)
}
fmt.Println(result)

Ruby:

result = client.direct({
  "path" => "/api/resource/{id}",
  "method" => "GET",
  "params" => { "id" => "example" },
})

Advanced

Everyday use only needs the sections above. This explains the internals behind every call — relevant when writing custom features.

Every SDK call runs the same five-stage pipeline:

  1. Point — resolve the API endpoint from the operation definition.
  2. Spec — build the HTTP specification (URL, method, headers, body).
  3. Request — send the HTTP request.
  4. Response — receive and parse the response.
  5. Result — extract the result data for the caller.

A feature hook fires at each stage (e.g. PrePoint, PreSpec, PreRequest), so features can inspect or modify the pipeline without forking the SDK.

Features

FeaturePurpose
TestFeatureIn-memory mock transport for testing without a live server

Pass custom features via the extend option at construction time.

Per-language documentation

Upstream API

This SDK is generated from the upstream OpenAPI specification. It is an unofficial client and is not affiliated with the API provider.

Security

Please report security issues to security@voxgig.com. See SECURITY.md. Do not open public issues for suspected vulnerabilities.


Generated from the Cloudsmith API (v1) OpenAPI spec by @voxgig/sdkgen.

Get the Voxgig dispatch

Short notes on building SDKs, CLIs, REPLs, and MCPs for API-first teams, plus the occasional Fireside episode pick.

By signing up you agree to our Terms and Conditions.