Documentation
¶
Overview ¶
Command moraine organizes photos automatically: it scans a source directory (or a single file), groups photos into events by capture time, classifies each group into a theme, and copies the photos into destination/<theme>/<year>/<year-month-day>/. Originals are preserved. Single static binary, pure Go, no CGo. exiftool is required to read RAW files.
The command tree (sort / clean / version) lives in internal/cli; main only injects the build version and delegates to cli.Execute.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
app
Package app wires moraine's organize pipeline (scan → EXIF → cluster → classify → copy) behind a single testable entrypoint, decoupled from the CLI transport (Constitution Principle III).
|
Package app wires moraine's organize pipeline (scan → EXIF → cluster → classify → copy) behind a single testable entrypoint, decoupled from the CLI transport (Constitution Principle III). |
|
classify
Package classify assigns a theme to a cluster using a three-stage pipeline: an optional Ollama vision model (constrained to the configured theme set) decides first; if it is unavailable, errors, or abstains, a pure-Go altitude heuristic applies; otherwise a guaranteed fallback theme is used (FR-004/FR-005).
|
Package classify assigns a theme to a cluster using a three-stage pipeline: an optional Ollama vision model (constrained to the configured theme set) decides first; if it is unavailable, errors, or abstains, a pure-Go altitude heuristic applies; otherwise a guaranteed fallback theme is used (FR-004/FR-005). |
|
clean
Package clean implements the `clean` subcommand's filesystem logic: it deletes source originals whose byte-identical copy already exists under the destination, matching purely by SHA-256 content (never by filename) and never touching the destination tree.
|
Package clean implements the `clean` subcommand's filesystem logic: it deletes source originals whose byte-identical copy already exists under the destination, matching purely by SHA-256 content (never by filename) and never touching the destination tree. |
|
cli
Package cli is moraine's transport layer: it builds the Cobra command tree (root + the sort/clean/version subcommands), wires each command to the typed config and the app orchestrators, and maps command execution to the process exit code.
|
Package cli is moraine's transport layer: it builds the Cobra command tree (root + the sort/clean/version subcommands), wires each command to the typed config and the app orchestrators, and maps command execution to the process exit code. |
|
cluster
Package cluster groups photos into events by scanning capture times and opening a new group whenever the gap between consecutive photos exceeds a configurable threshold.
|
Package cluster groups photos into events by scanning capture times and opening a new group whenever the gap between consecutive photos exceeds a configurable threshold. |
|
config
Package config centralises moraine's typed configuration (Constitution Principle II): a single Config struct built once from CLI inputs, validated, then passed explicitly to the packages that need it.
|
Package config centralises moraine's typed configuration (Constitution Principle II): a single Config struct built once from CLI inputs, validated, then passed explicitly to the packages that need it. |
|
contenthash
Package contenthash defines moraine's content identity: the SHA-256 digest of a file's bytes.
|
Package contenthash defines moraine's content identity: the SHA-256 digest of a file's bytes. |
|
exifmeta
Package exifmeta extracts capture metadata (date, GPS, altitude) from image files using the pure-Go imagemeta library.
|
Package exifmeta extracts capture metadata (date, GPS, altitude) from image files using the pure-Go imagemeta library. |
|
exiftooltest
Package exiftooltest builds a fake `exiftool` executable for tests, so the exec-based RAW preview path can be exercised without a real exiftool install.
|
Package exiftooltest builds a fake `exiftool` executable for tests, so the exec-based RAW preview path can be exercised without a real exiftool install. |
|
organize
Package organize places photos onto disk under a deterministic destination/<theme>/<year>/<year-month-day>/ layout.
|
Package organize places photos onto disk under a deterministic destination/<theme>/<year>/<year-month-day>/ layout. |
|
photo
Package photo holds the core domain types produced by the scan/EXIF/cluster pipeline.
|
Package photo holds the core domain types produced by the scan/EXIF/cluster pipeline. |
|
rawpreview
Package rawpreview is the single place that talks to the external exiftool program.
|
Package rawpreview is the single place that talks to the external exiftool program. |
|
scan
Package scan walks a source directory and lists the image files moraine can sort, excluding the destination root so already-sorted photos are never re-ingested (I1 / FR-021).
|
Package scan walks a source directory and lists the image files moraine can sort, excluding the destination root so already-sorted photos are never re-ingested (I1 / FR-021). |
Click to show internal directories.
Click to hide internal directories.