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

# CLI

> One command per step, for scripts and plain terminals.

```bash theme={null}
wandersort add --paths ~/Pictures,/Volumes/SD   # plan where every file goes
wandersort organise                              # correct the plan
wandersort copy                                  # copy the files in
wandersort check                                 # later: verify the library
```

`wandersort --help` and `wandersort <command> --help` list every flag.

## Flags for every command

| Flag | Does |
| - | - |
| `-o, --output-path` | Library folder: empty, or an existing library. Without it, the one you used last. |
| `--plain` | No full-screen screen; plain line logging. |
| `-v, --version` | Print the version. |

## add

Reads the given folders, fingerprints every photo and video in them, works out which are duplicates, and plans where each one belongs. Nothing is copied.

```bash theme={null}
wandersort add -p ~/Pictures -p /Volumes/SD
wandersort add -p ~/Pictures,/Volumes/SD -o ~/wandersort-out
```

| Flag | Does |
| - | - |
| `-p, --paths` | Folders to add (repeat it, or comma-separate). Asked for on screen if left out; required with `--plain`. |
| `--force` | Re-read every already-scanned file instead of skipping unchanged ones. |
| `--json` | Print one JSON result at the end (implies `--plain`). |

## organise

Opens the planned folder tree so you can rename, merge, drop and flatten folders before anything is copied. See [Organise](https://wandersort.utkarshchourasia.in/docs/usage/tui.md#organise) for the keys.

## copy

Applies your edits and copies every file into `<library>/<planned folder>`. Sources are never changed or deleted, and each copy is checked against the scanned fingerprint. Safe to re-run: an interrupted copy picks up where it left off, and files that failed are tried again.

| Flag | Does |
| - | - |
| `--dry-run` | Report what would be copied, and where, without touching anything. |
| `--json` | Print one JSON result at the end (implies `--plain`). |

If some files are left out, the copy writes an HTML page listing each one, grouped by drive, beside that run's log in `~/.wandersort/logs/`.

## check

Checks the library against its records: every copied file is still there and the right size, and with `--full` still matches its fingerprint. Nothing is changed or deleted.

| Flag | Does |
| - | - |
| `--full` | Re-read every file and compare it with its fingerprint. |
| `--json` | Print one JSON result at the end (implies `--plain`). |

## admin

Looking after the library itself. A library never needs these to run.

| Command | Does |
| - | - |
| `admin report` | Packages recent logs into a zip for a bug report. `--redact-paths` replaces every path; `--include-db` adds the database (it holds file paths and photo details). |
| `admin db --restore` | Puts the database back from its backup. |
| `admin db --reset` | Empties the database, keeping your settings, after backing it up. `--yes` skips the question. |
| `admin clear` | Deletes the cached preview copies made by peeking while organising. |

## Exit codes

| Code | Meaning |
| - | - |
| 0 | Finished (also when there was nothing new) |
| 1 | Stopped by an error; the next run carries on |
| 2 | Couldn't start: bad flags or arguments |
| 3 | Finished, but some files failed; each is named |
| 4 | Another wandersort is using the library |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.