Install megacmd-bin from AUR.
Use the mega-cmd functions to login, sync stuff. Every time you'll run it, the mega-cmd-server will be started, but also stopped when exiting the mega-cmd console, not synching in background. In order to do that, make the mega-cmd-server command as a systemd service:
# Create the service file (see mega.service) and update "User=<your own user>"
sudo nano /etc/systemd/system/mega.service
sudo chmod 644 /etc/systemd/system/mega.service
sudo systemctl daemon-reload
sudo systemctl enable mega