skip to content
$cat connect/gdrive.md

Connect Google Drive.

drive.file · every plan
Per-file access: MDflow uses Google's narrow drive.file permission, so MDflow only ever sees the files and folders you explicitly pick or that MDflow creates — never your whole Drive. That trade-off has real edges (most notably, files already sitting in a picked folder stay hidden until you open them — though you can open a whole folder's files at once). Read How it works below before you rely on it.

Edit the markdown that lives in your Google Drive — notes, docs, anything in a .md file — directly from the MDflow editor. Pick the folders and files you want, open one in the sidebar, and save your changes straight back to Drive. No download, no re-upload, no copy-and-paste.

Once a workspace is connected you can:

  • ›Pick Drive folders and files with Google's own file picker, then open the markdown ones in the MDflow editor.
  • ›Edit with live preview, then save back to Drive — the file in your Drive is updated in place.
  • ›Create markdown files, and rename or delete files of any type; deletes go to your Drive trash, never a hard delete.
  • ›Open every other file — Google Docs, Sheets, Slides, PDFs, images, video, text files — in Google's own page in a new tab.
  • ›Search your Drive files, and import any markdown file into a workspace folder as an ordinary MDflow document.

Google Drive integration is free on every plan — no Pro required. Files are read and written live through the Drive API and are not copied into MDflow unless you import one, so Google Drive stays the source of truth.

$why gdrive

Why edit Drive markdown in MDflow?

  • ›A real editor for your Drive notes. Google Drive has no markdown editor of its own — MDflow gives your .md files the Monaco editor with syntax highlighting, live preview, and Edit / Split / Preview views, with the preview following the editor as you scroll.
  • ›Drive stays the source of truth. Nothing is mirrored behind your back. Every save writes back to the same file in Drive, so your documents live where they always have — and a file only becomes an MDflow document if you import it yourself.
  • ›You choose what MDflow can see. The drive.file permission is per-file — MDflow can only touch the folders and files you pick, and cannot browse or search the rest of your Drive.
  • ›Conflict-safe by design. If the file changed in Drive since you opened it, MDflow warns you and never overwrites silently.
  • ›Free on every plan. Like the GitHub integration, editing Drive markdown needs no Pro subscription.
$prerequisites

Before you start

FieldWhat to enter
An MDflow accountAny plan — the Drive integration is not Pro-gated. Sign in or sign up.
A Google accountThe Google account whose Drive holds the markdown files you want to edit. Shared drives and files shared with you are supported.
A workspaceYou connect Google Drive per workspace, so open the workspace you want your Drive files to appear in first.
$connect gdrive

Connect your account

Connecting is a one-time, browser-based sign-in — there is no token to create or paste.

1

Open Google Drive in the source rail

In the sidebar, click the Google Drive icon in the source rail — the strip of icons down the left of the sidebar that switches between your workspace, GitHub, and Drive. The Drive panel opens with a Connect Google Drive button.

MDflow — Google Drive panel
Google Drive

Connect Google Drive, then pick folders and files to manage them from this workspace.

Connect Google Drive
Illustration — the Drive panel before connecting.
2

Authorize MDflow on Google

MDflow sends you to Google. Sign in if you are not already, then grant access. Google's consent screen shows a per-file Drive permission — leave it checked, or the connection stores no usable Drive access. See the note below on exactly what that grants.

3

Pick folders and files

Back in your workspace, use Add folder and Open file to choose exactly what MDflow can see. Google's own picker opens; anything you select is added to the Drive panel. Open file accepts any file type: open a folder in the picker and select all of its files to add them in one go — they then appear inside that folder in the panel. Turn on Show files shared with me to include shared drives and files others shared with you.

MDflow — Google Drive
+ Add folderOpen file
Notes/
roadmap.md
standup.md
Q3 budget
Illustration — the Drive panel: Add folder, Open file, and your picked files. Markdown opens in MDflow; the spreadsheet opens in Google Sheets.
Scope & security: MDflow requests Google's drive.file scope — the narrowest Drive scope Google offers, which grants access only to the files you pick and the files MDflow creates, never your whole Drive. The long-lived access and refresh tokens are encrypted at rest on MDflow's server and never sent to your browser. The one exception is a short-lived picker token, which Google's file picker requires to run in the browser. Disconnecting deletes the connection; you can fully revoke MDflow from your Google Account settings.
$edit + save

