Filedepot is a command-line tool that lets you efficiently synchronize different files between people using a remote server over SSH. Each file is identified by a handle — a stable name you choose. The system automatically keeps versions of every upload. Use filedepot push HANDLE FILE to upload; use filedepot pull HANDLE to download the latest version by default.
gem install filedepotOr add to your Gemfile:
gem "filedepot"Config file: ~/.filedepot/config.yml
Run filedepot setup to create the config. On first run of any command, if the config file is not found, you will see "~/.filedepot/config.yml not found, let's config it" and setup is invoked automatically.
Config structure (keys in order):
default_store: test
stores:
- name: test
type: ssh
host: 127.0.0.1
username: user
base_path: /Users/user/filedepotOptional public_base_url for public URLs (shown in info and after push):
default_store: test
stores:
- name: test
type: ssh
host: 127.0.0.1
username: user
base_path: /data/filedepot
public_base_url: https://example.com/filesWhen default_store does not match any store name, the first store is used.
You can specify a store other than default by passing --store [name] for every command except setup and config.
On the server, use these commands to set up the folder for filedepot:
# set group, eg. filedepot
groupadd filedepot
usermod -aG filedepot user # for evey user you want allow filedepot
# set folder, eg. /data/filedepot
mkdir -p /data/filedepot
chown -R :filedepot /data/filedepot/
chmod 2775 /data/filedepot
setfacl -d -m g:filedepot:rwx /data/filedepot| Command | Description |
|---|---|
filedepot |
Show current store and available commands |
filedepot setup |
Create or reconfigure config (interactive, prompts for name, type, host, username, base path, public base URL) |
filedepot config |
Open config file with $EDITOR; asks to run a test after closing |
filedepot push HANDLE FILE |
Send file to current storage |
filedepot pull HANDLE [--path PATH] [--version N] |
Get file from storage |
filedepot handles |
List all handles in storage |
filedepot versions HANDLE |
List all versions of a handle |
filedepot info HANDLE |
Show info for a handle |
filedepot delete HANDLE [--version N] [--yes] |
Delete file(s) after confirmation; use --version N for a specific version, --yes to skip confirmation |
filedepot test |
Run end-to-end test (push, pull, delete a temporary file) |
Prompts for store name, type, host, username, base path, and optional public base URL. Then writes the config file .
Opens the config file in your default editor.
filedepot push test test.txtSends test.txt to storage with handle test. Each push creates a new version. When public_base_url is configured, the URL is shown after upload.
filedepot pull test
filedepot pull test --path ./output/file.txt
filedepot pull test --version 2
filedepot pull test --version 2 --path ./output/file.txtGets the latest version by default, or a specific version with --version. Use --path to specify the local destination. Prompts before creating directories or overwriting files.
Lists versions in descending order with creation datetime. Shows at most 10, with a summary if more exist.
Shows handle, remote base path, current version, updated-at datetime, and latest version URL (when public_base_url is set).
Deletes all versions of a handle, or a specific version with --version N. Use --yes or -y to skip confirmation (for scripts).
Runs an end-to-end test: creates a temporary file, pushes it, deletes locally, pulls it back, deletes the handle.
bundle install
bundle exec rake test- Keeps versions of every uploaded file and lets you download or delete specific versions when needed
- Supports multiple remote stores (configure several and switch with
--store) - Other store types can be implemented beyond SSH: the base logic lives in the Store base class; each store type implements the required methods — similar to how FUSE (Filesystem in Userspace) works with filesystems
- Once configured, commands are quick:
filedepot push HANDLE FILEandfiledepot pull HANDLE - Files stay organized in folders by handle and version
- Useful commands include
filedepot versions HANDLEfor reports on versions, dates, and sizes, andfiledepot purge HANDLEto remove old versions
MIT