LogoPear Docs

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 drives

drives 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 touch

drives 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_Store is 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 --live mirror has no effect until you restart the command.
  • drives mirror makes 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 seed is 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 touch

Mirror 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-copy

Keep 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-copy

Pull a fixed snapshot by version

Mirror a specific version instead of the latest head:

drives mirror --version 3 <drive-key> ./snapshot

Use .drivesignore to skip generated files

Create ./site/.drivesignore in the source directory:

node_modules/
dist/
*.log

Then mirror as usual:

drives mirror ./site <drive-key>

See also

On this page