diff --git a/README.md b/README.md index ab5a757..0ec5680 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ This is a minimal command-line application that unlocks a single vault of vault Download the zip file via [GitHub Releases](https://github.com/cryptomator/cli/releases) and unzip it to your desired directory, e.g. -```sh +```shell curl -L https://github.com/cryptomator/cli/releases/download/0.7.0/cryptomator-cli-0.7.0-mac-arm64.dmg --output cryptomator-cli.zip unzip cryptomator-cli.zip ``` Afterwards, you can directly run Cryptomator-CLI: -```sh +```shell cryptomator-cli unlock \ --password:stdin \ --mounter=org.cryptomator.frontend.fuse.mount.LinuxFuseMountProvider \ @@ -25,22 +25,26 @@ cryptomator-cli unlock \ For a complete list of options, use the`--help` option. ```shell -cryptomator-cli unlock --help` +cryptomator-cli --help` ``` ## FileSystem Integration -For an OS integration of your unlocked vault, cryptomator-cli relies on third party libraries which must be installed seperately. +To integrate the unlocked vault into the filesystem, cryptomator-cli relies on third party libraries which must be installed separately. These are: * [WinFsp](https://winfsp.dev/) for Windows * [macFUSE](https://osxfuse.github.io/) or [FUSE-T](https://www.fuse-t.org/) for macOS * and [libfuse](https://github.com/libfuse/libfuse) for Linux/BSD systems (normally provided by a fuse3 package of your distro, e.g. [ubuntu](https://packages.ubuntu.com/noble/fuse3)) -As a fallback, you can [skip filesystem integration](README.md#skip-filesystem-integration). +As a fallback, you can [skip filesystem integration](README.md#skip-filesystem-integration) by using WebDAV. ## Selecting the Mounter -TODO +To list all available mounters, use the `list-mounters` subcommand: +```shell +cryptomator-cli list-mounters +``` +Pick one from the printed list and use it as input for the `--mounter` option. ## Skip Filesystem Integration diff --git a/src/main/java/org/cryptomator/cli/CryptomatorCli.java b/src/main/java/org/cryptomator/cli/CryptomatorCli.java index 6204276..971a1e8 100644 --- a/src/main/java/org/cryptomator/cli/CryptomatorCli.java +++ b/src/main/java/org/cryptomator/cli/CryptomatorCli.java @@ -12,7 +12,7 @@ mixinStandardHelpOptions = true, version = "${org.cryptomator.cli.version}", description = "Unlocks a cryptomator vault and mounts it into the system.", - subcommands = Unlock.class) + subcommands = { Unlock.class, ListMounters.class}) public class CryptomatorCli { private static final Logger LOG = LoggerFactory.getLogger(CryptomatorCli.class); diff --git a/src/main/java/org/cryptomator/cli/ListMounters.java b/src/main/java/org/cryptomator/cli/ListMounters.java new file mode 100644 index 0000000..7f33bbf --- /dev/null +++ b/src/main/java/org/cryptomator/cli/ListMounters.java @@ -0,0 +1,28 @@ +package org.cryptomator.cli; + +import org.cryptomator.integrations.common.IntegrationsLoader; +import org.cryptomator.integrations.mount.MountService; +import picocli.CommandLine; + +import java.util.concurrent.Callable; + +@CommandLine.Command(name = "list-mounters", + headerHeading = "Usage:%n%n", + synopsisHeading = "%n", + descriptionHeading = "%nDescription:%n%n", + optionListHeading = "%nOptions:%n", + header = "Lists available mounters", + description = "Prints a list of available mounters to STDIN. A mounter is is the object to mount/integrate the unlocked vault into the local filesystem. In the GUI app, mounter is named \"volume type\".", + mixinStandardHelpOptions = true) +public class ListMounters implements Callable { + + @CommandLine.Option(names = {"--withDisplayName"}, description = "Prints also the display name of each mounter, as used in the GUI app.") + boolean withDisplayName = false; + + @Override + public Integer call() throws Exception { + IntegrationsLoader.loadAll(MountService.class) + .forEach(s -> System.out.println(s.getClass().getName() + (withDisplayName? " | " + s.displayName():""))); + return 0; + } +} diff --git a/src/main/java/org/cryptomator/cli/Unlock.java b/src/main/java/org/cryptomator/cli/Unlock.java index 85e3585..070bfc5 100644 --- a/src/main/java/org/cryptomator/cli/Unlock.java +++ b/src/main/java/org/cryptomator/cli/Unlock.java @@ -20,7 +20,18 @@ import java.security.SecureRandom; import java.util.concurrent.Callable; -@Command(name = "unlock") +@Command(name = "unlock", + header = "Unlocks a vault", + description = "Unlocks and mounts the given cryptomator vault, identified by the path to the vault directory." + + "The unlocked vault is mounted into the local filesystem by the specified mounter." + + "For a list of available mounters, use the `list-mounters` subcommand.", + parameterListHeading = "%nParameters:%n", + headerHeading = "Usage:%n%n", + synopsisHeading = "%n", + descriptionHeading = "%nDescription:%n%n", + optionListHeading = "%nOptions:%n", + + mixinStandardHelpOptions = true) public class Unlock implements Callable { private static final Logger LOG = LoggerFactory.getLogger(Unlock.class); @@ -51,6 +62,7 @@ void setMaxCleartextNameLength(int input) { } maxCleartextNameLength = input; } + private int maxCleartextNameLength = 0; private SecureRandom csprng = null;