CLI Installation

The aeroftp command-line interface is a standalone Rust binary built from the same codebase as the AeroFTP desktop application. It provides full scriptable access to all 22 supported protocols — FTP, FTPS, SFTP, WebDAV, S3, Google Drive, Dropbox, OneDrive, MEGA, Box, pCloud, Azure Blob, 4shared, Filen, Zoho WorkDrive, Internxt, kDrive, Koofr, Jottacloud, FileLu, Yandex Disk, and OpenDrive — without requiring a graphical environment.

Included with Every Desktop Package

The CLI binary ships inside every AeroFTP desktop package. No separate installation step is required. After installing the desktop app, the binary is available at the following paths:

Package FormatBinary PathIn PATH
Linux .deb/usr/bin/aeroftp-cliYes
Linux .rpm/usr/bin/aeroftp-cliYes
Linux .snap/snap/aeroftp/current/usr/bin/aeroftp-cliYes (via snap alias)
Linux .AppImageBundled inside the AppImageNo
Windows .msiC:\Program Files\AeroFTP\aeroftp-cli.exeDepends on installer options
Windows .exe (NSIS)C:\Program Files\AeroFTP\aeroftp-cli.exeDepends on installer options
macOS .dmg/Applications/AeroFTP.app/Contents/MacOS/aeroftp-cliNo

The binary name is aeroftp-cli. On .deb and .rpm installs, a symlink aeroftp pointing to aeroftp-cli is created in /usr/bin/, so both names work interchangeably:

# Both are equivalent on .deb/.rpm installs
aeroftp --version
aeroftp-cli --version

For package formats where the binary is not in PATH (AppImage, macOS .dmg), create a symlink manually:

# macOS
sudo ln -s /Applications/AeroFTP.app/Contents/MacOS/aeroftp-cli /usr/local/bin/aeroftp

# AppImage — extract first, then symlink
./AeroFTP-x86_64.AppImage --appimage-extract
sudo ln -s "$(pwd)/squashfs-root/usr/bin/aeroftp-cli" /usr/local/bin/aeroftp

Verify Installation

After installing, confirm the CLI is working:

aeroftp --version
# Output: aeroftp-cli 3.0.1

aeroftp --help
# Output: full command listing with descriptions

The --help flag works on every subcommand:

aeroftp ls --help
aeroftp sync --help
aeroftp batch --help

Build from Source

Prerequisites

  • Rust toolchain 1.75 or later (install via rustup.rs)
  • System libraries (Linux only):
    • libssl-dev (or openssl-devel on Fedora/RHEL)
    • pkg-config

Build Commands

git clone https://github.com/axpnet/aeroftp.git
cd aeroftp/src-tauri
cargo build --release --bin aeroftp-cli

The compiled binary will be at target/release/aeroftp-cli (or target\release\aeroftp-cli.exe on Windows). Copy it to a directory in your PATH:

sudo cp target/release/aeroftp-cli /usr/local/bin/aeroftp

Build Only the CLI (Skip Desktop App)

The CLI is defined as a separate [[bin]] target in Cargo.toml. The cargo build --bin aeroftp-cli command compiles only the CLI binary and its dependencies, without pulling in Tauri or any GUI-related crates.

Color, TTY, and Pipe Behavior

The CLI automatically adapts its output based on the terminal environment:

ConditionColorsProgress BarsSummary Lines
Interactive TTYEnabledEnabledstdout
Piped to file/programDisabledHiddenstderr
NO_COLOR=1 env varDisabledHiddenstderr
CLICOLOR=0 env varDisabledHiddenstderr
--no-color flagDisabledHiddenstderr

NO_COLOR Standard

AeroFTP follows the no-color.org convention. Setting the NO_COLOR environment variable (to any value) disables all ANSI color codes and progress bar rendering:

# Disable colors globally
export NO_COLOR=1
aeroftp ls sftp://user@host/

# Or per-command
NO_COLOR=1 aeroftp ls sftp://user@host/

The CLICOLOR variable is also respected. When CLICOLOR=0, colors are suppressed.

Progress Bar Behavior

File transfer progress bars (powered by the indicatif crate) are shown only when:

  1. stdout is connected to a TTY
  2. Colors are not disabled

In CI/CD environments or when piping output, use --json for machine-readable progress instead.

SIGPIPE Handling

On Unix systems, the CLI installs a SIGPIPE handler at startup via libc::signal(SIGPIPE, SIG_DFL). This ensures proper pipe compliance — if you pipe output to a program that closes early (e.g., head), the CLI terminates cleanly instead of printing a broken pipe error:

# Works correctly — CLI exits when head has enough lines
aeroftp ls sftp://user@host/ --json | head -5

This follows POSIX convention and matches the behavior of standard Unix tools like ls, cat, and find.

Exit Codes

The CLI uses semantic exit codes for scripting:

CodeMeaning
0Success
1Connection error
2File/directory not found
3Permission denied
4Transfer error
5Configuration error
6Authentication failure
7Operation not supported
8Timeout
99Unknown error
130Interrupted (Ctrl+C)
aeroftp connect sftp://user@host
echo $?  # 0 if successful, 1 if unreachable, 6 if auth failed

Double Ctrl+C

The first Ctrl+C sends a graceful cancellation signal, allowing in-progress transfers to clean up. A second Ctrl+C within 2 seconds forces immediate exit with code 130. This prevents the CLI from hanging if a server is unresponsive during shutdown.