Learning resourcesReviewed · Anysphere

Set up CloneKit in CI with origin repo clone-fast

This Cursor documentation page shows developers and CI maintainers how to replace git clone in CI build jobs with origin repo clone-fast, a Cursor Origin CloneKit command that downloads a prebuilt repository snapshot and then fetches only newer changes; CloneKit itself requires a Cursor Enterprise plan and activation for each repository by Cursor's account team. It covers Buildkite, GitHub Actions and other CI systems, including short-lived authentication, exact-commit checkout and fallback diagnostics.

Researched 15 Nov 2026

In short.

This Cursor documentation page shows developers and CI maintainers how to replace git clone in CI build jobs with origin repo clone-fast, the Cursor Origin CloneKit command; using CloneKit (not reading the page) requires a Cursor Enterprise plan and activation for each repository by Cursor's account team. The command downloads a prepared repository snapshot and fetches subsequent changes, with ordinary git clone as its default fallback. The guide supplies provider-specific authentication and checkout examples, including GitHub mirror synchronization. Its main operational constraints are short-lived tokens, empty destination directories and explicit checkout of the build commit. Origin is described as early beta; prices, measured speed improvements and execution results are not established.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete page at [https://cursor.com/docs/origin/clonekit-ci.md]: the early-beta notice, mechanism, prerequisites, provider-specific setup, credential recipes, examples, verification and troubleshooting. Linked CLI, app, API, mirror, Buildkite and sitemap pages are excluded. No commands or workflows were executed. Runtime correctness, performance, reliability and compatibility beyond the documented statements remain unassessed.

The overview

Identity

The resource is Cursor's documentation page for replacing git clone in CI with origin repo clone-fast: [https://cursor.com/docs/origin/clonekit-ci.md]. It is an implementation guide for CloneKit, a feature of Cursor Origin.

The page introduces the mechanism, lists runner requirements, provides Buildkite and GitHub Actions configurations, explains the shared approach for other CI providers, and documents verification and common failures.

Assessment

The guide provides concrete implementation detail for teams already eligible to use CloneKit. It explains how to obtain credentials, prepare the checkout directory, request the intended commit and distinguish a CloneKit checkout from a fallback clone.

Its usefulness depends on Enterprise access and repository activation by Cursor's account team. It supplies no benchmark results, so the size of any checkout improvement is unknown. The examples were not executed, and their runtime correctness was not assessed.

Users

The intended users are developers, build engineers and platform teams responsible for automated repository checkouts. The page addresses hosted and self-hosted Buildkite agents, GitHub Actions, GitLab CI, Jenkins, CircleCI and self-hosted fleets.

Readers need familiarity with shell scripts, CI secrets and Git commits. Buildkite integration also requires a Buildkite organization administrator to connect Origin and an Origin administrator to install the Buildkite app. Beginners can follow the overall sequence, but the guide's linked references are needed for some account and app setup details.

Capabilities

The guide documents prepared-snapshot cloning, incremental fetching and checkout of the current default branch tip. The command supports an optional destination directory, hash verification through --verify, a snapshot-only checkout through --no-top-up, and a repository without a working tree through --bare.

It also explains automatic fallback to git clone, failure instead of fallback through --fallback never, credential-helper registration, explicit commit checkout and GitHub mirror synchronization. Diagnostic output identifies the checkout mode and reports timing phases and failures.

Using it

Requirements

CloneKit requires an Enterprise plan and activation for each repository through Cursor's account team; the page states that there is no self-service toggle. The runner needs the Origin CLI, bash, git, jq, curl 7.55 or later, and openssl 1.1.1 or later.

Supported runners include macOS and Linux with glibc on x64 or arm64. Alpine and other musl-based images are unsupported. Windows compatibility is not described. The destination directory must be empty.

Network access is required to downloads.cursor.com for installation, origin.cursor.com for manifests and Git operations, gitcdn.origin.cursor.com for kit artifacts, and api.cursor.com for app tokens and mirror synchronization. Authentication comes from the Buildkite Agent API or an installed Origin App.

Mechanism

Each clone-fast invocation reads CURSOR_AUTH_TOKEN and requests a manifest identifying the prepared snapshot's artifacts and commit. It downloads the artifacts, checks their sizes, optionally checks their hashes with --verify, and installs them into the empty destination.

By default, it then fetches objects added since the snapshot and checks out the current default branch tip. With --no-top-up, it stays at the snapshot's commit. A successful kit checkout prints mode: clone-kit; the default fallback prints mode: git-clone.

Tokens last at most 15 minutes and cannot be refreshed. They should be minted immediately before use. The CLI treats an injected token as expired five minutes before its expiry claim, and origin auth status checks that claim locally rather than confirming server acceptance.

Setup

