Skip to content

docs: document the --init flag and first-use destination bootstrap#130

Merged
mbertschler merged 1 commit into
mainfrom
claude/document-init-flag
Jun 20, 2026
Merged

docs: document the --init flag and first-use destination bootstrap#130
mbertschler merged 1 commit into
mainfrom
claude/document-init-flag

Conversation

@mbertschler

Copy link
Copy Markdown
Owner

Targets main.

The --init flag was documented only in the CLI flag help, and the README's kopia section actively contradicted the shipped behaviour — it said the repository is created "on first use", when first-use creation is in fact gated behind --init (and the agent/scheduler never passes it). This fixes the docs.

Changes (README only)

  • Correct the kopia section — the repository is not auto-created; the first sync to a new kopia destination must be run once with --init.
  • New "First use and the .squirrel-volume marker" section — what --init bootstraps per destination type, kept accurate to the code:
    • local — writes the .squirrel-volume marker; later syncs require it (sync/sync.go ensureDestinationMarker, gated on dest.Type == "local").
    • kopia — permits kopia repository create when connect finds no repo.
    • remote rclone (sftp/s3/b2/gcs) — marker not yet enforced, so --init isn't required for them (tracked as a follow-up, sync: require .squirrel-volume markers on destination and source to gate against misconfiguration #64).
    • …and the rationale: first-use creation is a deliberate, human-driven step because a missing marker/repo is ambiguous (genuinely new vs. temporarily unreachable), and auto-creating an empty target on a transient outage could let offload later delete the only local copy.
  • CLI reference — list --init on the sync usage line and in the flag table.

No code change. Verified the documented behaviour against sync/sync.go (ensureDestinationMarker, the dest.Type == "local" gate) and cmd/squirrel/sync.go (the --init flag).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KE9A1VTdw7k1GQq87fQyfx


Generated by Claude Code

The README said a kopia repo is created "on first use", which contradicts
the shipped behaviour: first-use creation is gated behind `--init` (and
the agent/scheduler never passes it). `--init` was documented only in the
flag help, not the README.

- Correct the kopia section: the repository is not auto-created; first
  sync needs `--init`.
- Add a "First use and the .squirrel-volume marker" section explaining
  what `--init` bootstraps per destination type (local marker, kopia
  repo; remote rclone markers are a tracked follow-up) and why first-use
  creation is a deliberate human-driven step rather than automatic.
- List `--init` in the CLI reference (sync usage + flag table).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KE9A1VTdw7k1GQq87fQyfx
@mbertschler mbertschler merged commit f335d34 into main Jun 20, 2026
2 checks passed
@mbertschler mbertschler deleted the claude/document-init-flag branch June 20, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants