Bence Ferdinandy 31af44dd2a
feat: add --json-output option to upload command (#18845)
* fix(docs): update the cli upload usage

The cli upload usage is missing some options compared to what is the current
output of `immich upload --help`. Update the docs accordingly.

Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>

* feat(cli): add --json-output option to upload command

Add an option that allows retrieving per-file information about the
upload process. The output includes the newFiles, duplicates and
newAssets lists, but could accommodate more information later if needed.

One use case this allows for is using --dry-run to get a list of all the
files that would be uploaded, and checking them manually before an
upload. This can be particularly useful when a curated subset of images
have already been uploaded to immich and we want to double check for
some stragglers without uploading everything to immich.

The upload command has a few lines of logging, so to get an actually
parsable json one needs to strip those lines:

  immich upload --dry-run * | tail -n +4 | jq .newFiles[]

Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>

---------

Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
2025-06-02 01:58:58 +00:00
..
2023-07-06 09:37:47 -05:00
2023-12-18 20:29:26 -06:00
2024-03-14 13:09:27 -04:00
2024-01-12 07:36:27 -05:00
2025-05-27 12:12:37 +02:00
2024-02-12 15:31:59 +00:00
2025-05-27 16:47:49 +00:00
2025-05-27 16:47:49 +00:00

A command-line interface for interfacing with the self-hosted photo manager Immich.

Please see the Immich CLI documentation.

For developers

Before building the CLI, you must build the immich server and the open-api client. To build the server run the following in the server folder:

$ npm install
$ npm run build

Then, to build the open-api client run the following in the open-api folder:

$ ./bin/generate-open-api.sh

To run the Immich CLI from source, run the following in the cli folder:

$ npm install
$ npm run build
$ ts-node .

You'll need ts-node, the easiest way to install it is to use npm:

$ npm i -g ts-node

You can also build and install the CLI using

$ npm run build
$ npm install -g .