Skip to content

Commit b61993d

Browse files
authored
workers: fix code example (#29799)
* [Artifacts] add docs scaffold * [Artifacts] add get-started guides * [Artifacts] add API references and pricing * [Artifacts] add CODEOWNERS entry * [Artifacts] fix pricing copy * [Artifacts] expand beta changelog entry * [Artifacts] align binding and git docs * [Artifacts] correct REST and git endpoints * [Artifacts] fix workers remote example * [Artifacts] clarify import URL behavior * [Artifacts] remove authenticated remotes page * [Artifacts] expand metrics and limits docs * [Artifacts] expand git and platform docs * [Artifacts] clarify Git protocol docs * [Artifacts] refresh ArtifactFS and examples * [Artifacts] update pricing and limits docs * [Artifacts] flesh out Sandbox SDK example * [Artifacts] align docs to updated schema * [Artifacts] clarify Sandbox SDK intro * [Artifacts] trim Sandbox SDK example * [Artifacts] strengthen overview * [Artifacts] fix binding docs * update * [Artifacts] align docs with current runtime * [Artifacts] tighten docs examples * [Artifacts] clarify REST API auth * [Artifacts] improve get started guides * [Artifacts] address review nits * [Artifacts] add repo naming and git notes guidance * [Artifacts] reframe concepts docs * [Artifacts] add guides and ArtifactFS docs * [Artifacts] finalize docs updates
1 parent 7de9935 commit b61993d

30 files changed

Lines changed: 2882 additions & 0 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ package.json @cloudflare/content-engineering
105105

106106
# Developer Platform
107107

108+
/src/content/docs/artifacts/ @elithrar @dmmulroy @mattzcarey @whoiskatrin @cloudflare/pcx-technical-writing @cloudflare/product-owners
108109
/src/content/docs/containers/ @mikenomitch @th0m @cloudflare/pcx-technical-writing @cloudflare/product-owners @cloudflare/cloudchamber
109110
/src/content/partials/containers/ @mikenomitch @th0m @cloudflare/pcx-technical-writing @cloudflare/product-owners @cloudflare/cloudchamber
110111
/src/content/docs/d1/ @elithrar @rozenmd @vy-ton @joshthoward @oxyjun @harshil1712 @cloudflare/pcx-technical-writing @cloudflare/product-owners
85.7 KB
Loading
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: "Artifacts now in beta: versioned filesystem with Git access"
3+
description: Artifacts is now available in beta as a versioned filesystem for Workers, APIs, and Git-compatible workflows.
4+
products:
5+
- artifacts
6+
date: 2026-04-16
7+
---
8+
9+
[Artifacts](/artifacts/) is now in private beta. Artifacts is Git-compatible storage built for scale: create tens of millions of repos, fork from any remote, and hand off a URL to any Git client. It provides a versioned filesystem for storing and exchanging file trees across Workers, the REST API, and any Git client, running locally or within an agent.
10+
11+
You can [read the announcement blog](https://blog.cloudflare.com/artifacts-git-for-agents-beta/) to learn more about what Artifacts does, how it works, and how it works.
12+
13+
You can use the Workers binding to create a repo and read back its remote URL:
14+
15+
```ts
16+
const created = await env.ARTIFACTS.create("starter-repo");
17+
const remote = (await created.repo.info())?.remote;
18+
```
19+
20+
Or, use the REST API to create a repo inside a namespace from your agent(s) running on any platform:
21+
22+
```bash
23+
curl --request POST "https://artifacts.cloudflare.net/v1/api/namespaces/some-namespace/repos" --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" --header "Content-Type: application/json" --data '{"name":"agent-007"}'
24+
```
25+
26+
Any Git client that speaks smart HTTP can use the returned remote URL:
27+
28+
```bash
29+
git clone https://x:${REPO_TOKEN}@artifacts.cloudflare.net/some-namespace/agent-007.git
30+
```
31+
32+
To learn more, refer to [Get started](/artifacts/get-started/), [Workers binding](/artifacts/api/workers-binding/), and [Git protocol](/artifacts/api/git-protocol/).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
id: a9X2kP
2+
name: Artifacts
3+
4+
entry:
5+
title: Artifacts
6+
url: /artifacts/
7+
group: Developer platform
8+
9+
meta:
10+
title: Cloudflare Artifacts docs
11+
description: Store, version, and share filesystem artifacts across Workers, APIs, and git-compatible tools
12+
author: "@cloudflare"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Git protocol
3+
description: Use Artifacts with standard git-over-HTTPS clients.
4+
pcx_content_type: reference
5+
sidebar:
6+
order: 3
7+
---
8+
9+
Artifacts exposes Git access for every Artifacts repository.
10+
11+
Each repo has a standard Git smart HTTP remote at `https://{accountId}.artifacts.cloudflare.net/git/{namespace}/{repo}.git`.
12+
13+
Use the returned repo `remote` with a regular Git client for `clone`, `fetch`, `pull`, and `push`.
14+
15+
## Authentication
16+
17+
Git routes accept repo access tokens in two forms:
18+
19+
| Format | Details | Example |
20+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
21+
| Bearer token in `http.extraHeader` | Recommended for local workflows. Use the full token string returned by the control plane and keep credentials out of the remote URL. | `git -c http.extraHeader="Authorization: Bearer $ARTIFACTS_TOKEN" clone "$ARTIFACTS_REMOTE" artifacts-clone` |
22+
| HTTP Basic auth in the remote URL | Use for short-lived, one-off commands when you need a self-contained remote. Put the token secret in the password slot. | `https://x:<token-secret>@<accountId>.artifacts.cloudflare.net/git/<namespace>/<repo>.git` |
23+
24+
### Token format
25+
26+
Repo tokens are issued in the control-plane response format `art_v1_<40 hex>?expires=<unix_seconds>`.
27+
28+
### Git `extraHeader` parameter
29+
30+
Git's [`http.extraHeader`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpextraHeader) setting lets you attach an HTTP header to git requests.
31+
32+
If you want to use the full token string returned by the API, pass it as a Bearer token:
33+
34+
```sh
35+
git -c http.extraHeader="Authorization: Bearer $ARTIFACTS_TOKEN" clone "$ARTIFACTS_REMOTE" artifacts-clone
36+
```
37+
38+
### HTTPS remote with Basic auth
39+
40+
For the URL form, use the token secret in the password slot. Artifacts ignores the Basic auth username.
41+
42+
Use this form only when you need a self-contained remote URL for a short-lived command.
43+
44+
```sh
45+
export ARTIFACTS_TOKEN_SECRET="${ARTIFACTS_TOKEN%%\?expires=*}"
46+
export ARTIFACTS_AUTH_REMOTE="https://x:${ARTIFACTS_TOKEN_SECRET}@${ARTIFACTS_REMOTE#https://}"
47+
```
48+
49+
```sh
50+
git clone "$ARTIFACTS_AUTH_REMOTE" artifacts-clone
51+
```
52+
53+
```sh
54+
git push "$ARTIFACTS_AUTH_REMOTE" HEAD:main
55+
```
56+
57+
Use any non-empty username in the URL. Artifacts accepts that username but does not otherwise use or log it, so `x` is just a placeholder.
58+
59+
## Protocol support
60+
61+
Artifacts supports Git protocol v1 and v2 for clone and fetch. Git clients negotiate the protocol automatically.
62+
63+
| Operation | Git service | Protocol support | Notes |
64+
| --------------------------------- | ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
65+
| Clone and fetch | `git-upload-pack` | v1 and v2 | Protocol v2 supports `ls-refs` and `fetch`. Protocol v1 supports normal fetch flows, including shallow and deepen fetches. |
66+
| Push | `git-receive-pack` | v1 | Push uses the standard v1 receive-pack flow. |
67+
| Push over protocol v2 | `git-receive-pack` | Not supported | Artifacts does not support v2 receive-pack. |
68+
| Optional protocol v1 capabilities | `git-upload-pack` | Partial | Some optional v1 capabilities, such as `filter` and `include-tag`, are not supported. |
69+
70+
## Token scopes
71+
72+
| Scope | Commands | Notes |
73+
| ------- | ------------------------------------------------ | ------------------------------------------------------- |
74+
| `read` | `git clone`, `git fetch`, `git pull` | Use for read-only access. |
75+
| `write` | `git clone`, `git fetch`, `git pull`, `git push` | `git push` mutates the repo and requires a write token. |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: API
3+
description: Reference the Artifacts Workers binding, REST API, and filesystem interfaces.
4+
pcx_content_type: navigation
5+
sidebar:
6+
order: 5
7+
group:
8+
hideIndex: true
9+
---
10+
11+
import { DirectoryListing } from "~/components";
12+
13+
Use the Artifacts API reference to understand the interfaces exposed across Workers, HTTP, and Git-compatible workflows.
14+
15+
<DirectoryListing />

0 commit comments

Comments
 (0)