Autonomous sync script

From abcnuts/manus-skills · View interactive version

Autonomous sync script is an AI agent skill from the GitHub repository abcnuts/manus-skills. Automate GitHub sync via Google Drive with a single command. Use when you need to commit and push code/skills to GitHub without manual file transfer. Uploads to Google Drive, then provides a one-line command for automatic commit and push.

How to use this skill

Skill file

Autonomous Sync Script

Overview

This skill automates the process of syncing files from Manus to your GitHub repository via Google Drive. Instead of manually downloading files and committing them, this skill uploads everything to Google Drive and provides a single command to run on your local machine that automatically downloads, commits, and pushes to GitHub.

Key Benefit: Turn a 6-step manual process into a single command.

When to Use This Skill

Use this skill when:

Quick Start

Step 1: Specify What to Sync (In Manus)

Tell Manus what files/directories to sync:

Sync /home/ubuntu/skills/my-new-skill to GitHub

Step 2: Run the Command (On Your Local Machine)

Manus will provide a command like:

python3 ~/gdrive_to_repo_sync.py github-sync-1770720864 ~/my-repo "feat: add my-new-skill"

Copy and run it. Done! ✅


How It Works

The Process:

  1. Manus uploads your files to Google Drive (timestamped folder)
  2. Manus gives you a one-line command with the folder name
  3. You run the command on your local machine
  4. Script downloads files from Google Drive
  5. Script copies files to your local Git repository
  6. Script commits and pushes to GitHub automatically

Why Google Drive?


One-Time Setup

On Your Local Machine

1. Install rclone (if not already installed):

# macOS
brew install rclone

# Linux
sudo apt install rclone

2. Configure rclone with Google Drive:

rclone config

Follow prompts:

3. Get the sync script:

The script is included in this skill at scripts/gdrive_to_repo_sync.py.

Copy it to your home directory:

cp /path/to/this/skill/scripts/gdrive_to_repo_sync.py ~/
chmod +x ~/gdrive_to_repo_sync.py

4. Test the setup:

rclone lsd manus_google_drive:

You should see your Google Drive folders listed.


Usage Examples

Example 1: Sync a Single Skill

In Manus:

Sync /home/ubuntu/skills/organize-github-repos to GitHub

Manus provides:

✅ Uploaded to Google Drive: github-sync-1770720864

📋 Run this command on your local machine:
python3 ~/gdrive_to_repo_sync.py github-sync-1770720864 ~/my-repo "feat: add organize-github-repos skill"

You run:

python3 ~/gdrive_to_repo_sync.py github-sync-1770720864 ~/my-repo "feat: add organize-github-repos skill"

Result:

✅ Downloaded from Google Drive
✅ Copied to repository
✅ Committed changes
✅ Pushed to GitHub

Example 2: Sync Multiple Files

In Manus:

Sync these to GitHub:
- /home/ubuntu/skills/skill-a
- /home/ubuntu/skills/skill-b  
- /home/ubuntu/docs/guide.md

Manus handles the rest and provides the sync command.


Example 3: Custom Commit Message

In Manus:

Sync /home/ubuntu/project with commit message "fix: resolve authentication bug"

Manus provides command with your custom message.


The Sync Script

Script Location

After setup: ~/gdrive_to_repo_sync.py

Script Usage

python3 ~/gdrive_to_repo_sync.py <gdrive-folder> <repo-path> "<commit-message>"

Arguments:

  1. <gdrive-folder> - Folder name from Manus (e.g., github-sync-1770720864)
  2. <repo-path> - Path to your local Git repository (e.g., ~/my-repo)
  3. <commit-message> - Git commit message in quotes

What the Script Does

  1. Downloads files from Google Drive folder
  2. Copies to your local repository (preserving structure)
  3. Stages changes (git add)
  4. Commits with your message
  5. Pushes to origin (current branch)
  6. Cleans up temporary files

Troubleshooting

"rclone not found"

Solution: Install rclone

brew install rclone  # macOS
sudo apt install rclone  # Linux

"Google Drive folder not found"

Check folder exists:

rclone lsd manus_google_drive: | grep github-sync

Common causes:

"Git push failed"

Solution: Set up GitHub authentication

gh auth login  # Using GitHub CLI
# OR configure SSH keys

"Permission denied"

Solution: Make script executable

chmod +x ~/gdrive_to_repo_sync.py

Best Practices

  1. Use descriptive commit messages - Follow Conventional Commits
  2. Review before running - Check what Manus uploaded to Google Drive
  3. Clean up old folders - Delete old github-sync-* folders from Google Drive periodically
  4. Test with small changes - Verify workflow before syncing large projects
  5. Keep script updated - Pull latest version if bugs are fixed

Advanced Usage

Sync to Specific Branch

cd ~/my-repo
git checkout feature-branch
python3 ~/gdrive_to_repo_sync.py <folder> . "commit message"

Sync to Subdirectory

The script preserves directory structure from Google Drive.

In Manus, organize files in the structure you want:

/tmp/sync-package/
└── skills/
    └── my-skill/
        └── ...

Result in repo: repo/skills/my-skill/...

Dry Run (Preview)

Modify script to add --dry-run flag:

if '--dry-run' in sys.argv:
    print("Would commit:", files)
    sys.exit(0)

Security

Google Drive:

Git:

Files:


Limitations

  1. Requires local execution - Can't be fully autonomous without local agent
  2. Google Drive dependency - Adds latency vs direct GitHub API
  3. Manual branch management - Doesn't auto-create branches
  4. No conflict resolution - Requires manual intervention for conflicts
  5. Single remote - Pushes to origin only

Future Enhancements


Related Skills


Support

Check Google Drive connection:

rclone about manus_google_drive:

List sync folders:

rclone lsd manus_google_drive: | grep github-sync

Verify Git repo:

cd ~/my-repo && git status

Changelog

v1.0.0 (2026-02-10)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.