You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Filen CLI provides a set of useful tools for interacting with the cloud:
6
-
-[Accessing your Filen Drive](#access-your-filen-drive) in a stateless environment or [interactive mode](#interactive-mode)
7
-
-[Syncing](#syncing) locations with the cloud (just like the Desktop app)
8
-
- Mounting a [network drive](#network-drive-mounting)
9
-
- Running a [WebDAV mirror server](#webdav-server) of your [personal drive](#single-user), or multiple drives in [proxy mode](#proxy-mode)
10
-
- Running an [S3 mirror server](#s3-server)
6
+
- Accessing your Filen Drive in a stateless environment or interactive mode
7
+
- Syncing locations with the cloud (just like the Desktop app)
8
+
- Mounting a network drive
9
+
- Running a WebDAV mirror server of your personal drive, or multiple drives in proxy mode
10
+
- Running an S3 mirror server
11
11
12
12
> [!Note]
13
13
> Please **report bugs** on our [issues page](https://github.com/FilenCloudDienste/filen-cli/issues)! \
14
14
> **Feature requests** can be submitted on [features.filen.io](https://features.filen.io/?tags=cli).
15
15
16
16
17
-
# Installation and updates
17
+
##Installation and updates
18
18
19
19
You can download the latest binaries from the [release page](https://github.com/FilenCloudDienste/filen-cli/releases/latest), or execute the install script (Linux and macOS):
Docker images are also available as [filen/cli](https://hub.docker.com/repository/docker/filen/cli) (see [below](#using-docker)).
25
25
26
-
The Filen CLI includes an automatic updater that checks for a new release every time the CLI is invoked
27
-
(after checking for updates, it will not check again for the next 10 minutes).
28
-
Invoke the CLI with the `--skip-update` flag to skip checking for updates, or use the `--force-update` flag to check for updates even if it was recently checked.
29
-
Use the `--auto-update` flag to skip the confirmation prompt and update automatically (the CLI will still abort after updating).
30
-
31
-
You can always install any version using `filen install <version>`, `filen install latest` or `filen install canary`.
32
-
33
26
The CLI is also available as an NPM package, which can be installed with `npm install --global @filen/cli` and then invoked as `filen`. The NPM repository always contains the latest canary releases (see below).
34
27
35
-
### Canary releases
36
-
37
-
If you want to be among the first to try out new features and fixes, you can enable canary releases,
38
-
which are early releases meant for a subset of users to test before they are declared as stable.
39
-
To enable or disable canary releases, invoke the CLI with the command `filen canary`.
40
-
41
-
42
-
# Usage
43
-
44
-
```
45
-
$ filen [options...]
46
-
```
47
-
48
-
Options:
49
-
-`--help`, `-h`: display usage information
50
-
-`--verbose`, `-v`: display additional information
51
-
-`--quiet`, `-q`: hide things like progress bars and additional logs
- Invoke the CLI and specify your Filen email and password. You'll have the option to save them in a local encrypted configuration file, which you can delete later using `filen logout`.
60
-
- Invoke the CLI with the `--email` and `--password` (optionally `--two-factor-code`) arguments set.
61
-
- Put your credentials in the `FILEN_EMAIL` and `FILEN_PASSWORD` (optionally `FILEN_2FA_CODE`) environment variables.
62
-
- Store your Filen email and password in a file named `.filen-cli-credentials` where you invoke the CLI. Put your email and password in separate lines, in plain text (optionally 2FA code in third line).
63
-
- Export an "auth config" (which includes your Filen email, password and other details) using `filen export-auth-config`.
64
-
This will produce a file named `.filen-cli-auth-config`, which the CLI will detect when placed in the data directory or the current working directory.
65
-
This option can be useful especially for clustered WebDAV/S3 servers, where otherwise too many login requests result in rate limiting.
66
-
67
-
If you have 2FA enabled and don't specify a 2FA code, you will be prompted for it.
68
-
69
-
### Data directory
70
-
71
-
The data directory is where configuration files, credentials, cache etc. are stored and read from. By default, it is `%APPDATA%/filen-cli` (Windows), `~/Library/Application Support/filen-cli` (macOS) or `$XDG_CONFIG_HOME/filen-cli` or `~/.config/filen-cli` (Unix). If there is a directory named `.filen-cli` at the home directory `~`, it is used instead (for instance, the install script installs to this location). You can overwrite the location using the `--data-dir` flag or the `FILEN_CLI_DATA_DIR` environment variable.
72
-
73
-
74
-
## Access your Filen Drive
75
-
76
-
```
77
-
$ filen [options...] <cmd...>
78
-
```
79
-
80
-
Options:
81
-
-`--root <path>`, `-r <path`: execute a stateless command from a different working directory
82
-
-`--json`: format output as JSON
83
-
-`--no-autocomplete`: disable autocompletion (for performance or bandwidth reasons)
84
-
85
-
### Available commands
86
-
87
-
Many common Unix-style commands are available:
88
-
89
-
-`ls <path to directory>`: list items inside a directory (pass `-l` for more detailed output)
90
-
-`cat <path to file>`: print content of a text file
91
-
-`head <path to file>` / `tail <path to file>`: print first / last 10 lines of a text file (pass `-n 3` for only 3 lines etc.)
92
-
-`mkdir <path to directory>`: create a directory
93
-
-`rm <path>`: delete a file or directory (`--no-trash` to delete permanently)
94
-
-`stat <path>`: display information about a file or directory
95
-
-`statfs`: display information about your Filen cloud drive
96
-
-`whoami`: print the current user
97
-
-`mv <from> <to>` / `cp <from> <to>`: move or copy a file to a path (parent directory or file)
98
-
99
-
There are also non-standard commands specific to Filen:
100
-
101
-
-`download <cloud path> <local destination>`: download a file or directory from the cloud into a local destination
102
-
-`upload <local file> <cloud path>`: upload a local file into the cloud at a specified path
103
-
-`write <file> <content...>`: write text to a file
104
-
-`open <file>`: open a file locally in the associated application
105
-
-`edit <file>`: edit a file locally in the associated application (save and close to re-upload)
106
-
-`view <path>`: view a directory in the Web Drive (you can also invoke `filen drive` to quickly open the Web Drive)
107
-
-`favorites` / `recents`: display favorites or recents
108
-
-`favorite <path>` / `unfavorite <path>`: favorite or unfavorite a file or directory
109
-
110
-
### Interactive mode
111
-
112
-
Invoke the Filen CLI without any specified commands to enter interactive mode.
113
-
There you can specify paths as absolute (starting with `/`) or relative to the current working directory (supports `.` and `..`).
114
-
115
-
Additional available commands:
116
-
-`help`: display available commands
117
-
-`cd <path>`: navigate to a different path
118
-
-`ls`: list items inside current directory
119
-
-`exit`: exit interactive mode
120
-
121
-
### Trash
122
-
123
-
-`filen trash`: view trash items
124
-
-`filen trash restore`: restore a trash item
125
-
-`filen trash delete`: permanently delete a trash item
126
-
-`filen trash empty`: permanently delete all trash items
127
-
128
-
### Public Links
129
-
130
-
-`filen links`: view all public links
131
-
-`filen links <path>`: create, view, edit or delete a public link for the given path
132
-
133
-
### Exporting notes
134
-
135
-
-`filen export-notes <path>`:
136
-
Exports all Notes to the specified path. If the specified directory doesn't exist, it will be created.
137
-
If it is not empty, a subdirectory will be created with the name "filen-notes-export-\<timestamp\>".
138
-
Richtext notes are exported as HTML. Checklist notes are converted to markdown.
139
-
140
-
141
-
## Syncing
142
-
143
-
```
144
-
$ filen sync [sync pairs...] [--continuous]
145
-
```
146
-
147
-
Invoke `filen sync` to sync any locations with your Filen Drive. This is the same functionality you get with the Desktop app.
148
-
149
-
You must specify the sync pairs (`[sync pairs...]` above) as follows:
150
-
-**(central registry)**`filen sync`: Read the sync pairs from `syncPairs.json` (inside the [data dir](#data-directory)).
151
-
This file must contain JSON of the type[^type]`{local: string, remote: string, syncMode: string, alias?: string, disableLocalTrash?: boolean, ignore?: string[], excludeDotFiles?: boolean}[]`.
152
-
`syncMode` can be `twoWay`, `localToCloud`, `localBackup`, `cloudToLocal` or `cloudBackup` (see [here](https://blog.filen.io/how-to-desktop-client/#:~:text=for%20this%20sync.-,Sync%20Modes,-%3A) on what that means). Note that since this is a JSON file, backslashes (`\`) in strings need to be escaped, e. g. `"C:\\some\\path"`).
153
-
-**(custom registry)**`filen sync <file>`: Read the sync pairs from a custom JSON file (same type as above).
154
-
-**(aliases)**`filen sync mypair myotherpair`: Sync the sync pairs from the central registry that were given the aliases `mypair` and `myotherpair`.
155
-
-**(literal pair)**`filen sync /local/path:twoWay:/cloud/path`: Sync the local path `/local/path` with the cloud path `/cloud/path` in two-way sync.
156
-
-**(shorthand for two-way pairs)**`filen sync /local:/cloud`: Sync `/local` with `/cloud` in two-way sync.
157
-
-**(other sync modes and abbreviations)**`filen sync /local1:localToCloud:/cloud1 /local2:ltc:/cloud2`: Sync `/local1` with `/cloud1` (and `/local2` with `/cloud2`) in local-to-cloud sync
-**(disable local trash)**`filen sync /local:/cloud --disable-local-trash`: Disable local trash
28
+
The Filen CLI includes an automatic updater, for which you can enable canary releases (if you want to be among the first to try out new features and fixes). You can also install any specific version from within the CLI. See `filen --help updates`.
160
29
161
-
You can set the `--continuous` flag to keep syncing (instead of only syncing once).
162
30
163
-
[^type]: This is a [TypeScript type definition](https://www.typescriptlang.org/docs/handbook/2/objects.html), where `?` means an optional field.
31
+
## Documentation
164
32
165
-
166
-
## Network drive mounting
167
-
168
-
```
169
-
$ filen mount [mount point]
170
-
```
171
-
172
-
Invoke `filen mount` to mount a network drive that mirrors your Filen Drive. The default mount point is `X:` (Windows) / `/tmp/filen` (UNIX).
173
-
174
-
On Windows, [WinFSP](https://winfsp.dev/rel) needs to be installed. On Linux, [FUSE3](https://github.com/libfuse/libfuse) needs to be installed. On macOS, [FUSE-T](https://www.fuse-t.org/) or [macFUSE](https://osxfuse.github.io/) needs to be installed.
175
-
176
-
For more information, see also [FilenCloudDienste/filen-network-drive](https://github.com/FilenCloudDienste/filen-virtual-drive).
177
-
178
-
179
-
## WebDAV server
180
-
181
-
You can use the Filen CLI to start a WebDAV server that acts as a mirror server of your Filen Drive.
182
-
183
-
For more information, see also [FilenCloudDienste/filen-webdav](https://github.com/FilenCloudDienste/filen-webdav).
Invoke `filen webdav` to start a local WebDAV server that mirrors your personal Filen Drive.
192
-
This might be useful for allowing local applications to access your Filen Drive via WebDAV.
193
-
194
-
You must specify login credentials for connecting to the server using the `--w-user` and `--w-password` options (these credentials should be different from your Filen account credentials).
195
-
196
-
Options:
197
-
198
-
-`--w-https`: run the server on HTTPS instead of HTTP (using a self-signed certificate)
199
-
-`--w-hostname`: which hostname the server should be started on (default is 0.0.0.0)
200
-
-`--w-port`: which port the server should be started on (default is 80 or 443)
201
-
-`--w-auth-scheme`: the authentication scheme the server should use, "basic" or "digest" (default is basic)
202
-
-`--w-threads`: enables clustering, number of threads to use for the server (default is no clustering; explicitly set to 0 to set by CPU core count).
203
-
If you experience rate-limiting using this, using an [auth config](#authenticating) might help.
204
-
205
-
### Proxy mode
206
-
207
-
```
208
-
$ filen webdav-proxy [options...]
209
-
```
210
-
211
-
Invoke the `filen webdav-proxy` to start a WebDAV server that allows any user to connect using their Filen account credentials and access their own Filen Drive.
212
-
This might be useful when hosting a proxy server for multiple users.
213
-
Digest auth is not available for proxy mode.
214
-
215
-
**Important:** In proxy mode, the password has to be formatted as `password=yoursecretpassword&twoFactorAuthentication=<RECOVERY_CODE_OR_6_DIGIT_OTP_CODE>` (you can also leave out the `&twoFactorAuthentication=...` part if 2FA is disabled for your account).
216
-
217
-
Options: `--w-https`, `--w-hostname`, `--w-port`, `--w-threads` as above
Invoke `filen s3` to start an S3 server that acts as a mirror server of your Filen Drive.
227
-
You must specify credentials (Access Key ID and Secret Access Key) for connecting to the server using the `--s3-access-key-id` and `--s3-secret-access-key` options (these credentials should be different from your Filen account credentials).
228
-
229
-
**Important:** When connecting to the S3 server, you need to enable `s3ForcePathStyle` and set the region to `filen`.
230
-
231
-
For more information, including on S3 compatibility, see also [FilenCloudDienste/filen-s3](https://github.com/FilenCloudDienste/filen-s3).
232
-
233
-
Options:
234
-
235
-
-`--s3-https`: run the server on HTTPS instead of HTTP (using a self-signed certificate)
236
-
-`--s3-hostname`: which hostname the server should be started on (default is 0.0.0.0)
237
-
-`--s3-port`: which port the server should be started on (default is 80 or 443)
238
-
-`--s3-threads`: enables clustering, number of threads to use for the server (default is no clustering; explicitly set to 0 to set by CPU core count).
239
-
If you experience rate-limiting using this, using an [auth config](#authenticating) might help.
240
-
241
-
## Using Docker
242
-
243
-
You can run the CLI in a Docker container using the [`filen/cli`](https://hub.docker.com/repository/docker/filen/cli) image.
244
-
245
-
For example, to run a WebDAV/S3 server in a container, you can use a [Docker Compose](https://docs.docker.com/compose) file similar to this:
246
-
247
-
```yaml
248
-
services:
249
-
filen-webdav:
250
-
image: filen/cli:latest
251
-
ports:
252
-
- 80:80
253
-
command: >
254
-
--email <...>
255
-
--password <...>
256
-
webdav
257
-
--w-user <...>
258
-
--w-password <...>
259
-
```
33
+
You can find exhaustive but concise documentation from within the CLI using the `filen --help <cmd or topic>` command and at [docs.cli.filen.io](https://docs.cli.filen.io/). Longer-form documentation is at [docs.filen.io](https://docs.filen.io/docs/cli).
0 commit comments