Open, edit, and save

1

Open a picked file

Expand a picked folder or open a picked file in the Drive panel — every file type is listed, each with its own icon. Click a markdown file (.md or .markdown, up to 500 KB) to open it in the editor with the usual Edit, Split, and Preview views. Any other file — a Google Doc, Sheet, or Slides deck, a PDF, an image, a video, or a text file such as .json or .log— opens Google's own page for it in a new tab, where Docs, Sheets, and Slides open in their editors and the rest play or preview read-only.

2

Edit with live preview

Edit the file just like any MDflow document. The header shows the file's Drive name, and the same Monaco editor and preview you use everywhere else apply here.

3

Save back to Drive

Pressing Save (or ⌘S / Ctrl+S) writes the change straight back to the same file in Google Drive. There is no separate export step — the Drive file is updated in place.

mdflow.cz — roadmap.md · Google Drive
# Roadmap — your edited markdown…
Saved to DriveSave
Illustration — saving writes back to the Drive file.
If the file changed in Drive: When the file is edited elsewhere after you opened it, MDflow detects the mismatch on save and warns you instead of overwriting. Reload the latest version from Drive, then reapply your edit. Your work is only ever replaced on your explicit choice.
$new · rename · delete

Create, rename, and delete files

  • ›New document — create a new markdown file inside a picked folder; MDflow uploads it to Drive and opens it for editing.
  • ›Rename — rename a file or folder in place; the change is applied to the item in Drive.
  • ›Delete — deleting moves the file to your Drive trash after a confirmation. Nothing is ever hard-deleted, so you can restore it from Drive.

Everything happens on the real file in Drive, so your changes show up in Drive's own version history exactly as if you had made them there.

$how it works

How it works, and what to expect

  • ›A live proxy by default. MDflow reads and writes your files through the Google Drive API on demand. A Drive file enters your MDflow workspace only when you choose Import on it — a snapshot filed in the workspace folder you pick, which then lives its own life as an ordinary MDflow document while Drive keeps the original.
  • ›Per-file access is the whole model. Picking a folder lets MDflow see that folder and any markdown file MDflow creates in it — but not the files that were already there. To reach existing Drive files, add them with Open file, which grants access to each file you select — open the folder in the picker and select all of its files to grant a whole folder at once.
  • ›Markdown is edited, everything else is opened. Only .md / .markdown files up to 500 KB are edited in MDflow. Native Google Docs have no markdown source to write back to, so they — and every other file type — open in Google's own page in a new tab instead.
  • ›Drive features come from Drive. Because Drive files are not MDflow documents, MDflow's workspace search, version history, sharing, and comments do not apply to them — their history is Drive's own.
Known edges: The drive.file model means a connected folder shows only files MDflow created, not pre-existing ones (use Open file for those — you can select several at once), and disconnecting clears the folders and files you picked. Google access tokens also expire about once an hour; MDflow refreshes them automatically, but if a session can't refresh you'll be prompted to reconnect.
$disconnect gdrive

Disconnect

In the Drive panel, open the connection menu and choose Disconnect. MDflow removes the connection and clears the folders and files you picked in that workspace; nothing in Google Drive is deleted. To fully revoke MDflow's access, use Google Account → Data & privacy → Third-party access.

$man troubleshooting

Troubleshooting

Google Drive connection troubleshooting: symptoms and fixes
SymptomCause & fix
No Drive files in a connected folderExpected under drive.file: a picked folder shows only files MDflow created, not files that were already there. Use Open file, open the folder in the picker, and select all of its files — they then appear inside the folder.
A file opens in Google Drive, not the editorOnly markdown files (.md, .markdown) up to 500 KB open in the MDflow editor. Every other file type opens in Google's own page in a new tab.
Can't find a shared file when pickingTurn on Show files shared with me in the Drive panel to include shared drives and files others shared with you.
Google Drive session expiredGoogle access tokens expire about hourly. MDflow refreshes them automatically; if it can't, click Reconnect Drive in the panel.
Connected, but every action failsThe Google authorization was revoked or expired. Disconnect and reconnect Drive from the panel.