Open-source command line tools and C library (libmega) for accessing cloud storage.
C Shell Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


megatools - command line client application for Mega

Megatools is a collection of programs for accessing Mega service from
a command line of your desktop or server.

Megatools allow you to copy individual files as well as entire directory
trees to and from the cloud. You can also perform streaming downloads for
example to preview videos and audio files, without needing to download
the entire file.

Megatools are robust and optimized for fast operation - as fast as Mega
servers allow. Memory requirements and CPU utilization are kept at minimum.

You can register account using a 'megareg' tool, with the benefit of having
true control of your encryption keys.

Mega website can be found at

Megatools can be downloaded at


  megareg      Register and verify a new mega account
  megadf       Show your cloud storage space usage/quota
  megals       List all remote files
  megamkdir    Create remote directory
  megarm       Remove remote file or directory
  megaput      Upload individual files
  megaget      Download individual files
  megadl       Download file from a "public" Mega link
               (doesn't require login)
  megacopy     Upload or download a directory tree

All of these tools do:

- Local caching of remote session/filesystem information
  for faster execution. Cache is encrypted with your password
- Support loading login credentials from a configuration file


See man pages for how to use individual tools and how to configure them:

  man megatools

Man pages are also available online at:

Installation on Windows

Megatools is available on Windows via Chocolatey thanks to ERap320. See:

You can contact the package maintainer here:

Windows Quirks

On Windows, if you see weird characters in your megals output, you'll need
to set correct CHARSET environment variable. For example on Czech Windows
this would mean executing this command in cmd before using the tools:

  set CHARSET=CP852

This is just a cosmetic issue. Internally, megatools always work with UTF-8
file names, and even if the tool's terminal output is corrupted, files names
of downloaded/uploaded files will be correct.

Installation on Mac OS X (Mountain Lion)

Thanks to Carl Moden, megatools is available in Homebrew (

You can therefore install megatools with:

  brew install megatools

Installation on your favorite GNU/Linux distribution

Megatools may already be pre-packaged in the package repository
of your distribution. It is already available at least in:

- Debian -
- Ubuntu -
- Fedora -
- Arch Linux (AUR) -
- Gentoo -

Be sure to check your distribution's package repository first.

Installation on FreeBSD

Megatools is available in ports thanks to Maxim V. Kostikov:

Building megatools from source code

The official source code tarball is available at:

You will need to install some dependnencies before you can build megatools from
source code. Package names of these dependencies differ depending on your GNU/Linux

You should also check that the code was released by me, by verifying PGP signatures
provided alongside the code.

As these tarballs are released infrequently, you can also build code from the master
branch of megatools git repository. You can get the code using git:

  git clone git://

NOTE: Please don't report build issues against code that you downloaded from github.
These reports will be closed without explanation, with reference to this README
file. It is not expected to work on all distributions. Use the official tarball.

The necessary dependencies are: glib2, libcurl, openssl

For building from git repository, you'll also need: asciidoc (or use --disable-docs)

If you don't have those already, some basic development packages are also necessary.
Namely: gcc, make, pkg-config (pkgconf), and when building from git: autoconf,

On Debian, Ubuntu:

  apt-get -y install build-essential libglib2.0-dev libssl-dev \

On Fedora and CentOS:

  yum -y install gcc make glib2-devel libcurl-devel openssl-devel

  If you're building megatools on CentOS or other simialrly old system, you may
  need to pass -std=gnu99 to the C comipler.

On OpenSUSE:

  zypper -n install gcc make glib2-devel libcurl-devel openssl-devel

On Arch Linux:

  pacman -Sy --noconfirm --needed pkgconf gcc make glib2 curl

On Alpine Linux:

  apk add --update build-base libcurl curl-dev asciidoc openssl-dev glib-dev \
    glib libtool automake autoconf

You can build megatools into your HOME directory, so that they'll not pollute
your /usr or /usr/local by using --prefix=$HOME/.local option to configure.

If you're building from git repository, use ./ instead of ./configure
and vice versa.

Example build steps:

  git clone git://
  cd megatools
  ./ --prefix=$HOME/.local --disable-docs
  make -j4
  make install

Now you can run megatools from ~/.local/bin.

  export PATH="$HOME/.local/bin:$PATH"

If you encounter issues, read the error messages carefully. They may contain
hints on how you can solve the issue yourself.

Third party tools/scripts

Megatools are meant as a low-level tools that can be used as a base to create
more complicated tools for working with Other people have created
a third party scripts on top of megatools. If you're one of them and want to
have your project listed here, let me know.

Some third party tools can be found at:


Megatools were written by Ondřej Jirman <>, 2014-2018

My PGP key can be found at:
  (Fingerprint is: 9AB138B20691621CD4CF92026E6426C677CFEFF1)

Official website is:

If you'd like to donate, please use contact information provided on the
offiial website.


- Chris Tarazi <>
- Tom Maneiro <>
- bAndie91 <>
- Alberto Garcia <>
- David Guillen Fandos <>
- Erik Nordstrøm <>
- Johnathan Jenkins <>
- Kagami Hiiragi <>
- Matthew Schultz <>
- Michael Ledin <>
- Michael Ripley <>
- Palmer Dabbelt <>
- RealDolos <>
- Viktor (Icon) VAD <>
- cyrozap <>
- nyuszika7h <>
- protomouse <>
- strupo <>
- wdlkmpx <>
- dal1a <>

Support and bug reports

If you think you've found bug in megatools, send a report including enough
information for recreating the issue to:

IMPORTANT: I use personal e-mail server for my e-mail communication. I respond
to most e-mails, so if you are not getting a response within a few days, and
you're a user of a more aggressive e-mail provider (Outlook, iCloud, ...) it may
be because your provider rejected my e-mail as SPAM and did not deliver it at
all (not even to your SPAM folder), despite it being response to your e-mail and
my server using industry's best practices. You can either contact your e-mail
provider so that they fix their issue with rejecting legitimate responses to
your mail, or use different e-mail provider or contact channel to contact me.
(github issues) 


Megatools are licensed under GPLv2 with OpenSSL exemption, see LICENSE
file for details.

This product includes software developed by the OpenSSL Project for use
in the OpenSSL Toolkit. (