Metadata-Version: 2.1
Name: wcpan-drive-cli
Version: 2.3.3
Summary: command line tool for wcpan.drive
License: MIT
Author: Wei-Cheng Pan
Author-email: legnaleurc@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed
Requires-Dist: Pillow (>=9.0,<10.0)
Requires-Dist: PyYAML (>=6.0,<7.0)
Requires-Dist: wcpan-drive-core (>=3.1.0,<4.0.0)
Requires-Dist: wcpan-logging (>=2.0.1,<3.0.0)
Requires-Dist: wcpan-queue (>=7.0.0,<8.0.0)
Description-Content-Type: text/markdown

# wcpan.drive.cli

Command line tool for `wcpan.drive`.

This package needs a driver to actually work with a cloud drive.

## Config

You will need a `core.yaml` file in **config path**.
By default it is `$HOME/.config/wcpan.drive`, but you can change it by
`--config-prefix` flag.

```sh
python3 -m wcpan.drive.cli --config-prefix=/path/to/config ...
```

Here is an example of `core.yaml`:

```yaml
version: 1
database: nodes.sqlite
driver: wcpan.drive.google.driver.GoogleDriver
middleware: []
```

## Command Line Usage

Get the latest help:

```sh
python3 -m wcpan.drive.cli -h
```

You need to authorize an user first.

```sh
python3 -m wcpan.drive.cli auth
```

Then you should build local cache.
Many commands reliy on this cache to avoid making too many API requests.

Note that this is the **ONLY** command that will update the cache.
Which means after `upload`, `mkdir`, `remove`, `rename`, you need to run this
command to make the cache up-to-date.

```sh
python3 -m wcpan.drive.cli sync
```

The `remove` command only put files to trash can, it does **NOT** permanently
remove **ANY** files.
Removing a folder will also remove all its descendants.

```
python3 -m wcpan.drive.cli remove file1 file2 ...
```

