dotweave init
Create or clone the sync directory and establish the age identity.
Synopsis
dotweave init [--force] [--key-file <path>] [<repository>]
Create or connect the sync directory under the dotweave home directory, then record the settings that later push and pull commands read.
Arguments
| Argument | Type and default | Purpose |
|---|---|---|
repository | string, optional | Remote URL or local git repository path to clone. Omit it to initialize an empty local repository instead. |
Flags
| Flag | Type and default | Purpose |
|---|---|---|
--force | boolean, false | Delete the existing sync directory, identity file, and settings before initializing. |
--key-file | string, none | Read an age private key from a file instead of prompting for it. |
Behavior
With no repository argument, init runs git init -b main in the sync directory. With one, it runs git clone. It refuses to initialize a directory that already exists and is not empty.
It then writes the repository scaffolding: .gitattributes containing * -text, the managed .gitignore block that keeps encrypted artifacts committable, and a manifest.jsonc at version 9 with repositoryFormat 1, no entries, and one recipient.
For the age identity it uses --key-file when given, reuses keys.txt when one already exists, and otherwise generates a new identity. When you clone a repository that already has recipients and supply no key, init prompts for the private key in an interactive terminal, and fails outright when it cannot prompt.
dotweave init
· Initializing sync directory...
✔ Sync directory initialized
git: initialized new repository
age: generated a new local identity
0 entries · 1 recipients
init does not add a git remote, commit anything, or push. Use dotweave cd and git for that.
--force deletes keys.txt. Any secret artifact encrypted only to that identity becomes unrecoverable. Back up the key before you use this flag.
Errors
init fails when the directory is already initialized, when it exists and is not empty, when git is missing or the clone source is unreachable, and when a cloned repository needs an age key you did not supply. Read Error messages for each message and its fix.
Related commands
Read Set up your first sync for the full first-run path, or Set up a second device when the repository already exists.