Skip to content

Start typing to search the documentation.

Anonymous repos

Create an ephemeral repo with no account from the SDK or CLI.

Anonymous repos are available through the SDK and CLI. The SDK creates an ephemeral repo, then writes commits through the same public API contract as signed-in repos.

import { garage } from '@thegarage/sdk'

const git = await garage.ephemeral({ ttl: '24h' })

await git.add('README.md', '# hello')
await git.commit('initial')

console.log(git.remote)
console.log(git.expiresAt)

Prefer the CLI? The garage anon subcommand tree covers repo lifecycle and cloning — garage anon create mints an ephemeral repo and persists the anon identifier to ~/.config/garage/anon.json (mode 0600), and garage anon clone materializes it locally with a credential helper that keeps git fetch working without auth. Anonymous git writes from memory are SDK/API-only.

garage anon create --ttl 6h
garage anon clone <name>

Current scope

Capability Status
SDK anonymous repo create Available
SDK commit API Available
Anonymous repo get / list / delete Available
CLI garage anon subcommand tree Available
CLI garage anon clone (read-only) Available
Plain git push to /push Not available yet
Claiming an anonymous repo Not available yet

Anonymous repos expire automatically. The default TTL is 24 hours and the maximum is 72 hours; pass ttl: '30m', ttl: '6h', etc. on the SDK call, or --ttl 30m on the CLI.