mdtodo

A local-first task manager for GitHub Flavored Markdown files, shipped as a single self-contained executable.

mdtodo

mdtodo

Other0.x

A local-first task manager for GitHub Flavored Markdown files, shipped as a single self-contained executable.

Verify Release License: MIT

mdtodo

Your tasks. Your Markdown. Always local.

mdtodo is a local-first task manager for ordinary GitHub Flavored Markdown (GFM) files. A single executable starts a loopback HTTP server and serves a React application with all assets embedded. The Markdown files are the only task store.

There are no accounts, databases, telemetry, cloud services, CDN assets, or runtime downloads. You keep your tasks in plain .md files that work with any editor, Git repository, or AI agent.

Features

  • Markdown is the database — tasks live in standard GFM task lists inside your own files.
  • Single self-contained executable — the Bun runtime, server, and frontend assets are bundled into one binary.
  • Tasks and subtasks — create, edit, complete, delete, and reorder nested tasks.
  • Sections and board view — headings become sections in the list view and columns in the Kanban board.
  • Drag and drop — reorder tasks and move them between sections while keeping nested content intact.
  • Search and filters — search titles, filter pending or completed tasks, and track counts and progress.
  • Workspace discovery — recursively find case-insensitive TODO.md files across a directory tree.
  • Raw Markdown editor — edit the actual source with save, cancel, copy, drafts, and conflict handling.
  • Live synchronization — external editor and agent changes arrive through directory watching and SSE.
  • Undo — revert the latest UI mutation when no newer revision exists.
  • Themes — light, dark, or system mode with Sage, Slate, Ocean, Violet, or Sand styles.
  • Keyboard friendly — shortcuts for search, task creation, saving, undo, and accessible drag and drop.
  • Local by default — listens only on 127.0.0.1, with Origin, CSRF, and path-containment checks.

Requirements

The compiled application requires only an ordinary browser and the operating system's normal runtime libraries. Bun, Node.js, Docker, a database, node_modules, source files, and a public asset directory are not required.

Building from source requires Bun 1.4.5 or newer.

Installation

Prebuilt binaries

Download the binary matching your operating system and architecture from the releases page, then verify it against the published SHA256SUMS.

PlatformArchitectureAsset
Linuxx64mdtodo-linux-x64
LinuxARM64mdtodo-linux-arm64
macOSIntelmdtodo-darwin-x64
macOSApple Siliconmdtodo-darwin-arm64
Windowsx64mdtodo-windows-x64.exe
WindowsARM64mdtodo-windows-arm64.exe

On Linux or macOS:

curl -LO https://github.com/omisai-tech/mdtodo/releases/latest/download/mdtodo-linux-x64
curl -LO https://github.com/omisai-tech/mdtodo/releases/latest/download/SHA256SUMS

grep ' mdtodo-linux-x64$' SHA256SUMS | sha256sum -c -

chmod +x mdtodo-linux-x64
mv mdtodo-linux-x64 mdtodo
./mdtodo --file ./TODO.md --port 3456 --open

Replace the asset name with mdtodo-darwin-arm64 or mdtodo-darwin-x64 on macOS, and use shasum -a 256 -c - instead of sha256sum when needed.

On Windows, download the matching .exe and run it from PowerShell:

Invoke-WebRequest `
  -Uri https://github.com/omisai-tech/mdtodo/releases/latest/download/mdtodo-windows-x64.exe `
  -OutFile mdtodo.exe

Get-FileHash .\mdtodo.exe -Algorithm SHA256
.\mdtodo.exe --file .\TODO.md --port 3456 --open

Compare the printed hash with the matching entry in SHA256SUMS. Binaries are currently unsigned, so your operating system may ask you to confirm that you trust the executable.

Build from source

git clone https://github.com/omisai-tech/mdtodo.git
cd mdtodo
bun install --frozen-lockfile
bun run dev --file ./examples/TODO.md

To produce a standalone binary:

bun run build
bun run smoke

Quick start

# Use ./TODO.md and the default port 3456
mdtodo

# Open a specific Markdown file
mdtodo --file ./tasks.md

# Discover every TODO.md below a directory
mdtodo --dir ~/projects

# Start on another port and open the browser
mdtodo --dir ~/projects --port 8080 --open

# Open a file without allowing mutations
mdtodo --file ./tasks.md --readonly

# Create ./TODO.md if it does not exist
mdtodo --init

Startup prints the resolved path, file count, operating mode, and URL. Open the printed http://127.0.0.1:PORT address; other hostnames are deliberately rejected.

Missing files are never created implicitly. Use --init to create ./TODO.md (or the file passed with --file). --init never overwrites an existing file and requires writable single-file mode.

CLI reference

