Drives
Reference for the Drives CLI: create drives, mirror directories, and seed Hyperdrives.
Drives is a CLI for creating and synchronizing Hyperdrives. This page documents the public commands installed by drives.
System support
Desktop only: macOS, Linux, and Windows are supported. Drives is not available on Android or iOS.
Install
npm i -g drivesdrives touch
Create a writable Hyperdrive and print its public key.
drives touch [options]Flags:
--storage [path]: storage directory for the local corestore. Default: the upstream docs describe~/.drives; current CLI code stores the corestore beneath that directory--help: show help.
Example:
drives touchdrives mirror <src> <dst>
Mirror a local directory into a Hyperdrive, mirror a Hyperdrive into a local directory, or mirror between two local targets.
drives mirror <src> <dst> [options]Arguments:
<src>: source drive key or local folder path.<dst>: destination drive key or local folder path.
Flags:
--live: keep mirroring as changes arrive. Default: off--version [v]: mirror a specific drive version instead of the latest version. Default: latest version--storage [path]: storage directory for the local corestore. Default: the upstream docs describe~/.drives; current CLI code stores the corestore beneath that directory--help: show help.
Notes:
.DS_Storeis ignored automatically.- If the source root contains
/.drivesignore, the ignore patterns are applied during the mirror. The ignore file is read once at startup, so changing it during a--livemirror has no effect until you restart the command. drives mirrormakes the destination match the source in either direction, so entries on the destination that do not exist on the source can be deleted — whether the destination is a Hyperdrive or a local folder.
Example:
drives mirror ./site <drive-key>drives seed [key]
Announce a Hyperdrive so other peers can download it.
drives seed [key] [options]Arguments:
[key]: drive public key to seed. Default: if omitted, the CLI uses the drive already present in the selected storage namespace
Flags:
--storage [path]: storage directory for the local corestore. Default: the upstream docs describe~/.drives; current CLI code stores the corestore beneath that directory--help: show help.
Notes:
drives seedis a long-running command.- The status output includes the drive key, replication status, and connected peers.
Example:
drives seed <drive-key>Common workflows
Create a drive, mirror a directory into it, and seed it
Create a new drive and keep the printed key:
drives touchMirror a local directory into that drive:
drives mirror ./site <drive-key>Seed it so another peer can download it:
drives seed <drive-key>Mirror a drive back into a local directory
On another machine, pull the drive into a folder:
drives mirror <drive-key> ./site-copyKeep a destination up to date with live mirroring
Push local changes continuously:
drives mirror --live ./site <drive-key>Or follow a live drive into a local folder:
drives mirror --live <drive-key> ./site-copyPull a fixed snapshot by version
Mirror a specific version instead of the latest head:
drives mirror --version 3 <drive-key> ./snapshotUse .drivesignore to skip generated files
Create ./site/.drivesignore in the source directory:
node_modules/
dist/
*.logThen mirror as usual:
drives mirror ./site <drive-key>See also
- Hyperdrive
- Localdrive
- Mirrordrive — the sync engine powering
drives mirror. - Hypershell —
hypershell-copy - Hyperbeam — one-to-one pipe for ad-hoc transfers
- Pear CLI