Você pode usar o aplicativo CLI da Mega, megacmd . Veja o link
Do leiame:
MEGAcmd provides non UI access to MEGA services. It intends to offer all the functionality with your MEGA account via commands.
Available packages for MEGAcmd in all supported platforms should be found here.
It supports 2 modes of interaction:
interactive. A shell to query your actions scriptable. A way to execute commands from a shell/a script/another program. In order to provide those 2 modes, it features one server (MEGAcmdServer), an interactive shell (MEGAcmdShell) and several commands that will launch the non-interactive client (MEGAcmdClient). See Usage and Platform to understand how to use it in your particular system.