gpack is a command-line tool to backup your coding projects to Google Drive by zipping them up.
gpack init: Initialize a project, set storage location, and create.gpackignore.gpack login: Authenticate with your Google Account.gpack logout: Disconnect your account and remove credentials.gpack push(or justgpack): Backup the current project (zip & upload).gpack list: List backups and show storage usage for the current project.gpack trim: Reduce backup count (auto-keep last 5 or interactive).
Prerequisites: Node.js installed (v18+ recommended).
npm install -g git+https://github.com/mikeevans82/gpack.git- Clone or Download this repository.
- Install dependencies:
npm install # Build the project npm run build - Link globally (optional, to run
gpackfrom anywhere):Now you can runnpm link
gpackin any terminal.
To use gpack, you need your own Google Cloud Project credentials (client ID and secret) currently, or you can use provided ones if available.
- Go to Google Cloud Resource Manager.
- Create (or edit) a project.
- Enable Google Drive API in that project.
- Go to Credentials -> Create Credentials -> OAuth client ID.
- Application type: Desktop app.
- Copy the Client ID and Client Secret.
- Run
gpack loginand follow the prompts to enter these credentials.
To avoid your login expiring every 7 days:
- Go to APIs & Services -> OAuth consent screen in your Google Cloud Console.
- Click Publish App (or set status to Production).
- Confirm the push to production.
- You do not need to submit for verification.
- When you login, you will see a "Google hasn't verified this app" warning.
- Click Advanced -> Go to (Project Name) (unsafe). This is safe for your own private app.
- Navigate to your project folder.
- Run
gpack init.- Accept default
GPACK/ProjectNameor customize.
- Accept default
- Run
gpack login(first time only). - Run
gpackto backup.
Backups are named using the following pattern:
ProjectName_YYYY-MM-DDTHH-mm-ss-mssZ.zip
For example: gpack_2024-01-30T14-55-00-123Z.zip
- Project config is stored in
.gpack/config.json. - Ignore rules are in
.gpackignore(syntax similar to .gitignore). Default ignores:node_modules,.git,dist.