OptionDescription
--file PATHOpen one Markdown file. Defaults to ./TODO.md.
--dir PATHRecursively discover TODO.md files in a workspace.
--port PORTHTTP port from 1 to 65535. Defaults to 3456.
--openOpen the default browser at the loopback URL.
--readonlyDisable all file mutations, including undo and raw saves.
--initCreate a missing file exclusively; never overwrite an existing file.
--checkCheck the workspace and embedded frontend, then exit without listening.
--help, -hShow usage.
--version, -vShow the version.

Additional rules:

  • --file and --dir are mutually exclusive.
  • --init cannot be combined with --readonly or directory mode.
  • --check cannot be combined with --open.
  • Options cannot be repeated, and values must be provided for --file, --dir, and --port.
  • In single-file mode, the path must end in .md (case-insensitive).
  • ~ and ~/... are expanded to the current user's home directory.
  • Ctrl+C and SIGTERM stop watchers, drain application writes, close SSE connections, and stop the server.

Workspace behavior

Single-file mode

Single-file mode opens one Markdown document. If the file disappears, its registration is kept so an editor can recreate it at the same path. The document remains visible with an error until it is readable again.

Directory mode

Directory mode recursively discovers files named TODO.md, case-insensitively.

Discovery:

  • ignores symlinks, hidden directories and files, and the node_modules, dist, build, out, coverage, vendor, and target directories
  • accepts files up to 2 MiB of valid UTF-8
  • is limited to 1,000 files and 64 directory levels, and shows a warning if truncated
  • keeps unreadable documents visible with an error

Markdown format

mdtodo uses ordinary GFM task lists. Headings divide the file into sections; nested headings become their own sections.

# Project tasks

## Inbox

- [ ] Triage new issues
  - [ ] Add labels
  - [ ] Assign an owner
- [x] Set up the repository

## Later

- [ ] Write release notes
- [ ] Publish the next release

Supported syntax includes -, +, and * list markers, ordered lists, [ ], [x], and [X] checkboxes, nesting, duplicate titles, Unicode, and root headings at different levels. Tasks can also appear before the first heading.

The parser recognizes real GFM task list nodes. Fenced and indented code, inline code, HTML comments, and frontmatter do not become tasks. Top-of-file YAML (---) and TOML (+++) frontmatter is masked only while parsing; the original bytes and source offsets are retained.

Every task and section ID combines a source position with the current content revision. IDs are ephemeral API and UI addresses and are never written into Markdown.

Preservation guarantees

Small mutations patch the original source string; no AST serializer rewrites the document.

  • Completing a task changes one checkbox character. An already-completed uppercase [X] is left untouched.
  • Editing a title replaces only the first-line title, preserving trailing spaces, continuation lines, and inline Markdown.
  • Moving or deleting a parent uses the full list-item block, including nested lists and continuation content.
  • Paragraphs, non-task lists, links, code, tables, comments, indentation, list markers, blank lines, LF/CRLF endings, and missing final newlines are preserved outside the edited range.
  • The result is reparsed, and unexpected task, heading, or nesting changes are rejected.
  • Completion does not cascade to subtasks.
  • In the raw editor, intentional full-document saves replace the whole source. Textarea edits follow the document's LF or CRLF convention.

Quoted tasks, tasks under non-task containers, and tab-indented containers allow safe checkbox and title edits but reject ambiguous structural edits.

Using the interface

Sections and tasks

Use Add section to name a section and choose its Markdown file. The section is appended using the last heading's level, or ## when the file has no headings. Use the + beside a section title, or Add a task to this section below an empty section, to create tasks.

Click a task title to edit it. The task menu can create a subtask, delete the whole block, move the task between sections, or move it up or down among siblings. Deleting a parent confirms the number of subtasks and the continuation content that will be removed.

List, board, and Markdown views

  • List shows sections as groups with nested tasks and per-section counts.
  • Board shows each heading as a column, including an Unsectioned column. Moving a card keeps its completion state and nested content.
  • Markdown opens a raw editor for the actual source.

Drag a handle to reorder a task. Cross-file movement and changing a subtask's parent through drag and drop are not supported; use the raw editor for those structural changes.

Search and filtering

Search matches task titles, and filtering retains ancestors as context when a nested task matches. The sidebar and section headers show open and completed counts plus progress. Filtering and sorting do not modify the file.

Raw editor

The raw editor shows source Markdown rather than rendered HTML. It supports save, cancel, copy, and conflict handling. Unsaved drafts survive external edits and switching views or files. When a file changes underneath a draft, the editor shows the latest version separately and requires a reload or explicit manual reapplication before saving a conflict.

