aim
A command line download/upload tool with resume.
Why?
Simplicity: download or upload files depending on parameter order with default settings.
Installation
Download a release for Linux or MacOS from releases. See the Docker section on how to run it platform-independently.
Features
Download / Upload
- default action implied from parameter order.
aim https://domain.com/
-> Display contents.aim https://domain.com/source.file .
-> Download.aim source.file https://domain.com/destination.file
-> Upload.
- support for
http(s)
,ftp
,ssh
.
Optional check of sha256
To validate that a download matches a desired checksum, just list it at the end when invoking aim
.
aim https://github.com/XAMPPRocky/tokei/releases/download/v12.0.4/tokei-x86_64-unknown-linux-gnu.tar.gz . 0e0f0d7139c8c7e3ff20cb243e94bc5993517d88e8be8d59129730607d5c631b
Resume
Resume support for both download and upload for http(s)
, ftp
.
Download and upload support for ssh
, resume (using sftp
) under development.
If you're hosting a http(s) server yourself, upload needs PUT
ranges (or a patched version of nginx
).
Sharing a folder
aim
can serve a folder over http
on one device so that you can download it on another. By default, the serving port is 8080
or the next free port.
Machine A
Machine B
Moreover, since hosting is done over http, the client can even be a browser:
Indicators
By default, a progressbar is displayed when up/downloading. The indicators can be configured via the internally used indicatif
package.
You can change the display template and progress chars by either setting correct environment variables or creating a .env
file in the folder you are calling from:
AIM_PROGRESSBAR_DOWNLOADED_MESSAGE="🎯 Downloaded {input} to {output}"
AIM_PROGRESSBAR_MESSAGE_FORMAT="🎯 Transfering {url}"
AIM_PROGRESSBAR_PROGRESS_CHARS="=>-"
AIM_PROGRESSBAR_TEMPLATE="{msg}\n{spinner:.cyan} {elapsed_precise} ▕{bar:.white}▏ {bytes}/{total_bytes} {bytes_per_sec} ETA {eta}."
AIM_PROGRESSBAR_UPLOADED_MESSAGE="🎯 Uploaded {input} to {output}"
By default, no progressbar is displayed if content length <1MB (easy display contents of remote).
Output
Because default output is stdout, aim
is pipe-able to other commands:
|
|
Authentication
Basicauth in url
Just use the syntax protocol://user:pass@server:port
. This can be used for all http(s)
, ftp
and ssh
.
Example for downloading:
Netrc
Create a file named .netrc
with read permissions in ~
or the current folder you're running aim
from to automate login to that endpoint:
SSH keys
Keys that match the following patterns are automatically tried:
- id_ed25519
- id_rsa
- keys/id_ed25519
- keys/id_rsa
- ~/.ssh/id_rsa
- ~/.ssh/keys/id_ed25519
Updating
aim
can self update in-place using:
Docker
For convenience, alpine-based docker images for aarch64
and x64
are available, so arguments can be passed directly to them.
Hosting on machine A
Downloading on machine B
Adapt IP to match that of machine A
.