@qorventa/dryft
v0.2.0
Published
Treat several cloud drive accounts as one store, with a git-shaped CLI
Maintainers
Readme
dryft
Treat several cloud drive accounts as one store, with a CLI shaped like git.
A placement policy decides which drive each file lands on, and dryft remembers
where everything went — so dr pull holiday.mp4 finds a file again without you
knowing which account holds it.
$ dr push ~/photos
sent photos/2026/holiday.mp4 400.0 KB -> [email protected] bad1928b70
sent photos/avatar.jpg 30.0 KB -> [email protected] 389d2720ad
Pushed 2 file(s), 430.0 KB.
$ dr ls
photos/2026/holiday.mp4 400.0 KB [email protected]
photos/avatar.jpg 30.0 KB [email protected]Transfers run device to cloud through rclone. File contents never pass through a dryft server.
Install
npm install -g @qorventa/dryftPrebuilt binaries ship per platform (macOS arm64/x64, Linux x64/arm64, Windows
x64) as optionalDependencies, so npm fetches only the one that matches and no
install script downloads anything.
From source, or with Go:
go install github.com/yeongseo/dryft@latest # the CLI
make # both binaries, in placeEither way you also need rclone on PATH; a bare dr tells you if it is
missing.
Two modes
dryft picks one based on where you run it. There is no flag.
| | Service mode | Workspace mode |
| --- | --- | --- |
| Where | anywhere outside a .dr directory | inside one made by dr init |
| Accounts | linked once with dr account add, shared by every device | configured per folder with dr remote add |
| File map | on a dryft server | in .dr/objects.db |
| Needs a server | yes | no |
| Staging | none — dr push <path> | dr add then dr push |
Service mode is what makes a second machine work with no setup. Workspace mode is self-contained and never talks to anything but your own drives.
Service mode
dr login # browser sign-in with Google
dr account add # link another account as a drive
dr account list # every drive, with live capacity
dr push ~/photos # the server picks a drive per file
dr ls # everything stored, and where
dr pull holiday.mp4 # by name, from whichever drive holds it
dr drive ls # browse the Drive itself
dr log # history, shared across your devices
dr rm old.zip # forget it (--erase deletes from the drive too)The account you sign in with becomes the main account: your identity, and a
drive like any other. Signing in again never changes it — only
dr account main does.
A second machine needs nothing but a login:
dr login
dr pull --allPaths
Service mode has one namespace per account, not one per folder. A file under
your home directory keeps its layout — ~/photos/rome.jpg is stored as
photos/rome.jpg and lands in the same place on any machine. Anything else is
stored under its file name. --as overrides either, and --to <email> pins a
file to one drive.
Re-pushing a file the policy now sends elsewhere moves it: the new copy is uploaded and recorded first, then the old one is deleted.
What the device holds
~/.config/dryft/ keeps the server URL, the signed-in email, and a 0600
session token. That token is device-scoped, expires, and is revocable with
dr logout.
Google credentials never reach the device. The server holds the refresh token, sealed, and mints one-hour access tokens when a transfer needs one.
Workspace mode
mkdir photos && cd photos
dr init
export DR_PASSPHRASE='...'
dr remote add gdrive --type google # opens a browser for OAuth
dr remote add onedrive --type onedrive
dr add .
dr status
dr push -n # show the placement plan
dr push
dr diff # local vs what is really on the drivesproject/.dr/
config.yaml remotes and policy (YAML, editable by hand)
index.db staging area
objects.db path -> remote mapping
tokens/ credentials, AES-256-GCM
log append-only historydr finds .dr by walking up, exactly as git finds .git. Backends for
--type: google, onedrive, s3, dropbox, box, local.
Credentials are read out of a throwaway rclone config create, encrypted, and
injected into the rclone subprocess as environment variables at transfer time —
they are never written to disk in the clear, and your global rclone.conf is
left alone.
Placement policy
One interface, in internal/policy:
type Strategy interface {
Name() string
SelectRemote(fileSize int64, fileType string, remotes []Remote) (string, error)
}Three strategies ship:
mfs(default) — most free space. Fills accounts evenly and leaves the largest possible room for the next big file.roundrobin— cycle through the accounts that can hold the file.filetype— route by extension, falling back tomfswhen no rule applies or the rule's account is full.
Free space is debited as each file is assigned, so one push spreads across drives instead of aiming everything at whichever was emptiest at the start. In service mode the policy runs on the server, so every device decides from the same view — two laptops pushing at once do not both pick the same drive.
Workspace mode configures it in .dr/config.yaml:
policy:
strategy: filetype
reserve_bytes: 1073741824 # never fill a drive past this headroom
rules:
- extensions: [mp4, mkv, iso]
remote: bigdriveService mode uses PUT /v1/policy. A dr policy command is not written yet.
Browsing a Drive
dr drive ls # every linked account, top level
dr drive ls Photos/2026 # one folder
dr drive tree -L 3 # folders, three levels deepdr ls shows dryft's namespace; dr drive ls shows the Google Drive itself,
marking with * the items dryft put there.
What you can see depends on the server's scope. By default dryft requests
drive.file, which reaches only files it created — so a Drive full of your
existing folders will look empty, and the CLI says so rather than leaving you
guessing. Browsing everything needs DRYFT_DRIVE_ACCESS=read-all, which adds
the restricted drive.readonly scope; Google then caps the app at 100 users
until it passes verification and a paid annual security assessment. See
server/README.md.
Language
English and Korean, following your system locale.
dr lang # what is active, and why
dr lang ko # save a preference
dr --lang en ls # one command onlyPrecedence: --lang, DR_LANG, the saved setting, then LC_ALL /
LC_MESSAGES / LANG. Server messages are translated too — the CLI sends
Accept-Language and the server chooses per request, so several users in
different languages are served correctly at once.
Running a server
See server/README.md for the Google Cloud OAuth client you
must create, and deploy/README.md for deployment. One
command covers a fresh Linux host:
scripts/deploy.sh [email protected] cli.example.comIt detects the host's architecture, cross-compiles, installs Postgres, systemd and TLS, and adapts to an nginx that is already serving other sites.
Set DRYFT_ALLOWED_EMAILS unless you mean to run an open service: publishing
the OAuth app otherwise lets any Google account register and leaves you holding
their tokens. See SECURITY.md.
Environment variables
| Variable | Effect |
| --- | --- |
| DR_LANG | Interface language (en, ko). |
| DR_RCLONE | Path to the rclone binary. |
| DR_PASSPHRASE | Workspace mode: derive the token key from a passphrase instead of a key file. |
| DR_NO_WELCOME | Make a bare dr print plain help instead of the first-run screen. |
| DRYFT_SERVER | Point one command at a different server. |
| DRYFT_TOKEN | Supply a session token, for CI. |
| DRYFT_CONFIG_DIR | Relocate ~/.config/dryft. |
| NO_COLOR | Disable colour (also off automatically when not a terminal). |
Development
make check runs gofmt, vet and the tests. scripts/demo-fake.sh exercises the
whole service flow with no Google project and no real drives.
See CONTRIBUTING.md.
Known gaps
- A transfer longer than an hour fails: the access token expires and rclone cannot renew it, because the refresh token deliberately stays on the server.
- Service mode has no
dr statusordr diff— nothing yet compares local files against the namespace. - No
dr policycommand; the endpoint is the only interface. - Two devices pushing the same path race, and the last write wins silently.
- No account deletion or data export endpoint, which a real service needs.
- Migrating an existing
.drworkspace into the service namespace is manual. - Workspace mode has no unstage command; the index drains as files are pushed.
Licence
MIT.
