# acr-console-cli

### Setup

* `cp .env.shadow .env`
* Add private key from [ACRCloud dashboard](https://console-v2.acrcloud.com/account#/developer) as `ACR_CLOUD_KEY`
* Set `ENVIRONMENT` accordingly (selects integer bucket ID to use)

### Running

1. Start container as interactive bash shell.

```
user@hostmachine:$ docker-compose build cli && docker-compose run cli
```

2. Run script in container

```
app_user@abc123:~$ python src/cli.py --help
usage: cli.py [-h] [--bucket BUCKET] {create,single,list} ...

positional arguments:
  {create,single,list}

optional arguments:
  -h, --help            show this help message and exit
  --bucket BUCKET       override default bucket ID (default: None)
```

:bulb: `jq` is already installed in the container for your convenience, output should be valid json!

3. Exit container

```
app_user@abc123:~$ exit
```

### Developing

* There is no need to re-start the container when anything in `src/` or `assets/` changes due to the volume mounting configuration.
* Re-builds and re-starts are necessary for changes in `Dockerfile` or `docker-compose.yaml` or `.env`.

