:rocket: fileup - Effortless File Sharing for Command-Line Enthusiasts :rocket:
fileup
is your go-to Python package for hassle-free uploading and sharing of files right from your command-line interface! 🖥️
You can set a time limit after which the file will be automatically removed, ensuring the security of your data. 🕒
:books: Table of Contents
✨ Features
- 📤 Upload via FTP or SCP (using SSH config)
- ⏰ Automatic file expiration and cleanup
- 🔗 Smart URLs: Jupyter notebooks → nbviewer, image markdown, direct links
- 📋 Automatic clipboard copy (macOS)
- ⚡ Simple config using
~/.config/fileup/config.ini
- 🔐 Supports SSH keys and password authentication
:package: Installation
To install fileup
, simply run the following command:
pip install -U fileup
:memo: Configuration
Before you can start sharing your files, you'll need to create a configuration file at ~/.config/fileup/config.ini
with the following structure:
[default]
protocol = ftp
hostname = example.com
base_folder = /path/to/files
file_up_folder =
url = files.example.com
[ftp]
username = my_user_name
password = my_difficult_password
[scp]
username =
private_key =
password =
FTP Configuration
For FTP uploads, you need to provide both username
and password
in the [ftp]
section.
SCP Configuration
For SCP uploads, you have two options:
- Use your SSH config by setting
protocol = scp
and using a hostname from your ~/.ssh/config
- Explicitly configure SCP by providing
username
and optionally private_key
in the [scp]
section
:video_game: Usage
For a list of available commands, type fu -h
.
In a nutshell, you can use fileup
by running:
fu filename
The command supports several options:
-t DAYS
, --time DAYS
: Set an expiration time in days (default: 90, use 0 for no expiration)-d
, --direct
: Return a direct URL without any prefixes-i
, --img
: Return the URL formatted for markdown image embedding
This is the output of fu -h
:
usage: fu [-h] [-t TIME] [-d] [-i] filename
Publish a file.
Create a config file at ~/.config/fileup/config.ini with the following structure:
[default]
protocol = ftp
hostname = example.com
base_folder = /path/to/files
file_up_folder =
url = files.example.com
[ftp]
username = my_user_name
password = my_difficult_password
[scp]
username =
private_key =
password =
positional arguments:
filename
options:
-h, --help show this help message and exit
-t TIME, --time TIME If time is 0 the file will never be deleted, default is 90 days.
-d, --direct
-i, --img
Special Features
- Jupyter Notebooks: If you're uploading a Jupyter notebook (
.ipynb
), the returned URL will be accessible via nbviewer.jupyter.org - Automatic Deletion: Files with expiration times are automatically removed when their time is up
- URL Copying: On macOS, the URL is automatically copied to your clipboard
:green_apple: macOS Integration
fileup
currently supports the pbcopy
command, so the URL will be automatically copied to your clipboard on macOS systems. 📋✨
:warning: Limitations
- The automatic clipboard copying feature is only available for macOS users
- FTP passwords are stored in plain text; use with caution
- SCP implementation requires the
ssh
and scp
commands to be available
Give fileup
a try today and experience the convenience of effortless file sharing right from your command-line! 🎉