Quickstart
From nothing to a mounted Drive folder. Three steps; the middle one is a one-time Google setup.
1. Install
You need Go and a FUSE mount helper (versions ).
# Linux: the mount helper (fusermount3)
sudo apt install fuse3 # Debian/Ubuntu
sudo dnf install fuse3 # Fedora
go install github.com/syshlted/drivel/cmd/drivel@latestThat puts one binary in $(go env GOPATH)/bin, carrying both of the backends
that ship with Drivel — Google Drive and SFTP. Drivel still runs a backend as a
separate process, starting a copy of itself to be the one a mount asked for, so a
crash in one cannot take your filesystem down. See Installing
for
building from a checkout, macOS and FreeBSD, and shell completions.
2. Get Google credentials
Drivel ships no application identity, so you create your own OAuth client in a Google Cloud project you own. It is free and takes about five minutes: Google credentials .
You end up with a client ID and client secret.
3. Log in and mount
drivel login -account personalThe wizard asks for the client ID/secret and a scope, prints an authorization URL,
and captures the result — either automatically, via a loopback server on port
53682, or by you pasting the redirect URL back into the prompt. It writes
credentials and a token under ~/.config/drivel/personal/, and appends an
[account.personal] block to ~/.config/drivel/config.toml.
It also adds a [[mount]] block to go with it:
[[mount]]
account = "personal"
path = "~/drive-personal" # where the folder appears
data = "~/.local/share/drivel/mounts/personal" # where the files really live
[mount.provider]
root = "root" # "root" is the whole of My Drivedata is written out in full, so it lands where $XDG_DATA_HOME says it should
and stays there if you later change that. Both paths are yours to change — the
block just names them after the account, so open the file and edit it if
somewhere else suits you better. Then:
mkdir -p ~/drive-personal ~/.local/share/drivel/mounts/personal
drivel mount~/drive-personal is now your Drive. Edit files with anything; changes upload in
the background, and changes made elsewhere usually appear within seconds — up to
half a minute after a quiet spell. Ctrl-C unmounts.
Without a config file
A single mount needs no config at all — the flags are enough, and mount is the
default subcommand:
drivel login # writes ./credentials.json, ./token.json
drivel mount -mount ./mnt -data ./data \
-credentials credentials.json -token token.jsonOmit -credentials and Drivel runs log-only: it mounts and proxies, and
prints the changes it would sync without contacting Google. Useful for seeing
what it does before you point it at real data.
What just happened
~/drive-personal is a FUSE mount. Every operation on it is proxied to the
backing directory (~/.local/share/drivel/mounts/personal), which holds the real
files and is the source of truth. Mutations become events on a queue that a sync
engine drains in the background, so no filesystem operation ever waits on the
network. In the other direction a poll loop follows Drive’s change feed and
applies remote edits to the backing directory.
Next
- If your Drive already has files in it, the first run enumerates them. In the
default (eager) mode Drivel does not download them all unless you pass
-materialize; in lazy mode the whole tree appears immediately and costs nothing until you read a file. - Before you point this at data you care about, read Data safety — particularly what Drivel does when two machines edit the same file, and the guards on deletion.