# Use default public client (release builds) or set a custom client:
export GDRV_CLIENT_ID="your-client-id"
export GDRV_CLIENT_SECRET="your-client-secret" # only if required by your client type
gdrv auth loginUse manual fallback or device code flow:
gdrv auth login --no-browser
gdrv auth deviceRe-authenticate:
gdrv auth logout
gdrv auth logingdrv auth status
gdrv auth login --preset workspace-fullIf your OAuth consent screen is in testing mode, refresh tokens expire after 7 days. Re-authenticate or move to production mode.
Check your OAuth scopes and Shared Drive access:
gdrv auth statusYou may need to re-authenticate with a broader scope preset:
gdrv auth login --preset workspace-fullUse file IDs for Shared Drives:
gdrv files list --drive-id <drive-id>The CLI automatically handles rate limits with exponential backoff. If you continue to see rate limit errors:
- Reduce the frequency of API calls
- Use pagination with smaller page sizes
- Check Google's API quotas for your project
- Check your network connection
- Use resumable uploads for large files
- Consider using
--quietto reduce output overhead
Use --paginate with --limit for controlled pagination:
# Get 50 items at a time
gdrv files list --limit 50 --json
# Then use nextPageToken from responseAdmin SDK operations require service account authentication with domain-wide delegation. See API-GUIDE.md for setup instructions.
Ensure the service account has been authorized for the required scopes in the Google Workspace Admin Console.
If you encounter issues not covered here:
- Check the API-GUIDE.md for command-specific documentation
- Review the Authentication Guide for auth-related issues
- Run with
--helpto see all available flags for a command - Check exit codes for programmatic error handling