ente/cli/README.md

104 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2024-03-07 07:23:12 +00:00
# Ente CLI
The Ente CLI is a Command Line Utility for exporting data from
[Ente](https://ente.io). It also does a few more things, for example, you can
use it to decrypting the export from Ente Auth.
2023-09-25 08:49:03 +00:00
2023-10-21 08:56:32 +00:00
## Install
2024-03-07 07:23:12 +00:00
The easiest way is to download a pre-built binary from the [GitHub
releases](https://github.com/ente-io/ente/releases?q=tag%3Acli-v0&expanded=true).
2023-10-21 08:56:32 +00:00
2024-03-07 07:23:12 +00:00
You can also build these binaries yourself
```shell
./release.sh
```
Or you can build from source
2023-10-21 08:56:32 +00:00
```shell
2023-10-25 11:54:36 +00:00
go build -o "bin/ente" main.go
2023-10-21 08:56:32 +00:00
```
2023-09-14 07:33:20 +00:00
2024-03-07 07:23:12 +00:00
The generated binaries are standalone, static binaries with no dependencies. You
can run them directly, or put them somewhere in your PATH.
There is also an option to use [Docker](#docker).
## Usage
2023-09-21 12:40:18 +00:00
2023-10-21 08:56:32 +00:00
Run the help command to see all available commands.
2024-03-07 07:23:12 +00:00
2023-10-21 08:56:32 +00:00
```shell
2023-10-25 11:54:36 +00:00
ente --help
2023-10-21 08:56:32 +00:00
```
2023-09-21 12:40:18 +00:00
2024-03-07 07:23:12 +00:00
### Accounts
2023-10-25 11:54:36 +00:00
If you wish, you can add multiple accounts (your own and that of your family members) and export all data using this tool.
2024-03-07 07:23:12 +00:00
#### Add an account
2023-10-25 11:54:36 +00:00
```shell
ente account add
```
2024-03-07 07:23:12 +00:00
#### List accounts
2023-10-25 11:54:36 +00:00
```shell
ente account list
```
2024-03-07 07:23:12 +00:00
#### Change export directory
2023-10-25 11:54:36 +00:00
```shell
ente account update --email email@domain.com --dir ~/photos
2023-10-25 11:54:36 +00:00
```
2023-09-21 12:40:18 +00:00
2023-10-21 08:56:32 +00:00
### Export
2024-03-07 07:23:12 +00:00
#### Start export
2023-10-25 11:54:36 +00:00
```shell
ente export
```
---
2023-09-21 12:40:18 +00:00
2023-10-18 12:22:41 +00:00
## Docker
2023-10-25 11:54:36 +00:00
If you fancy Docker, you can also run the CLI within a container.
2023-10-18 12:22:41 +00:00
### Configure
2023-10-25 11:54:36 +00:00
2024-03-07 07:23:12 +00:00
Modify the `docker-compose.yml` and add volume. ``cli-data`` volume is
mandatory, you can add more volumes for your export directory.
2023-10-25 11:54:36 +00:00
Build the docker image
2024-03-07 07:23:12 +00:00
2023-10-25 11:54:36 +00:00
```shell
docker build -t ente:latest .
```
Note that [BuildKit](https://docs.docker.com/go/buildkit/) is needed to build
this image. If you face this issue, a quick fix is to add `DOCKER_BUILDKIT=1` in
front of the build command.
2023-10-25 11:54:36 +00:00
Start the container in detached mode
2024-03-07 07:23:12 +00:00
```shell
2023-10-25 11:54:36 +00:00
docker-compose up -d
```
`exec` into the container
2023-10-18 12:22:41 +00:00
```shell
2023-10-25 11:54:36 +00:00
docker-compose exec ente /bin/sh
2023-10-18 12:22:41 +00:00
```
2023-10-25 11:54:36 +00:00
#### Directly executing commands
2023-10-18 12:22:41 +00:00
2023-10-25 11:54:36 +00:00
```shell
docker run -it --rm ente:latest ls
2023-10-25 11:54:36 +00:00
```