Module init

Module init 

Source
Expand description

§init module

Provides the implementation of the init sub-command for the command-line interface. The sub-command creates an empty repository, writes the default configuration (.epoch), and sets up the first epoch (epoch 0).

The main public API consists of:

  • InitCmd - a struct containing the command-line arguments.

§Guide

The init sub‑command bootstraps a new epoch repository:

  • It creates the default .epoch configuration file in the current directory.
  • It creates an empty epoch 0 folder (with its metadata file).
  • It refuses to run if the target directory already contains files unless the user supplies --force.

§How to use

epoch init            # normal init – directory must be empty
epoch init --force    # skip the empty‑folder check

§Table Entry

Sub‑commandUsageWhat it changes
initepoch init [--force]Initialize the current folder as an epoch folder

Structs§

InitCmd
Arguments for the init subcommand.

Functions§

init
Initialise an empty repository.
init_epoch 🔒
Helper that creates the initial epoch (epoch 0).