chore(cli): use upload api and update documentation (#6927)

* use fetch api

* bump version

* add documentation

* revert to using file blob
This commit is contained in:
Jonathan Jogenfors 2024-02-06 11:00:35 +01:00 committed by GitHub
parent ce6dc3b7af
commit 755444e9a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 43 deletions

View file

@ -39,10 +39,11 @@ immich
```
Usage: immich [options] [command]
Immich command line interface
Command line interface for Immich
Options:
-V, --version output the version number
-d, --config Configuration directory (env: IMMICH_CONFIG_DIR)
-h, --help display help for command
Commands:
@ -69,7 +70,9 @@ Options:
-r, --recursive Recursive (default: false, env: IMMICH_RECURSIVE)
-i, --ignore [paths...] Paths to ignore (env: IMMICH_IGNORE_PATHS)
-h, --skip-hash Don't hash files before upload (default: false, env: IMMICH_SKIP_HASH)
-H, --include-hidden Include hidden folders (default: false, env: IMMICH_INCLUDE_HIDDEN)
-a, --album Automatically create albums based on folder name (default: false, env: IMMICH_AUTO_CREATE_ALBUM)
-A, --album-name <name> Add all assets to specified album (env: IMMICH_ALBUM_NAME)
-n, --dry-run Don't perform any actions, just show what will be done (default: false, env: IMMICH_DRY_RUN)
--delete Delete local assets after upload (env: IMMICH_DELETE_ASSETS)
--help display help for command
@ -91,7 +94,7 @@ For instance,
immich login-key http://192.168.1.216:2283/api HFEJ38DNSDUEG
```
This will store your credentials in a file in your home directory. Please keep the file secure, either by performing the logout command after you are done, or deleting it manually.
This will store your credentials in a `auth.yml` file in the configuration directory which defaults to `~/.config/`. The directory can be set with the `-d` option or the environment variable `IMMICH_CONFIG_DIR`. Please keep the file secure, either by performing the logout command after you are done, or deleting it manually.
Once you are authenticated, you can upload assets to your Immich server.
@ -123,6 +126,12 @@ You can automatically create albums based on the folder name by passing the `--a
immich upload --album --recursive directory/
```
You can also choose to upload all assets to a specific album with the `--album-name` option.
```bash
immich upload --album-name "My summer holiday" --recursive directory/
```
It is possible to skip assets matching a glob pattern by passing the `--ignore` option. See [the library documentation](docs/features/libraries.md) on how to use glob patterns. You can add several exclusion patterns if needed.
```bash
@ -133,6 +142,12 @@ immich upload --ignore **/Raw/** --recursive directory/
immich upload --ignore **/Raw/** **/*.tif --recursive directory/
```
By default, hidden files are skipped. If you want to include hidden files, use the `--include-hidden` option:
```bash
immich upload --include-hidden --recursive directory/
```
### Obtain the API Key
The API key can be obtained in the user setting panel on the web interface.