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
| Language | Package | Install |
|---|---|---|
| TypeScript | @voxgig-sdk/cloudsmith | publish pending — install from git tag |
| Python | voxgig-sdk-cloudsmith | publish pending — install from git tag |
| Golang | github.com/voxgig-sdk/cloudsmith-sdk/go | go get github.com/voxgig-sdk/cloudsmith-sdk/go@latest |
| Ruby | voxgig-sdk-cloudsmith | publish 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
| Surface | Path |
|---|---|
| SDK (TypeScript, Python, Golang, Ruby) | ts/ py/ go/ rb/ |
Entities
The API exposes 140 entities:
| Entity | Description | API path |
|---|---|---|
| Abort | The Abort entity. | “ |
| Alpine | The Alpine entity. | “ |
| AuditLog | The AuditLog entity. | “ |
| Basic | The Basic entity. | “ |
| Cargo | The Cargo entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/cargo/ |
| Cocoapod | The Cocoapod entity. | “ |
| Complete | The Complete entity. | “ |
| Composer | The Composer entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/composer/ |
| Conan | The Conan entity. | “ |
| Conda | The Conda entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/conda/ |
| Copy | The Copy entity. | “ |
| Cran | The Cran entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/cran/ |
| Dart | The Dart entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/dart/ |
| Deb | The Deb entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/deb/ |
| DenyPolicy | The DenyPolicy entity. | “ |
| Dependency | The Dependency entity. | “ |
| Disable | The Disable entity. | “ |
| DistributionFull | The DistributionFull entity (list, load). | /distros/ |
| Distro | The Distro entity. | “ |
| Docker | The Docker entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/docker/ |
| DynamicMapping | The DynamicMapping entity (list, load). | /orgs/{org}/openid-connect/{provider_setting}/dynamic-mappings/ |
| Ecdsa | The Ecdsa entity. | “ |
| Enable | The Enable entity. | “ |
| Entitlement | The Entitlement entity (create, load, remove). | /entitlements/{owner}/{repo}/{identifier}/reset/ |
| Evaluation | The Evaluation entity. | “ |
| File | The File entity (create). | /files/{owner}/{repo}/{identifier}/abort/ |
| Format | The Format entity (list, load). | /formats/ |
| Geoip | The Geoip entity. | “ |
| Gon | The Gon entity. | “ |
| Gon2 | The Gon2 entity. | “ |
| Gon3 | The Gon3 entity (list). | /repos/{owner}/{identifier}/upstream/go/ |
| Gon4 | The Gon4 entity. | “ |
| Gon5 | The Gon5 entity (create). | /repos/{owner}/{identifier}/upstream/go/ |
| Gon6 | The Gon6 entity (load). | /repos/{owner}/{identifier}/upstream/go/{slug_perm}/ |
| Gon7 | The Gon7 entity. | “ |
| Gon8 | The Gon8 entity (update). | /repos/{owner}/{identifier}/upstream/go/{slug_perm}/ |
| Gon9 | The Gon9 entity (update). | /repos/{owner}/{identifier}/upstream/go/{slug_perm}/ |
| Gpg | The Gpg entity. | “ |
| Group | The Group entity. | “ |
| Helm | The Helm entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/helm/ |
| Hex | The Hex entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/hex/ |
| History | The History entity. | “ |
| Huggingface | The Huggingface entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/huggingface/ |
| Info | The Info entity. | “ |
| Invite | The Invite entity. | “ |
| LicensePolicy | The LicensePolicy entity. | “ |
| Limit | The Limit entity. | “ |
| Luarock | The Luarock entity. | “ |
| Maven | The Maven entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/maven/ |
| Member | The Member entity. | “ |
| Move | The Move entity. | “ |
| Namespace | The Namespace entity (list, load). | /namespaces/ |
| NamespaceAuditLog | The NamespaceAuditLog entity (load). | /audit-log/{owner}/ |
| Npm | The Npm entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/npm/ |
| Nuget | The Nuget entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/nuget/ |
| OpenidConnect | The OpenidConnect entity. | “ |
| Org | The Org entity (create, list, load, remove, update). | /orgs/{org}/members/{member}/refresh/ |
| OrganizationGroupSync | The OrganizationGroupSync entity (create, list). | /orgs/{org}/saml-group-sync/ |
| OrganizationGroupSyncStatus | The OrganizationGroupSyncStatus entity (load). | /orgs/{org}/saml-group-sync/status/ |
| OrganizationInvite | The OrganizationInvite entity (create, list, update). | /orgs/{org}/invites/ |
| OrganizationInviteExtend | The OrganizationInviteExtend entity (create). | /orgs/{org}/invites/{slug_perm}/extend/ |
| OrganizationMembership | The OrganizationMembership entity (list, load, update). | /orgs/{org}/members/ |
| OrganizationMembershipRoleUpdate | The OrganizationMembershipRoleUpdate entity (update). | /orgs/{org}/members/{member}/update-role/ |
| OrganizationMembershipVisibilityUpdate | The OrganizationMembershipVisibilityUpdate entity (update). | /orgs/{org}/members/{member}/update-visibility/ |
| OrganizationPackageLicensePolicy | The OrganizationPackageLicensePolicy entity (create, list, load, patch, update). | /orgs/{org}/license-policy/ |
| OrganizationPackageVulnerabilityPolicy | The OrganizationPackageVulnerabilityPolicy entity (create, list, load, patch, update). | /orgs/{org}/vulnerability-policy/ |
| OrganizationSamlAuth | The OrganizationSamlAuth entity (load, update). | /orgs/{org}/saml-authentication |
| OrganizationTeam | The OrganizationTeam entity (create, list, load, update). | /orgs/{org}/teams/ |
| OrganizationTeamMember | The OrganizationTeamMember entity (create, list). | /orgs/{org}/teams/{team}/members |
| Oss | The Oss entity. | “ |
| P2n | The P2n entity. | “ |
| P2n2 | The P2n2 entity. | “ |
| Package | The Package entity (create, list, load, remove). | /packages/{owner}/{repo}/{identifier}/copy/ |
| PackageDenyPolicy | The PackageDenyPolicy entity (create, list, load, patch, update). | /orgs/{org}/deny-policy/ |
| PackageFilePartsUpload | The PackageFilePartsUpload entity (load). | /files/{owner}/{repo}/{identifier}/info/ |
| PackageFileUpload | The PackageFileUpload entity (create). | /files/{owner}/{repo}/{identifier}/complete/ |
| PackageLicensePolicyEvaluation | The PackageLicensePolicyEvaluation entity (create, list, load). | /orgs/{org}/license-policy/{policy_slug_perm}/evaluation/ |
| PackageVersionBadge | The PackageVersionBadge entity (load). | /badges/version/{owner}/{repo}/{package_format}/{package_name}/{package_version}/{package_identifiers}/ |
| PackageVulnerabilityPolicyEvaluation | The PackageVulnerabilityPolicyEvaluation entity (create, list, load). | /orgs/{org}/vulnerability-policy/{policy_slug_perm}/evaluation/ |
| Privilege | The Privilege entity. | “ |
| Profile | The Profile entity. | “ |
| ProviderSetting | The ProviderSetting entity (list, load). | /orgs/{org}/openid-connect/ |
| ProviderSettingsWrite | The ProviderSettingsWrite entity (create, patch, update). | /orgs/{org}/openid-connect/ |
| Python | The Python entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/python/ |
| Quarantine | The Quarantine entity. | “ |
| Quota | The Quota entity (load). | /quota/{owner}/ |
| Raw | The Raw entity. | “ |
| Refresh | The Refresh entity. | “ |
| Regenerate | The Regenerate entity. | “ |
| Repo | The Repo entity (create, list, load, patch, remove, update). | /repos/{owner}/{identifier}/geoip/disable/ |
| RepositoryAuditLog | The RepositoryAuditLog entity (list). | /audit-log/{owner}/{repo}/ |
| RepositoryEcdsaKey | The RepositoryEcdsaKey entity (create, load). | /repos/{owner}/{identifier}/ecdsa/ |
| RepositoryGeoIpRule | The RepositoryGeoIpRule entity (load, patch, update). | /repos/{owner}/{identifier}/geoip |
| RepositoryGeoIpStatus | The RepositoryGeoIpStatus entity (load). | /repos/{owner}/{identifier}/geoip/status/ |
| RepositoryGeoIpTestAddress | The RepositoryGeoIpTestAddress entity (create). | /repos/{owner}/{identifier}/geoip/test/ |
| RepositoryGpgKey | The RepositoryGpgKey entity (create, load). | /repos/{owner}/{identifier}/gpg/ |
| RepositoryPrivilegeInput | The RepositoryPrivilegeInput entity (list). | /repos/{owner}/{identifier}/privileges |
| RepositoryRetentionRule | The RepositoryRetentionRule entity (load, update). | /repos/{owner}/{repo}/retention/ |
| RepositoryRsaKey | The RepositoryRsaKey entity (create, load). | /repos/{owner}/{identifier}/rsa/ |
| RepositoryToken | The RepositoryToken entity (create, list, load, update). | /entitlements/{owner}/{repo}/ |
| RepositoryTokenRefresh | The RepositoryTokenRefresh entity (create). | /entitlements/{owner}/{repo}/{identifier}/refresh/ |
| RepositoryTokenSync | The RepositoryTokenSync entity (create). | /entitlements/{owner}/{repo}/sync/ |
| RepositoryWebhook | The RepositoryWebhook entity (create, list, update). | /webhooks/{owner}/{repo}/ |
| RepositoryX509EcdsaCertificate | The RepositoryX509EcdsaCertificate entity (load). | /repos/{owner}/{identifier}/x509-ecdsa/ |
| RepositoryX509RsaCertificate | The RepositoryX509RsaCertificate entity (load). | /repos/{owner}/{identifier}/x509-rsa/ |
| Reset | The Reset entity. | “ |
| ResourcesRateCheck | The ResourcesRateCheck entity (load). | /rates/limits/ |
| Resync | The Resync entity. | “ |
| Retention | The Retention entity. | “ |
| Rpm | The Rpm entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/rpm/ |
| Rsa | The Rsa entity. | “ |
| Ruby | The Ruby entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/ruby/ |
| SamlGroupSync | The SamlGroupSync entity. | “ |
| Scan | The Scan entity. | “ |
| Self | The Self entity. | “ |
| Service | The Service entity (create, list, load, update). | /orgs/{org}/services/ |
| Status | The Status entity. | “ |
| StatusBasic | The StatusBasic entity (load). | /status/check/basic/ |
| StorageRegion | The StorageRegion entity (list, load). | /storage-regions/ |
| Swift | The Swift entity (create, list, load, patch, update). | /repos/{owner}/{identifier}/upstream/swift/ |
| Sync | The Sync entity. | “ |
| Tag | The Tag entity. | “ |
| Team | The Team entity. | “ |
| Terraform | The Terraform entity. | “ |
| Test | The Test entity. | “ |
| Token | The Token entity. | “ |
| TransferRegion | The TransferRegion entity. | “ |
| User | The User entity (list). | /user/tokens/ |
| UserAuthToken | The UserAuthToken entity (create). | /user/token/ |
| UserAuthenticationToken | The UserAuthenticationToken entity (create, update). | /user/tokens/ |
| UserBrief | The UserBrief entity (load). | /user/self/ |
| UserProfile | The UserProfile entity (load). | /users/profile/{slug}/ |
| Vagrant | The Vagrant entity. | “ |
| Validate | The Validate entity. | “ |
| Version | The Version entity. | “ |
| Vulnerability | The Vulnerability entity (list, load). | /vulnerabilities/{owner}/{repo}/{package}/ |
| VulnerabilityPolicy | The VulnerabilityPolicy entity. | “ |
| Webhook | The Webhook entity (remove). | /webhooks/{owner}/{repo}/{identifier}/ |
| X509Ecdsa | The X509Ecdsa entity. | “ |
| X509Rsa | The 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:
- Point — resolve the API endpoint from the operation definition.
- Spec — build the HTTP specification (URL, method, headers, body).
- Request — send the HTTP request.
- Response — receive and parse the response.
- 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
| Feature | Purpose |
|---|---|
| TestFeature | In-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.
- Upstream API: https://help.cloudsmith.io
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.