Create an Artifacts repo from a Worker and use a standard Git client to push and pull content.
By the end of this guide, you will create a Worker, bind it to Artifacts, create a repo through the Workers binding, push a commit, and clone the same repo back with a standard Git client.
Start by reading Namespaces, then choose the namespace name you will use. This guide uses default in the examples.
- Sign up for a Cloudflare account ↗.
- Install
Node.js↗.
Node.js version manager
Use a Node version manager like Volta ↗ or nvm ↗ to avoid permission issues and change Node.js versions. Wrangler, discussed later in this guide, requires a Node version of 16.17.0 or later.
You also need:
- Wrangler installed. If you use local Wrangler commands in this guide, authenticate Wrangler first. For local OAuth authentication or CI setup, refer to
wrangler loginand Running Wrangler in CI/CD. - Access to Artifacts in your Cloudflare account.
- A namespace name, for example
default. - A local
gitclient. jq, if you want to extract response fields automatically.
-
Create a new Worker project with C3: