Skip to content

Fastest way to scaffold your LLM powered personal knowledge base - Obsidian, Claude Code, qmd, Github

2.1 KB
Raw Blame
# Cloudflare Artifacts remote

[Cloudflare Artifacts](https://developers.cloudflare.com/artifacts/) is a git-compatible object storage remote. It's a good choice if you don't want to use GitHub — your vault data stays on Cloudflare's infrastructure and never touches GitHub.

## Prerequisites

- A [Cloudflare account](https://dash.cloudflare.com/sign-up)
- `wrangler` CLI — if not installed, the setup wizard falls back to `npx wrangler` automatically

## Setup (automatic)

When you run `npx claude-second-brain` and select **Cloudflare Artifacts** as your remote, the CLI handles everything:

1. Checks wrangler auth (logs you in and requests the `artifacts:write` scope if needed)
2. Creates a new Artifacts repo via the Cloudflare API
3. Runs `git remote add origin <remote-url>`
4. Pushes the initial commit
5. Prints a short-lived repo token — **save it**

## Saving your repo token

After setup, the CLI prints a repo token:

```
Save your Artifacts repo token — it expires and you'll need to mint a new one:
  <token>
```

This token is used as the git credential for push and pull. It expires (default TTL: 24 hours). Save it somewhere — you'll need to mint a replacement when it expires.

## Pushing and pulling after setup

Repo tokens expire, so mint a fresh one before each push/pull session:

```bash
# 1. Get your wrangler OAuth token
TOKEN=$(wrangler auth token)

# 2. Mint a new repo token (replace 'my-brain' and 'default' with your repo and namespace)
curl -X POST https://artifacts.cloudflare.net/v1/api/namespaces/default/tokens \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"repo":"my-brain","scope":"write","ttl":86400}'
```

The response contains a `token` field. Use it as a git credential:

```bash
git -c http.extraHeader="Authorization: Bearer <token>" push origin main
git -c http.extraHeader="Authorization: Bearer <token>" pull origin main
```

## Namespace

During setup, the CLI asks for an **Artifacts namespace** (default: `default`). Namespaces scope repos within your Cloudflare account — useful if you manage multiple projects. For personal use, the default is fine.