### Example Unity Package Installation Source: https://docs.cloudsmith.com/formats/unity-registry An example of a `manifest.json` file configuration showing how to add a specific Cloudsmith registry and a Unity package dependency. ```json { "scopedRegistries": [ { "name": "MyRegistry", "url": "https://npm.cloudsmith.io/demo/examples-repo/", "scopes": [ "com.cloudsmith", ] } ], "dependencies": { "com.cloudsmith.assets": 1.1.2" } } ``` -------------------------------- ### Example: Download 'jason' Package Source: https://docs.cloudsmith.com/formats/hex-repository Example of downloading version 1.0.0 of the 'jason' module from a specified repository. ```shell mix hex.package fetch jason 1.0.0 --repo REPOSITORY ``` -------------------------------- ### Setup Pip for Private Cloudsmith Repository (Entitlement Token) Source: https://docs.cloudsmith.com/formats/python-repository Install packages from a private Cloudsmith repository using an entitlement token for authentication. The token is included directly in the `--index-url`. ```shell pip install PACKAGE_NAME==PACKAGE_VERSION --index-url https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/python/simple/ ``` -------------------------------- ### Install Latest Go Package Source: https://docs.cloudsmith.com/formats/go-registry Use this command to install the latest version of a Go package. ```shell go get PACKAGE_NAME ``` -------------------------------- ### Install Composer Dependencies Source: https://docs.cloudsmith.com/formats/composer-repository Run the 'composer install' command to download and install all dependencies listed in your composer.json file. ```shell composer install ``` -------------------------------- ### Install Python Dependencies Source: https://docs.cloudsmith.com/migrating-to-cloudsmith/import-python Install all required Python packages for the import script using pip. Create a `requirements.txt` file with the listed dependencies and run the install command. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install Package with Pod Install Source: https://docs.cloudsmith.com/formats/cocoapods-repository Run this command after configuring your Podfile to download and install dependencies into your project. Use the --repo-update flag if you need to force a repository index update. ```shell pod install ``` -------------------------------- ### Get Swagger-Codegen Configuration Help Source: https://docs.cloudsmith.com/developer-tools/api-bindings Use this command to get configuration help for a specific language when setting up build.sh. ```bash bin/swagger-codegen-cli config-help -l ``` -------------------------------- ### Install Module from Public Repository Source: https://docs.cloudsmith.com/formats/powershell-modules-repository Installs a module from a configured public repository. Ensure the repository is registered before use. ```powershell Install-Module -Name "MODULE_NAME" -Repository NAME ``` ```powershell Install-Module -Name "MyModule" -Repository cloudsmith ``` -------------------------------- ### Install and Start a Vagrant Box Source: https://docs.cloudsmith.com/formats/vagrant-repository After configuring your Vagrantfile to point to a cloudsmith.io box, use this command to install and start the virtual machine. ```shell vagrant up ``` -------------------------------- ### Example Repository Creation Command Source: https://docs.cloudsmith.com/repositories/create-a-repository Execute this shell command to create a repository using the provided example configuration file and owner. ```shell cloudsmith repos create demo example-repo-config.json ``` -------------------------------- ### Azure DevOps Organization ID Example Source: https://docs.cloudsmith.com/integrations/integrating-with-azure-devops Example JSON structure to find your Azure DevOps organization ID (GUID). ```json {"AccountId": "12345678-abcd-4321-ef00-987654321000", "AccountName": "acme-corp"} ``` -------------------------------- ### Install the Latest Version of a Helm Chart Source: https://docs.cloudsmith.com/formats/helm-chart-repository Install the latest available version of a Helm chart. This is useful for getting the most recent features. ```shell helm install NAME/CHART_NAME ``` -------------------------------- ### Initialize Swift Project Source: https://docs.cloudsmith.com/formats/swift-registry Creates a new executable Swift project and navigates into its directory. ```bash cd .. mkdir MySwiftApp && cd MySwiftApp swift package init --type executable ``` -------------------------------- ### Example buildspec.yaml for Debian Package Upload Source: https://docs.cloudsmith.com/integrations/integrating-with-aws-codebuild This complete `buildspec.yaml` example configures AWS CodeBuild to build a Debian package using `fpm` and then upload it to a Cloudsmith repository. It includes installing dependencies, building the package, and pushing it to Cloudsmith. ```yaml version: 0.2 env: secrets-manager: CLOUDSMITH_API_KEY: CodeBuild/CloudsmithAPI:CLOUDSMITH_API_KEY phases: install: runtime-versions: python: 3.x commands: - apt update - apt-get install ruby ruby-dev rubygems build-essential -y - gem install --no-document fpm - pip install cloudsmith-cli build: commands: - make - fpm -f -s dir -t deb -v 1.0.1 -n cloudsmith-codebuild-test . post_build: commands: - echo "Uploading deb package to Cloudsmith repo" - cloudsmith push deb demo/codebuild-demo/debian/buster cloudsmith-codebuild-test_1.0.1_amd64.deb ``` -------------------------------- ### Example Repository Configuration JSON Source: https://docs.cloudsmith.com/repositories/create-a-repository An example JSON file demonstrating the structure for creating a repository with specific name, description, type, and slug. ```json { "name": "Example Repository", "description": "Example packages repository", "repository_type_str": "Private", "slug": "example-repo1" } ``` -------------------------------- ### Install Cloudsmith CLI (API Key) Source: https://docs.cloudsmith.com/integrations/integrating-with-github-actions Use this snippet for API key authentication to install the Cloudsmith CLI. This method is suitable for quick tests or legacy setups where OIDC is not available. Ensure CLOUDSMITH_API_KEY is set as a GitHub secret. ```yaml steps: - uses: actions/checkout@v4 - name: Install Cloudsmith CLI (API Key) uses: cloudsmith-io/cloudsmith-cli-action@v2 with: api-key: ${{ secrets.CLOUDSMITH_API_KEY }} ``` -------------------------------- ### Create Virtual Environment and Install Dependencies Source: https://docs.cloudsmith.com/formats/python-repository Create a virtual environment using `uv` and activate it. Then, install project dependencies from `pyproject.toml`. ```bash # create a venv first: uv venv && source .venv/bin/activate # install dependencies uv pip install --system -r pyproject.toml ``` -------------------------------- ### Automatically Setup RPM Repository (Yum/Dnf/Zypper) Source: https://docs.cloudsmith.com/formats/redhat-repository Use this command to automatically set up the repository configuration for Yum, Dnf, or Zypper. It fetches and executes a setup script. ```shell curl -sLf \ 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/setup/bash.rpm.sh' \ | sudo bash ``` -------------------------------- ### CocoaPods Podfile Configuration Source: https://docs.cloudsmith.com/formats/cocoapods-repository Example Podfile demonstrating entitlement token authentication for a Cloudsmith repository. Ensure the source URL and pod name are correct for your setup. ```ruby source 'https://dl.cloudsmith.io/abcedef1234567/org/repo/cocoapods/index.git' workspace 'cocoapods-install-example.xcworkspace' target 'cocoapods-install-example' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for cocoapods-install-example pod 'cloudsmith-cocoapods-example', '~> 1.0.158207047536418' end ``` -------------------------------- ### Example Debian Import Folder Structure Source: https://docs.cloudsmith.com/migrating-to-cloudsmith/import-debian Illustrates the expected directory structure for organizing Debian packages before import. This includes configuration files, the import script, and repository-specific folders with distro/release subdirectories containing .deb files. ```text deb_import/ ├─ config.ini ├─ credentials.ini ├─ deb_import.sh ├─ repo_name_1/ │ ├─ any-version.any-release/ │ │ ├─ some_package.deb ├─ repo_name_2/ │ ├─ debian.bullseye/ │ │ ├─ some_package.deb ``` -------------------------------- ### Remove Cloudsmith Debian Repository Setup Source: https://docs.cloudsmith.com/formats/debian-repository To stop installing packages from a Cloudsmith Debian repository, use this command to remove the repository configuration and clean apt caches. ```shell rm /etc/apt/sources.list.d/OWNER-REPOSITORY.list apt-get clean rm -rf /var/lib/apt/lists/* apt-get update ``` -------------------------------- ### Install uv and Build with Pip Source: https://docs.cloudsmith.com/formats/python-repository Install the uv package manager and the build tool using pip. Ensure you have the latest versions for optimal performance and compatibility. ```bash pip install uv --upgrade uv pip install build ``` -------------------------------- ### Swift Package Registry Resolve Output Example Source: https://docs.cloudsmith.com/formats/swift-registry Example output indicating successful fetching of a package from a Cloudsmith registry. ```text Computing version for alamofire.alamofire Computed alamofire.alamofire at 5.9.2 (1.84s) Fetching alamofire.alamofire warning: 'alamofire.alamofire': alamofire.alamofire version 5.9.2 source archive from https://swift.cloudsmith.io/demo-docs/awesome-repo is not signed Fetched alamofire.alamofire from cache (4.07s) ``` -------------------------------- ### Automatic Debian Repository Setup with Entitlement Token Source: https://docs.cloudsmith.com/formats/debian-repository Use this command to automatically set up a private Cloudsmith Debian repository using an entitlement token for authentication. Ensure you have 'curl' and 'sudo' installed. ```shell curl -sLf 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/setup/bash.deb.sh' \ | sudo bash ``` -------------------------------- ### Install Maven Package Source: https://docs.cloudsmith.com/formats/maven-repository Run this command in your project's root directory to download dependencies and build your project. ```shell mvn install ``` -------------------------------- ### Pip Requirements File Setup Source: https://docs.cloudsmith.com/formats/python-repository Configure your requirements.txt file to use Cloudsmith as the package index. This ensures pip only installs packages from your specified repository, enhancing security by reducing the risk of malicious public packages. ```text --index-url https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/python/simple/ PACKAGE_NAME==PACKAGE_VERSION ``` ```text --index-url https://USERNAME:PASSWORD@dl.cloudsmith.io/basic/OWNER/REPOSITORY/python/simple/ PACKAGE_NAME==PACKAGE_VERSION ``` ```text --index-url https://USERNAME:API-KEY@dl.cloudsmith.io/basic/OWNER/REPOSITORY/python/simple/ PACKAGE_NAME==PACKAGE_VERSION ``` ```text --index-url https://token:TOKEN@dl.cloudsmith.io/basic/OWNER/REPOSITORY/python/simple/ PACKAGE_NAME==PACKAGE_VERSION ``` -------------------------------- ### Setup Pip for Public Cloudsmith Repository (Command Line) Source: https://docs.cloudsmith.com/formats/python-repository Configure `pip` to use a public Cloudsmith repository by specifying the `--index-url` with the repository's simple index path. This allows `pip` to find and install packages from your Cloudsmith feed. ```shell pip install PACKAGE_NAME==PACKAGE_VERSION --index-url https://dl.cloudsmith.io/public/OWNER/REPOSITORY/python/simple/ ``` -------------------------------- ### Setup Pip for Private Cloudsmith Repository (HTTP Basic Auth - API Key) Source: https://docs.cloudsmith.com/formats/python-repository Use an API key for HTTP Basic Authentication to install packages from a private Cloudsmith repository. Treat your API key as a secret and avoid committing it to version control. ```shell pip install PACKAGE_NAME==PACKAGE_VERSION --index-url https://USERNAME:API-KEY@dl.cloudsmith.io/basic/OWNER/REPOSITORY/python/simple/ ``` -------------------------------- ### Install Latest NuGet Package using NuGet CLI Source: https://docs.cloudsmith.com/formats/nuget-feed Command to install the latest version of a package from a configured NuGet source. Ensure the source 'example-repo' is already added. ```shell nuget install PACKAGE_NAME -Source example-repo -DependencyVersion Highest ``` -------------------------------- ### Install Cloudsmith CLI on Windows with Chocolatey Source: https://docs.cloudsmith.com/developer-tools/cli Installs the Cloudsmith CLI on Windows using Chocolatey. This involves setting execution policy, installing Chocolatey if needed, and then installing the CLI. ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force; \ iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) ``` ```powershell choco install python -y refreshenv choco install cloudsmith-cli --source python ``` -------------------------------- ### Install Module with HTTP Basic Authentication (Token) Source: https://docs.cloudsmith.com/formats/luarocks-repository Install a module from a private Cloudsmith repository using HTTP Basic Authentication with a generic token. This is an alternative to using a specific API key. ```shell luarocks install MODULE_NAME MODULE_VERSION --server https://token:TOKEN@dl.cloudsmith.io/basic/OWNER/REPOSITORY/luarocks/ ``` -------------------------------- ### Installing a Package Directly via Cargo Source: https://docs.cloudsmith.com/formats/cargo-registry Install a crate directly from your Cloudsmith registry using the `cargo install` command, specifying the registry name. ```shell cargo install PACKAGE_NAME --registry REGISTRY_NAME ``` -------------------------------- ### Search and Sort Packages by Downloads Source: https://docs.cloudsmith.com/artifact-management/search-filter-sort-packages Combine search queries with sorting. This example filters for Python packages and sorts them by downloads in descending order. ```text query=format:python&sort=-downloads ``` -------------------------------- ### Install Cloudsmith CLI with Homebrew Source: https://docs.cloudsmith.com/developer-tools/cli Installs the Cloudsmith CLI using Homebrew. First, tap the repository, then install the package. Includes upgrade command. ```bash brew tap cloudsmith-io/cloudsmith-cli ``` ```bash brew install cloudsmith-cli ``` ```bash brew upgrade cloudsmith-cli ``` -------------------------------- ### Registry Configuration File Example Source: https://docs.cloudsmith.com/formats/swift-registry An example of the registries.json file generated by 'swift package-registry set'. It specifies the registry URL and authentication details. ```json { "authentication" : { }, "registries" : { "[default]" : { "supportsAvailability" : false, "url" : "https://swift.cloudsmith.io/cloudsmith-test/buildkite-demo" } }, "version" : 1 } ``` -------------------------------- ### Install Python on TeamCity Build Agent Source: https://docs.cloudsmith.com/integrations/integrating-with-teamcity Installs Python 3 and pip on the build agent using apt-get. This step can be skipped if Python is already installed. ```bash apt-get update -y apt-get install -y python3 python3-pip ```