Skip to content

feat: todoist push command#70

Open
nickhart wants to merge 5 commits into
mainfrom
feat/todoist-push
Open

feat: todoist push command#70
nickhart wants to merge 5 commits into
mainfrom
feat/todoist-push

Conversation

@nickhart

Copy link
Copy Markdown
Contributor

Summary

  • Adds md2do todoist push <file> — a one-way command that pushes a markdown file to Todoist as a new project with sections and tasks
  • Writes {todoist:ID} back to H1 and H2+ headings after pushing for correlation
  • Supports --dry-run (preview) and --force (skip confirmation / re-push) flags
  • Completed tasks are skipped; all H2+ headings become flat Todoist sections (Todoist doesn't support nested sections)

Changes

  • @md2do/core: new parseDocument() function and DocumentTree types for parsing markdown H1/H2/H3+ structure
  • @md2do/core: new updateHeadings() writer for atomic heading ID write-back
  • @md2do/todoist: new pushDocument() engine; TodoistClient gains addProject, addSection, getSections
  • @md2do/cli: todoist push subcommand wired up
  • Docs: docs/cli/todoist/push.md, updated CLI overview, integration guide, and roadmap
  • ESLint: added **/tests/**/*.ts override to disable unbound-method false positive on vitest mocks

Test plan

  • pnpm -r run test:run — all tests pass (11 new push engine tests, 8 document parser tests)
  • md2do todoist push <file> --dry-run — preview output, no API calls
  • md2do todoist push <file> — creates project/sections/tasks in Todoist, writes IDs back to file
  • md2do todoist push <file> on already-pushed file — errors without --force
  • md2do todoist push <file> --force — re-pushes, creates new project

Backlog (not in this PR)

  • Nested sub-tasks (syntax not yet decided)

🤖 Generated with Claude Code

nickhart and others added 5 commits June 22, 2026 23:40
Add `md2do todoist push <file>` command that parses a markdown file's
H1/H2 structure into a Todoist project with sections and tasks, then
writes `{todoist:ID}` back to the headings for correlation.

- New document parser in @md2do/core for markdown → tree structure
- Push engine in @md2do/todoist creates project, sections, and tasks
- TodoistClient gains addProject, getSections, addSection methods
- Writer gains updateHeadings for atomic heading ID write-back
- CLI supports --dry-run and --force options

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Todoist sections are flat (no nesting), so all H2+ headings should be
treated equally. Previously H3+ headings were silently ignored and their
tasks folded into the preceding H2 section.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add BRANCH_STATUS.md at repo root with done/remaining checklist
- Add docs/cli/todoist/push.md reference page
- Update todoist CLI overview to include push command
- Update integrations/todoist.md with push workflow and examples
- Update roadmap to v0.7.x and add Todoist Push in-progress section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix sync command to strip both {todoist:ID} and [todoist:ID] when
  removing a deleted task's link (was only handling legacy bracket form)
- Add 11 unit tests for pushDocument() covering: project creation,
  section creation, task routing, completed task skipping, result counts,
  section ID mapping, guard against re-push, priority/tag/due date mapping
- Add **/tests/**/*.ts ESLint override to disable unbound-method rule,
  which false-positives on vitest mock assertions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
md2do Ready Ready Preview, Comment Jul 16, 2026 5:45am

Request Review

@github-actions

Copy link
Copy Markdown

Coverage after merging feat/todoist-push into main will be

89.98%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   index.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–33, 4–9
src/document
   index.ts99.26%95.24%100%100%75
src/filters
   index.ts98.85%94.83%100%99.44%128–130, 186, 196
src/migrator
   index.ts99.32%92.31%100%100%110
src/parser
   index.ts96.45%93.59%100%96.95%122–128, 131, 141–147, 92, 95
   patterns.ts100%100%100%100%
src/scanner
   index.ts94.96%77.78%100%97.10%100–101, 101–103, 95, 95–98, 98–99
src/sorting
   index.ts98.83%94.12%100%100%116, 137, 95
src/utils
   dates.ts83.45%92.31%66.67%82.93%24–38, 76–82
   id.ts100%100%100%100%
src/warnings
   filter.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–79, 8, 80–89, 9, 90–93
src/writer
   index.ts85.11%86.05%75%85.11%145, 154–188, 244–245, 251–253, 280–291, 325–327, 370–375

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant