---
title: Anonymous repos
description: 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.

```ts
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`](/docs/cli#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.

```sh
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.

**Note:**   The smart HTTP anonymous push flow is a separate transport and is not part of this release.

  - [Git SDK](/docs/sdk): Use the typed SDK to write files and commit from memory.
  - [Getting started](/docs/getting-started): Full setup with an account and the CLI.
