Host identity lives in platform-local state outside Pi configuration.
Catalog autocomplete uses a platform-local stale-while-refresh cache.
Bak performs no filesystem or network work during Pi session startup; initialization starts lazily on first command or backup-triggering event.
Commands
/bak
/bak init <alias>
/bak backup
/bak restore <alias>/<session-id-prefix> [path]
/bak restore all [path]
/bak refresh
/bak status
/bak backup uploads all locally discoverable sessions.
Completed agent runs back up their current session asynchronously.
Restore defaults to the current configured session directory and never silently overwrites differing files.
Tests
mise run //extensions/bak:test covers the archive logic against an in-memory store.
mise run //extensions/bak:e2e drives the real bucket named by the PI_BAK_S3_* environment.
It skips itself when those variables are missing.
Every test host uses a throwaway e2e-* alias and deletes its objects and catalog entry afterwards.
# bakAsynchronous Pi session backup and restore through S3-compatible object storage.
## SetupCreate a private bucket and credentials limited to object read/write access for that bucket.
Set:
```textPI_BAK_S3_ENDPOINT=https://<account>.eu.r2.cloudflarestorage.com
PI_BAK_S3_ACCESS_KEY_ID=...
PI_BAK_S3_SECRET_ACCESS_KEY=...
```
Optional settings:
```textPI_BAK_S3_BUCKET=pi-bak
PI_BAK_S3_REGION=auto
```
Initialize each host once:
```text/bak init <alias>
```
Host identity lives in platform-local state outside Pi configuration.
Catalog autocomplete uses a platform-local stale-while-refresh cache.
Bak performs no filesystem or network work during Pi session startup; initialization starts lazily on first command or backup-triggering event.
## Commands```text/bak
/bak init <alias>
/bak backup
/bak restore <alias>/<session-id-prefix> [path]
/bak restore all [path]
/bak refresh
/bak status
```
`/bak backup` uploads all locally discoverable sessions.
Completed agent runs back up their current session asynchronously.
Restore defaults to the current configured session directory and never silently overwrites differing files.
## Tests`mise run //extensions/bak:test` covers the archive logic against an in-memory store.
`mise run //extensions/bak:e2e` drives the real bucket named by the `PI_BAK_S3_*` environment.
It skips itself when those variables are missing.
Every test host uses a throwaway `e2e-*` alias and deletes its objects and catalog entry afterwards.