Autonomous github sync

From abcnuts/manus-skills · View interactive version

Autonomous github sync is an AI agent skill from the GitHub repository abcnuts/manus-skills. Autonomous GitHub commit and push operations using Google Drive as an intermediary. Use when you need to commit and push code changes to the user's GitHub repository without manual intervention. Works by syncing files through Google Drive to the user's local machine, then committing and pushing auto

How to use this skill

Skill file

Autonomous GitHub Sync

Enable Manus to commit and push changes to GitHub repositories without requiring manual user intervention.

When to Use This Skill

Use this skill when:

How It Works

The sync workflow uses Google Drive as a bridge between the Manus sandbox and the user's local machine:

  1. Manus uploads changed files to Google Drive
  2. User's local machine (via script) downloads files from Google Drive
  3. Script copies files to the local repository
  4. Script commits and pushes to GitHub automatically

Prerequisites

Usage Pattern

Step 1: Upload Files to Google Drive

After making changes to repository files in the sandbox, upload them to a Google Drive folder:

# Create a deployment package with changed files
mkdir -p /tmp/repo-sync
cp /path/to/changed/file1.js /tmp/repo-sync/
cp /path/to/changed/file2.html /tmp/repo-sync/

# Upload to Google Drive
rclone copy /tmp/repo-sync manus_google_drive:repo-sync-$(date +%s) --config /home/ubuntu/.gdrive-rclone.ini

# Get the folder ID for the user
rclone lsd manus_google_drive: --config /home/ubuntu/.gdrive-rclone.ini | grep repo-sync

Step 2: Notify User to Run Sync Script

Tell the user to run the sync script on their local machine:

python3 ~/gdrive_to_repo_sync.py <gdrive_folder_name> <local_repo_path> "<commit_message>"

Example:

python3 ~/gdrive_to_repo_sync.py repo-sync-1707543210 /Users/username/my-repo "feat: add demographic data collection"

Step 3: Verify Push

Check GitHub or ask the user to confirm the push was successful.

Alternative: Direct Patch Method

If Google Drive sync isn't set up, fall back to the patch method:

# Create patch file
cd /path/to/sandbox/repo
git format-patch origin/main --stdout > /tmp/changes.patch

# Upload patch to Google Drive
rclone copy /tmp/changes.patch manus_google_drive: --config /home/ubuntu/.gdrive-rclone.ini
rclone link manus_google_drive:changes.patch --config /home/ubuntu/.gdrive-rclone.ini

Then instruct the user:

# Download patch from Google Drive link
cd /path/to/local/repo
git am < ~/Downloads/changes.patch
git push origin main

Setup Instructions for User

To enable autonomous sync, the user needs to:

  1. Copy the sync script to their home directory:

```bash

cp /home/ubuntu/skills/autonomous-github-sync/scripts/gdrive_to_repo_sync.py ~/

```

  1. Install rclone on their local machine (if not already installed):

```bash

# macOS

brew install rclone

# Linux

sudo apt install rclone

```

  1. Configure rclone with the same Google Drive account:

```bash

rclone config

# Follow prompts to add Google Drive remote named "manus_google_drive"

```

  1. Test the sync:

```bash

python3 ~/gdrive_to_repo_sync.py test-folder /path/to/repo "test commit"

```

Troubleshooting

"Repository not found" when pushing:

"rclone not found":

Files not syncing:

Best Practices

  1. Use descriptive commit messages - Include what changed and why
  2. Group related changes - Don't sync every single file change individually
  3. Verify before pushing - Check that files copied correctly
  4. Clean up Google Drive - Remove old sync folders after successful push
  5. Test with small changes first - Verify the workflow before large updates

Limitations

Future Improvements

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.