A simple CLI tool to upload files to Google Drive, Mega and Cloudinary. Upload files and folder directly from your terminal with ease.
- Upload files to Google Drive.
- Upload files to Cloudinary.
- Upload files to Mega.
- Support for directory uploads (including subdirectories).
- Simple and intuitive CLI interface.
- Install Go if you don't have it already. Download Go.
- Clone this repository:
git clone https://github.com/Mr-Aaryan/upload-easy.git cd upload-easy
- Build and install the tool:
Ensure the Go bin directory is in your PATH.
go install
To upload a file, use the following command:
go run main.go --file "./upload/file.png" -g
--file
(required): Path to the file or directory to be uploaded.-g
(optional): Upload to Google Drive.-c
(optional): Upload to Cloudinary.-m
(optional): Upload to Mega.
Example:
go run main.go --file "./upload/file.png" -g
To upload directories with their contents, use the following format:
go run main.go --file "./uploads"
This will upload the directory contents to the selected cloud service. All files in the directory and subdirectories will be processed.
Before using the tool, set up your environment variables:
- Obtain credentials for Google Drive API by following this guide.
- Save the credentials JSON file as
credentials.json
in the project directory as./googleutils/credentials.json
. - The
./googleutils/token.json
file will be automatically created after a successful authentication.
- Log in to your Cloudinary account and obtain your API key and secret.
- Set up the
.env
file with the following variables:CLOUDINARY_URL=cloudinary://<API_KEY>:<API_SECRET>@<CLOUD_NAME>
- Create a Mega account if you don't already have one.
- Add the following to your
.env
file:MEGA_EMAIL=<mega_email> MEGA_PASSWORD=<mega_password>
UPLOAD-EASY/
├── cloudinaryutils/
│ └── cloudinary.go
├── connection/
│ ├── cloudinary.go
│ ├── google.go
│ └── mega.go
├── googleutils/
│ ├── credentials.json
│ ├── google.go
│ └── token.json
├── megautils/
│ └── mega.go
├── utils/
│ └── utils.go
├── .env
├── .gitignore
├── go.mod
├── go.sum
├── LICENSE
├── main.go
└── readme.md
./uploads = path to my file/folder. yours might be different
go run main.go --file "./upload/file.png" -g
go run main.go --file "./uploads" -g
go run main.go --file "./upload/file.png" -c
go run main.go --file "./uploads" -c
go run main.go --file "./upload/file.png" -m
go run main.go --file "./uploads" -m
- Go 1.20+ installed.
- Environment variables configured in
.env
.
- Add support for more cloud storage services.
- Implement parallel uploads.
- Provide support for folder uploads.
This project is licensed under the MIT License. See the LICENSE file for details.