Drafts live only in tab memory. Closing or reloading the tab loses them after the browser's unsaved-change warning. Theme mode, theme style, and the selected view are the only preferences stored in localStorage; task data is never persisted in browser storage.

Appearance

Use Appearance at the bottom of the sidebar to choose Light, Dark, or System mode, then choose a style: Sage (the original palette), Slate, Ocean, Violet, or Sand. The same style applies in both light and dark mode. System mode follows the operating system appearance while keeping the chosen style.

Mode and style are remembered across reloads in the same browser at the same server address and port. When browser storage is unavailable, choices last for the current tab.

Keyboard shortcuts

ShortcutAction
/ or Ctrl/Cmd+KFocus search
NOpen task creation outside text fields
Ctrl/Cmd+SSave the active Markdown editor
Ctrl/Cmd+ZUndo the last UI mutation outside text fields
EscapeCancel inline title editing or an active drag
Space on a drag handlePick up or drop a task
Arrow keys during a dragReorder vertically; move between board columns horizontally
Tab / Shift+TabNavigate interactive controls

Move up/down and Move to section menu actions provide a keyboard alternative to dragging.

Data integrity and synchronization

All application writes pass through a per-file queue. The server:

  1. reads fresh bytes and hashes them with SHA-256;
  2. checks the request's expected revision and target ranges;
  3. applies the smallest safe edit;
  4. writes and fsyncs an exclusive temporary file in the same directory;
  5. rechecks the original revision and permissions;
  6. atomically renames the temporary file over the original.

Temporary files are removed after failures. POSIX permission bits are preserved. Owner, group, ACLs, extended attributes, and hardlink relationships are not guaranteed to survive replacement.

Stale mutations return HTTP 409 Conflict and are never automatically replayed. The UI displays authoritative server results instead of optimistic checkbox changes.

Undo stores up to 30 pre-edit snapshots in server memory for 30 minutes and checks the exact post-edit revision before restoring. Server restarts lose undo history, and undo never overwrites a subsequent external edit.

Directory watchers handle editors that replace files during saving. Events are debounced by 100 ms, and a 2.5-second full rescan covers missed notifications and new directories. SSE uses 15-second heartbeats, cancels slow clients, and performs a full refresh on reconnect. The browser also refreshes visible tabs every 10 seconds and when returning to a suspended tab. Connection status distinguishes live SSE, polling or reconnection, and an unreachable server.

External writers do not participate in the queue. Hash checks and atomic replacement reduce risk but cannot provide a universal filesystem transaction. Use normal trusted local directories, keep backups for important files, and have agents reread a file before writing. Network filesystems can have different rename, watch, and durability behavior.

Security

The server binds only to 127.0.0.1 and checks the exact Host and port, Origin, and Fetch Metadata headers. Writes require JSON, the exact server Origin, and a random per-process CSRF token fetched from the same-origin workspace API. There is no permissive CORS.

  • Only randomly registered file IDs can reach the filesystem; no API accepts a file path.
  • Canonical containment checks, symlink rejection, and no-follow file opens protect the workspace boundary.
  • There is no command execution endpoint.
  • --open invokes only the platform browser opener with the validated loopback URL.
  • A restrictive Content Security Policy allows bundled scripts and styles and same-origin connections, blocks framing and arbitrary embedded content, and permits the inline style attributes required by Radix and dnd-kit positioning.
  • Untrusted Markdown is never injected as HTML.

Read-only mode is enforced at both the HTTP boundary and the mutation service, including undo and raw saves. Request bodies are bounded even for streaming requests, and raw file output is limited to 2 MiB.

Warning: Loopback access is not authentication against other processes or users on the same machine. Anyone who can access the loopback service can read the selected workspace and obtain its CSRF token. mdtodo is a single-user local tool; do not reverse-proxy it or expose it to a network.

HTTP API

The browser UI uses the same local API that is available to scripts and integrations.

MethodEndpointPurpose
GET/api/healthHealth and version
GET/api/workspaceWorkspace, files, mode, warnings, and CSRF token
GET/api/filesRegistered file summaries
GET/api/files/:idParsed document, raw source, and revision
GET/api/files/:id/rawRead { raw, revision }
PUT/api/files/:id/rawSave { raw, revision } using expectedRevision
POST/api/files/:id/tasksCreate a task with { title, sectionId?, parentId?, expectedRevision }
POST/api/files/:id/sectionsCreate a section with { title, expectedRevision }
PATCH/api/files/:id/tasks/:taskIdEdit { title?, completed?, expectedRevision }
DELETE/api/files/:id/tasks/:taskIdDelete with { expectedRevision, confirmChildren? }
POST/api/files/:id/moveMove with { taskId, sectionId, beforeTaskId? or afterTaskId?, expectedRevision }
POST/api/files/:id/undoRestore with { token, expectedRevision }
GET/api/eventsSSE ready and change events; fetch authoritative state

