βοΈ Google Drive
Migrate Google Drive Files to Lighthouseβ
Use Case: Transfer files from your Google Drive into Lighthouseβs permanent, encrypted, and agent-accessible storage. Ideal for AI agents, public file access, and decentralized data workflows.
Step 0: Clone & Set Up the Migration CLI Toolβ
First, clone the Lighthouse Migration CLI tool and install dependencies:
# Clone the repository
git clone https://github.com/lighthouse-web3/lighthouse-migration-tooling.git
cd light-house-migration-tooling
# Install dependencies
npm install
# Build the project
npm run build
# Link the CLI globally
npm link
π Step 1: Setup Environment & Authenticationβ
1.1 Get Credentialsβ
- Lighthouse API Key: files.lighthouse.storage
- Google OAuth Client ID & Secret: via Google Cloud Console
1.2 Create a .env Fileβ
cp .env.example .env
# Then edit .env to include:
LIGHTHOUSE_API_KEY=your_lighthouse_api_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
1.3 Authenticate with Google Driveβ
lh auth init
- Opens browser for Google login
- Grants Drive access to the CLI
- Stores tokens securely in your OS keyring
- Supports automatic refresh for future sessions\
Check status
lh auth status
β Expected:
β Authenticated | your-email@gmail.com | Valid token\
Step 2: Browse & Analyze Google Driveβ
List folders:
lh list folders --search "Photos"
List files:
lh list files --extension pdf
lh list files --folder 1abc123xyz
Analyze a dry-run migration (no upload yet):
lh migrate drive --folders 1abc123xyz --analyze
Step 3: Migrate Files to Lighthouseβ
Migrate an entire folder:
lh migrate drive --folders 1abc123xyz
Migrate specific file types:
lh migrate drive --folders 1abc123xyz --include pdf,jpg
Filter by file size, type, or ID:
lh migrate drive \
--folders 1abc123xyz \
--include pdf \
--exclude tmp,log \
--max 100
Migrate individual files:
lh migrate drive --files 1xyz789,1uvw456