local, docker-compose,
k8s) into the current directory. The first invocation drops a complete
deployment tree in your project root; re-running with the same scaffold is
idempotent. Switching scaffolds in an existing project is refused — see
Switching modes below.
Only --scaffold local requires the directory to be a git repository (the
local backend uses git worktrees to isolate agent runs). --scaffold k8s
and --scaffold docker-compose run agents as Kubernetes Jobs or compose
services and do not need a .git directory; you can fracta init --scaffold k8s in a fresh empty folder.
Scaffolds
--scaffold value | Use when | Produces |
|---|---|---|
local | Single-machine development; agents run as host subprocesses | fracta.yaml (runtime.backend: local), .fracta/state.db, deployment/auth-helpers/ |
docker-compose | Local containerized stack: controlplane, gateway, postgres, falkordb, strategy-runner | fracta.yaml (thin client), deployment/docker-compose.yml, deployment/configs/, deployment/auth-helpers/ |
k8s | Kubernetes deployment; agents as Jobs or stream pods | fracta.yaml (runtime.backend: kubernetes with extra_volumes), deployment/k8s/manifests/, deployment/auth-helpers/ |
local scaffold is the lightest; docker-compose and k8s scaffold a full
service topology. See the per-mode guides:
--source resolution
--source value | Resolves to |
|---|---|
| (unset) | The scaffold tree baked into your fracta binary (offline-by-default) |
./relative/path or /abs/path | Local filesystem; expects <path>/<kind>/ to exist |
github:owner/repo@ref | Codeload tarball from https://codeload.github.com/owner/repo/tar.gz/<ref>; expects <repo>/<kind>/ |
https://...tar.gz | Raw HTTPS tarball; expects <kind>/ at archive root |
--source-checksum sha256:<hex> for integrity verification — without it,
init prints a warning and proceeds.
GitHub refs that don’t look like commit SHAs (anything not matching
[0-9a-f]{7,}) emit a reproducibility warning to stderr — pin to commit
SHAs or release tags for CI/CD.
What gets written
The walker materializes every file in the chosen scaffold tree, skipping existing files by default (so re-runningfracta init doesn’t clobber
operator edits). Files under any auth-helpers/ directory are always
written with mode 0755; everything else preserves the source-reported mode
or defaults to 0644.
fracta init also:
- Verifies the directory is a git repo only for
--scaffold local(the local backend uses worktrees). Compose and k8s scaffolds skip this check; they run agents as services / Jobs, so.gitis irrelevant. - Checks scaffold-specific dependencies via
prereq.EnsureDepsFor(kind):localneedsgit;docker-composeneedsdocker+ thedocker composeplugin;k8sneedskubectl(warns if no current kube-context, doesn’t fail). - Initializes
.fracta/state.db(SQLite) forlocalscaffolds only. Compose and k8s use postgres-backed state in their deployed services. - Appends
.fracta/and.worktrees/to.gitignoreif not already present.
Switching modes
A project that’s already been scaffolded as one mode cannot be re-initialized as another. Spec-42 ships single-mode-per-project: thefracta.yaml,
deployment/ tree, and embedded controlplane configs are mode-coupled, so a
mixed scaffold would produce a tree where the manifests, configs, and
top-level config disagree about what’s running.
If you try to switch:
- Switch destructively:
rm -rf deployment/ fracta.yaml .fracta/ && fracta init --scaffold k8s. Loses any operator edits. - Re-run idempotently:
fracta init --scaffold localagainst an existing local project skips existing files (0 written, N skipped) and refreshes anything missing. - Multi-mode requirements: see the Switching modes section of the deployment overview for separate-repo and separate-worktree patterns.
Conflict policy and --force
| Default | --force |
|---|---|
Existing files are preserved (SkipExisting) | Existing files are overwritten (Overwrite) |
Output reports N written, M skipped | Prompts [y/N] unless --yes is passed |
--force is destructive and bypasses the mode-mismatch check above only if
you rm -rf the relevant directories first. Force-overwriting an existing
mode (e.g. --force --scaffold local on a local project) refreshes the
template files in place — useful if you want to revert local edits.
Deprecated invocation
--scaffold explicitly. Update scripts
and documentation now.