Successful mutations return { document, undoToken? }. Errors return { error: { code, message, currentRevision? } } with an appropriate 4xx or 5xx status. The raw GET response is JSON so it can carry both the source and its revision.

# Inspect the local workspace and obtain the CSRF token
curl http://127.0.0.1:3456/api/workspace

# Read a registered file
curl http://127.0.0.1:3456/api/files/FILE_ID

Write requests must include the CSRF token and a current expectedRevision; stale writes are rejected with 409.

Architecture

CLI → Workspace registry → Secured Bun request handler
             │                       │
       Per-file queue           REST + SSE
             │                       │
     Source-position engine      React application
             │
       Atomic filesystem writes
             ↑
      Directory watchers + rescan

The repository is organized into small modules:

PathResponsibility
src/markdownRemark parsing, revision hashing, and pure targeted source mutations
src/serverRegistry, native filesystem access, write serialization, undo, watcher, SSE, security, and API handlers
src/sharedTypeScript models and strict Zod request schemas shared with the browser
src/clientReact UI, themes, editor drafts, and accessible drag controls
src/cli.tsCLI validation and lifecycle
scriptsDevelopment and build entrypoints, checksums, and executable and browser smoke tests

The frontend is bundled into the executable at build time. Production builds disable development mode, HMR, source maps, and automatic loading of .env, bunfig.toml, package.json, or tsconfig from the executable's working directory. Frontend assets from Bun's HTML manifest pass through the same secured handler as API requests.

Tailwind CSS v4 compiles at build time through its official PostCSS adapter and a small Bun plugin. Radix-based shadcn/ui components are vendored under src/client/components/ui, with registry provenance and license in THIRD_PARTY_NOTICES.md. Icons are bundled Lucide React components, and typography uses local system fonts.

Development

Install Bun 1.4.5, then:

bun install --frozen-lockfile
bun run dev --file ./examples/TODO.md
bun run typecheck
bun test

Development uses Bun's bundler and native server. Frontend edits rebuild assets; refresh the browser after the rebuild message. Server module changes restart Bun's watch process. No Vite or separate backend framework is used.

Tests and verification

bun run build
bun node_modules/playwright/cli.js install chromium
bun run test:browser

On a minimal Linux CI host, use install --with-deps chromium. Playwright is a development-only dependency and is not included in the executable. Browser tests cover CRUD, section creation in list and board views, draft conflicts, nested tasks, delete and undo, search and filtering, board dragging, SSE-driven raw conflicts, keyboard save, all theme styles, saved preferences, system appearance changes, unavailable storage, and narrow or short viewports. Tests fail rather than silently skip when the server or browser cannot start.

Standalone builds

bun run build
bun run smoke                       # real HTTP, embedded assets, and a file mutation
bun run smoke --check-only          # isolated embedded-asset check without HTTP
bun scripts/checksums.ts
bun run build:all
bun run build --target=bun-darwin-arm64
TargetArtifact
Linux x64dist/mdtodo-linux-x64
Linux ARM64dist/mdtodo-linux-arm64
macOS x64dist/mdtodo-darwin-x64
macOS ARM64dist/mdtodo-darwin-arm64
Windows x64dist/mdtodo-windows-x64.exe
Windows ARM64dist/mdtodo-windows-arm64.exe

Cross-compilation needs network access on the build machine the first time Bun downloads each target runtime. That does not add runtime network dependencies to the resulting executable. CI builds and executes each target on a matching runner and emits a .verification.json sidecar only after a successful native HTTP smoke test.

Releases

Releases are started manually from Actions → Release → Run workflow. Choose patch (default), minor, or major, or choose custom and enter an X.Y.Z version. Custom versions cannot go backwards.

package.json is the single version source for the CLI, API, and compiled binaries. After every target passes verification, the workflow commits the version change, pushes the commit and vX.Y.Z tag together, and publishes a GitHub release with generated notes, combined SHA-256 checksums, binaries, and verification records. Release runs are serialized; if the branch advances during verification, the push fails without creating a tag.

Contributing

Contributions and feedback are welcome. Before opening a pull request:

  • read the contribution guidelines
  • run bun run typecheck, bun test, and the relevant smoke tests
  • add preservation tests for Markdown engine changes and integration tests for security or concurrency changes
  • keep runtime code offline and avoid unnecessary dependencies
  • preserve unrelated Markdown bytes, newlines, indentation, list markers, and unknown content

Open issues at github.com/omisai-tech/mdtodo/issues.

License

MIT licensed. See LICENSE, THIRD_PARTY_NOTICES.md, and AGENTS.md.