Skip to content

Commit

Permalink
chore(docs): clarifications to --import flag on CLI docs (#2996)
Browse files Browse the repository at this point in the history
* Clarifications to `--import` flag on CLI docs

* WIP: Fixed heading, added some more info

* PR: fixing format issues
  • Loading branch information
ddshd authored Jul 1, 2023
1 parent 55e7893 commit d9e0847
Showing 1 changed file with 78 additions and 15 deletions.
93 changes: 78 additions & 15 deletions docs/docs/features/bulk-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ Pre-installed on the `immich-server` container and can be easily accessed throug
immich
```

### Options

| Parameter | Description |
| ---------------- | ------------------------------------------------------------------- |
| --yes / -y | Assume yes on all interactive prompts |
| --recursive / -r | Include subfolders |
| --delete / -da | Delete local assets after upload |
| --key / -k | User's API key |
| --server / -s | Immich's server address |
| --threads / -t | Number of threads to use (Default 5) |
| --album/ -al | Create albums for assets based on the parent folder or a given name |
| --import/ -i | Import gallery (assets are not uploaded) |

## Quick Start

Specify user's credential, Immich's server address and port and the directory you would like to upload videos/photos from.
Expand All @@ -35,27 +48,16 @@ By default, subfolders are not included. To upload a directory including subfold
immich upload --key HFEJ38DNSDUEG --server http://192.168.1.216:2283/api --recursive directory/
```

---

### Options

| Parameter | Description |
| ---------------- | ------------------------------------------------------------------- |
| --yes / -y | Assume yes on all interactive prompts |
| --recursive / -r | Include subfolders |
| --delete / -da | Delete local assets after upload |
| --key / -k | User's API key |
| --server / -s | Immich's server address |
| --threads / -t | Number of threads to use (Default 5) |
| --album/ -al | Create albums for assets based on the parent folder or a given name |
| --import/ -i | Import gallery |

### Obtain the API Key

The API key can be obtained in the user setting panel on the web interface.

![Obtain Api Key](./img/obtain-api-key.png)

---

## Uploading exiting libraries

### Run via Docker

You can run the CLI inside of a docker container to avoid needing to install anything.
Expand Down Expand Up @@ -108,3 +110,64 @@ npm run build
```bash title="Run the command"
node bin/index.js upload --key HFEJ38DNSDUEG --server http://192.168.1.216:2283/api --recursive your/asset/directory
```

---

## Importing existing libraries

If you do not wish to upload files into the server, existing files can be imported into the immich gallery through the use of the `--import` flag.

```
immich upload --key HFEJ38DNSDUEG --server http://192.168.1.216:2283/api --recursive directory/ --import
```

```
immich upload --key HFEJ38DNSDUEG --server http://192.168.1.216:2283/api file1.jpg file2.jpg --import
```

The `immich-server` and `immich-microservices` containers must be able to access the files, or directories at the path referenced in the command. The directories referenced must be set under a user's `External Path` setting. More detailed instructions can be found [here](/docs/features/read-only-gallery).

:::tip Matching volume references
The import command is most easily run on the machine running the immich service, as the path to the files on the machine running the command and the server much match identically.

If you are running immich within docker, the volume pointing to your existing library should be identical with your host machine.

```diff title="docker-compose.yml"
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
command: [ "start.sh", "immich" ]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
+ - /path/to/media:/path/to/media
env_file:
- .env
depends_on:
- redis
- database
- typesense
restart: always

immich-microservices:
container_name: immich_microservices
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
command: [ "start.sh", "microservices" ]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
+ - /path/to/media:/path/to/media
env_file:
- .env
depends_on:
- redis
- database
- typesense
restart: always
```

The proper command for above would be as shown below. You should have access to `/path/to/media` exactly on the environment the CLI command is being run on

```
immich upload --key HFEJ38DNSDUEG --server http://192.168.1.216:2283/api --recursive /path/to/media --import
```

:::

1 comment on commit d9e0847

@vercel
Copy link

@vercel vercel bot commented on d9e0847 Jul 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.