First arrange repository activation, install the Origin CLI and confirm runner dependencies and network access. The documented installer is [https://downloads.cursor.com/origin/install.sh], which places the executable at $HOME/.local/bin/origin.

For Buildkite, connect Origin as the repository provider and configure an agent checkout hook. The hook requests a repository-scoped token from the Agent API, exports CURSOR_AUTH_TOKEN, performs the clone, registers the credential helper and checks out BUILDKITE_COMMIT. The token request must use BUILDKITE_REPO exactly as registered, including its .git suffix when present. A repository checkout hook cannot supply this initial checkout because the repository is not yet available.

For other providers, create and install an Origin App. Store its full PEM private key as a CI secret and expose ORIGIN_APP_ID and ORIGIN_INSTALLATION_ID as variables. The supplied bash function signs an EdDSA app JWT and exchanges it for an installation token. App creation details are in a linked page and are not fully established here.

For GitHub Actions, configure an Origin mirror and grant the app repository:mirror:sync alongside repository read access. The workflow waits for the build commit to reach Origin, then clones and checks it out. Its example uses permissions: {} and omits actions/checkout.

Example

The page uses acme/widgets as a placeholder repository. After configuring the Origin App and defining the supplied token function, the documented sequence calls origin_app_token, runs origin repo clone-fast acme/widgets . --verify in an empty directory, and registers authentication with origin auth setup-git.

To build the CI system's chosen commit, it then runs git fetch origin "$COMMIT_SHA" followed by git checkout -q "$COMMIT_SHA". This explicit checkout matters because clone-fast initially selects the default branch tip.

The GitHub Actions example chooses the pull request's head commit and branch. That produces a head-commit build; it does not reproduce GitHub's synthetic pull request merge commit. These are documented examples, and none was executed.

Assessment & evidence

Limitations

The page labels Origin early beta. CloneKit has Enterprise and repository-activation restrictions, requires an empty destination, and excludes musl-based Linux images. A successful checkout can still use ordinary git clone under the default fallback, so job success alone does not prove CloneKit was used.

Authentication can expire during longer jobs, and later GitHub Actions steps must mint another token. A token reported locally as valid may still be rejected by Origin. Missing repository grants or expired credentials can also make the fallback clone fail.

GitHub mirrors introduce synchronization delay. The example waits about two minutes and fails if the commit is still unavailable. Pull requests from forks are not mirrored and must be built from GitHub. When Origin is the source of truth, the upstream synchronization request must be removed.

The evidence does not establish speed gains, reliability, large-repository behavior or compatibility with repository features beyond those explicitly described.

Reasoning

The prepared snapshot and subsequent incremental fetch explain the intended checkout acceleration. Pipelines that repeatedly start with empty workspaces are plausible candidates, but that suitability is an inference from the mechanism rather than a measured result.

The decision depends on the total job impact: snapshot download, incremental fetch, verification, checkout and any mirror wait. The guide provides timing output to support that comparison. Teams must also account for the administration and credential handling needed to obtain access.

Alternatives

Plain git clone is the directly documented alternative and the command's default fallback. It also provides the comparison baseline suggested by the guide. No comparative results establish which approach is faster for a particular repository.

For GitHub fork pull requests, the page directs users to build from GitHub. The supplied evidence does not assess shallow clones, persistent checkout caches or other checkout acceleration products.

Evidence

The evidence is the complete documentation page at [https://cursor.com/docs/origin/clonekit-ci.md], captured on 2026-11-15 at 01:53:24.216 UTC. Its source revision is sha256:4c8d144b25feda574e9e2dd427397f88f2af2ac2c85e64f60ebdc2ae3e752712.

The page supplies commands, authentication functions, a Buildkite hook, a GitHub Actions workflow and diagnostic descriptions. These establish documented behavior, not successful execution or performance. Linked documentation pages were not assessed, and no independent measurements or runtime logs are supplied.

Access & freshness

Costs

The page establishes Enterprise-plan eligibility but gives no subscription price, CloneKit surcharge, usage allowance or billing model. Those costs are unknown.

CI runtime, network charges and any savings from faster checkouts are also unquantified. The guide recommends comparing CloneKit timings with a plain git clone of the same repository on the same runner, but supplies no measured comparison.

Rights

The page does not state a license for its prose, scripts, workflow example or the Origin CLI. Copying and redistribution rights are therefore unknown.

Repository permissions are separate from licensing. Buildkite's checkout token is read-only and scoped to the pipeline repository. Origin App installation tokens request repository:contents:read for clone, fetch and pull; repositoryIds can narrow their repository coverage. Mirror synchronization requires repository:mirror:sync. The Buildkite app connection requests read access to contents and pull requests, plus read and write access to checks.

Freshness

The snapshot was captured on 15 November 2026 and describes Origin as early beta. It does not provide a publication date, CLI release number or minimum Origin CLI version.

The troubleshooting guidance recommends origin update for some authentication failures and asks for origin --version when escalating unresolved problems. Changes after the capture, current live behavior and compatibility with a particular installed CLI version are unknown.

Actions

Confirm Enterprise eligibility and activation for the intended repository, then check runner compatibility, dependencies, network access and an empty checkout directory. Choose the Buildkite token path or Origin App path appropriate to the CI provider.

Configure repository permissions and secret handling as documented, mint the token immediately before cloning, and explicitly fetch and check out the intended build commit. For GitHub Actions, confirm whether the required result is a pull request head build and provide a separate path for fork pull requests.

For the first evaluation, use --verify and --fallback never until the job reports mode: clone-kit. Compare total checkout time with plain git clone on the same runner and repository before assuming a benefit. These are recommended evaluation steps; no results are available here.

Evidence for this report

selected-page.txtselected · checked 2026-11-15