Documentation Index
Fetch the complete documentation index at: https://photocli.com/llms.txt
Use this file to discover all available pages before exploring further.
photo-cli archive copies photos into a fixed /year/month/day/ folder hierarchy, embeds a SHA1 hash in every file name to detect duplicates, and records all metadata — date taken, GPS coordinates, and reverse geocode address — into a photo-cli.sqlite3 database in the output folder root. Running the command again on new photos adds only the files that are not already present; duplicates are skipped automatically.
Synopsis
How archive differs from copy
Unlikephoto-cli copy, the archive command uses a fixed output structure and naming scheme that you cannot override:
- Folder structure: always
/year/month/day/— for example,2008/10/22/. - File names: always
yyyy.MM.dd_HH.mm.ss-{sha1hash}.ext— for example,2008.10.22_16.28.39-5d66eec547469a1817bda4abe35c801359b2bb55.jpg. - Deduplication: two files with the same SHA1 hash are treated as the same photo. The second one is skipped and a warning is printed to the console.
- SQLite index: every archived photo is recorded in
photo-cli.sqlite3, including all EXIF and geocode fields, so you can query your archive with standard SQL tools.
Because duplicates are detected by file hash rather than file name, you can safely run
photo-cli archive repeatedly as you import new photos. Only genuinely new files will be added to the output folder and the SQLite database.Arguments
Required
File system path to the archive folder. Created automatically if it does not exist. All year/month/day subfolders and the
photo-cli.sqlite3 database will be placed here.Optional
File system path to read photos from. Defaults to the current working directory. No files in this path are ever modified.
Simulate the archive process without writing any files to disk. No extra value required — pass the flag alone.
Action to take when a photo has no EXIF date taken. Photos without a date are placed in a
no-photo-taken-date folder named with only the SHA1 hash when Continue is selected.| Name | Value |
|---|---|
| Continue (default) | 0 |
| PreventProcess | 1 |
Action to take when a photo has no GPS coordinate.
| Name | Value |
|---|---|
| Continue (default) | 0 |
| PreventProcess | 1 |
Maximum expected day difference between the earliest and latest photo taken dates. If the range exceeds this value, the process stops before archiving. Useful for preventing accidental archiving of unrelated photo sets.
Whether to link archived photos to an album.
| Name | Value |
|---|---|
| NoAlbumLinking (default) | 0 |
| Individual | 1 |
| DateRange | 2 |
Name for a new album to create and link the currently archiving photos to. Use with
--album-type set to Individual or DateRange.Existing album ID to link the currently archiving photos to. Use with
--album-type set to Individual or DateRange. Album IDs can be listed with photo-cli list --type Albums.Automatically create or update albums for each reverse geocode property level. For example, if you use
country city as reverse geocode properties, albums are created for each country and city found. No extra value required — pass the flag alone.Delete source photo files, companion files, and empty directories after a successful archive operation. No extra value required — pass the flag alone.
Action to take when any photo has missing reverse geocode information.
| Name | Value |
|---|---|
| Continue (default) | 0 |
| PreventProcess | 1 |
Language/culture value to get localized address results from the reverse geocode provider. See your provider’s documentation for supported values.
Action to take when a file cannot be parsed as a valid photo format.
| Name | Value |
|---|---|
| Continue (default) | 0 |
| PreventProcess | 1 |
Third-party provider used to resolve GPS coordinates into a human-readable address. See reverse geocoding overview for provider setup and API key details.
| Name | Value |
|---|---|
| Disabled (default) | 0 |
| BigDataCloud | 1 |
| OpenStreetMapFoundation | 2 |
| GoogleMaps | 3 |
| LocationIq | 5 |
Space-separated OpenStreetMap address property names used to build the address string. Required when
--reverse-geocode is OpenStreetMapFoundation or LocationIq.Space-separated BigDataCloud admin level numbers. Required when
--reverse-geocode is BigDataCloud.API key for BigDataCloud. Also configurable via the
PHOTO_CLI_BIG_DATA_CLOUD_API_KEY environment variable or the BigDataCloudApiKey setting.Space-separated Google Maps address component types. Required when
--reverse-geocode is GoogleMaps.API key for Google Maps. Also configurable via the
PHOTO_CLI_GOOGLE_MAPS_API_KEY environment variable or the GoogleMapsApiKey setting.API key for LocationIq. Also configurable via the
PHOTO_CLI_LOCATIONIQ_API_KEY environment variable or the LocationIqApiKey setting.Bypass the free-tier rate limit when using LocationIq with a paid license.
Example
The following example archives photos with a user-defined album, auto-creates reverse geocode albums, and deletes source files on success.Output folder structure
Companion files (like
.mov from iPhone Live Photos) are automatically copied alongside their parent photo with the same base name. The 2025/06/03 entry above shows a .heic photo with its companion .mov file.Listing albums after archiving
After archiving with--album-name and --auto-reverse-geocode-album, you can list the created albums:
My-Album) and auto-created reverse geocode albums for each location property level (e.g., Italia, Firenze, Venezia, United Kingdom).
SQLite database
photo-cli.sqlite3 is created in the output folder root and updated on every run. Each row represents one archived photo. You can query it with any SQLite client.
| Column | Description |
|---|---|
Id | Auto-incremented integer primary key |
Path | Relative path to the archived file within the output folder |
CreatedAt | UTC timestamp when this record was inserted |
DateTaken | EXIF date and time the photo was taken |
ReverseGeocodeFormatted | Human-readable address string |
Latitude | GPS latitude |
Longitude | GPS longitude |
Year | Year component of the taken date |
Month | Month component of the taken date |
Day | Day component of the taken date |
Hour | Hour component of the taken date |
Minute | Minute component of the taken date |
Seconds | Seconds component of the taken date |
Address1–Address8 | Individual address components from the reverse geocode provider |
Sha1Hash | SHA1 hash of the file, used for deduplication |
IsDeleted | Whether the photo has been marked as deleted |
ModifiedAt | UTC timestamp when this record was last modified |