An interactive command-line tool to navigate a Google Drive account and batch export Google Docs to local Markdown files.
- Interactive REPL: A shell-like interface to interact with your Google Drive.
- Navigation: Use
ls,cd, andpwdto navigate your folder structure. - Tab Completion: Auto-complete commands and file/folder names with the
Tabkey. - Secure Authentication: Authorizes with your Google account using a secure, console-based OAuth 2.0 flow.
- Markdown Conversion: Downloads Google Docs and converts them to Markdown, adding a YAML front matter block with:
titlegdrive_idcreated_timemodified_time
- Batch Downloading:
- Download a single file:
download "My Document" - Download an entire folder and its contents recursively:
download "My Folder" - Download all items in the current directory:
download .
- Download a single file:
- Focused: The tool is hyper-focused on Google Docs and folders, filtering out all other file types (Sheets, Slides, etc.).
-
Prerequisites:
-
Google OAuth Setup:
- Follow the official Google guide to create a project and enable the Google Drive API.
- When creating credentials, choose "Desktop app" as the application type.
- After creating the OAuth 2.0 Client ID, click "DOWNLOAD JSON".
- Rename the downloaded file to
client_secrets.json.
-
Configure the Application:
- Clone this repository.
- Place the
client_secrets.jsonfile inside thesrc/gdbme/directory. - The project is configured to automatically copy this file to the build output directory.
-
Run the application from the root of the repository:
dotnet run --project src/gdbme
-
First-time Authentication:
- On the first run, the application will display a URL.
- Copy and paste this URL into your web browser.
- Log in to your Google account and grant the application permission.
- You will be given an authorization code. Copy it.
- Paste the code back into the terminal and press Enter.
- Your credentials will be stored locally and securely for future sessions.
-
Available Commands:
| Command | Description |
|---|---|
ls |
List files and folders in the current directory. |
cd <folder> |
Change directory. Use .. to go up, / for root. |
pwd |
Print the current working directory path. |
download <item> |
Download a file or folder. Use . to download everything in the current directory. |
download <item> -f |
Force download, overwriting existing files. |
clear |
Clear the console screen. |
exit |
Exit the application. |