2023-11-19 22:16:24 +00:00
|
|
|
A command-line interface for interfacing with the self-hosted photo manager [Immich](https://immich.app/).
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
# Installing
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
To use the cli, run
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
$ npm install @immich/cli
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
# Usage
|
|
|
|
|
|
|
|
To use the CLI, you need to login with an API key first:
|
|
|
|
|
|
|
|
$ immich login-key https://your-immich-instance/api your-api-key
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
NOTE: This will store your api key in cleartext under ~/.config/immich/auth.yml
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
Next, you can run commands, for example:
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
$ immich server-info
|
2023-07-06 14:37:47 +00:00
|
|
|
|
|
|
|
When you're done, log out to remove the credentials from your filesystem
|
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
$ immich logout
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
# Commands
|
2023-07-06 14:37:47 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
Usage: immich [options] [command]
|
|
|
|
|
|
|
|
Immich command line interface
|
|
|
|
|
|
|
|
Options:
|
|
|
|
-h, --help display help for command
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
upload [options] [paths...] Upload assets
|
|
|
|
server-info Display server information
|
|
|
|
login-key [instanceUrl] [apiKey] Login using an API key
|
2023-11-19 22:16:24 +00:00
|
|
|
logout Remove stored credentials
|
2023-07-06 14:37:47 +00:00
|
|
|
help [command] display help for command
|
|
|
|
```
|
|
|
|
|
|
|
|
# Todo
|
|
|
|
|
|
|
|
- Sidecar should check both .jpg.xmp and .xmp
|
|
|
|
- Sidecar check could be case-insensitive
|
2023-11-19 22:16:24 +00:00
|
|
|
- Use the SDK for all api calls. We currently use raw axos http calls
|
|
|
|
- Use list of supported files from server via api
|
|
|
|
|
|
|
|
# For developers
|
|
|
|
|
|
|
|
To run the Immich CLI from source, run the following in the cli folder:
|
|
|
|
|
|
|
|
$ 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
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
You can also build and install the CLI using
|
2023-07-06 14:37:47 +00:00
|
|
|
|
2023-11-19 22:16:24 +00:00
|
|
|
$ npm run build
|
|
|
|
$ npm install -g .
|