> ## Documentation Index
> Fetch the complete documentation index at: https://docs.obsidianlog.com/llms.txt
> Use this file to discover all available pages before exploring further.

# obsidianlog init

> Interactive setup wizard: generate keys, configure a storage backend, write config.toml.

This generates the archive's AES-256 encryption key, walks you through
choosing a storage backend, and writes `config.toml`. It's idempotent, so
re-running it detects an existing config and key and reuses them unless
you pass `--force`.

## Flags

| Flag                | Description                                                                                                                                                                                                 |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--non-interactive` | Accepts every default, with no prompts. It always picks the local backend. Useful for scripting (CI, Docker).                                                                                               |
| `--force`           | Overwrites an existing configuration. This rotates the encryption key, which makes previously archived data undecryptable with the new key, so it asks for confirmation unless you're also non-interactive. |

Plus the global [`--config <FILE>`](/cli/overview#global-flags).

## What it asks (interactively)

1. **Storage bucket / namespace**: default `obsidianlog`.
2. **Storage backend**: `local` (no Sia node needed) or `sia`.
3. If `local`: **local storage directory**, default `./obsidianlog-data`.
   If `sia`: an **indexer URL**, defaulting to
   [`https://sia.storage`](https://sia.storage) (the hosted, zero-setup
   option), then a **recovery phrase** prompt (type `seed` to generate a new
   one) to complete onboarding inline, no separate command needed. See
   [Choosing a Backend](/storage-backends/choosing-a-backend) for what this
   actually connects to and when to use a different URL instead.
4. **Ingest server bind address**: default `127.0.0.1:7080`.
5. **Chunk time window (seconds)**: default `3600`.

## Where credentials live

The encryption key and, if you chose Sia, the indexd app key are stored
together as one bundled credential (Keychain on macOS, Credential Manager
on Windows, Secret Service on Linux), falling back to a `0600` secrets file
(`~/.obsidianlog/`) if the keychain isn't reachable. It is never
transmitted or committed anywhere.

A fresh setup means at most one keychain authorization prompt, whether you
choose the local or the Sia backend (macOS may skip it entirely once it
already trusts the binary). On macOS this uses a direct, "create only"
keychain write rather than the usual check-then-write pattern most tools
use. See [ADR-0015](https://github.com/emmaglorypraise/ObsidianLog/blob/main/docs/adr/0015-bundled-credential-single-prompt-setup.md)
for why that matters.

A config file from before this bundled format (obsidianlog 0.1.x) isn't
migrated automatically: `init` fails with a clear message telling you to
either stay on `obsidianlog` v0.1.1 to keep reading archives created under
it, or pass `--force` to knowingly start fresh (this rotates the encryption
key).

## Example

```sh theme={null}
obsidianlog init
```

Non-interactive, for scripting:

```sh theme={null}
obsidianlog init --non-interactive --config /etc/obsidianlog/config.toml
```
