Skip to content

docs(cli): add action items export to Markdown recipe for Obsidian and Notion - #13960

Merged
kodjima33 merged 2 commits into
BasedHardware:mainfrom
ElvinGts:docs/action-items-markdown-recipe
Sep 21, 2026
Merged

kodjima33 merged 2 commits into
BasedHardware:mainfrom
ElvinGts:docs/action-items-markdown-recipe

Conversation

@ElvinGts

@ElvinGts ElvinGts commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a standalone recipe and zero-dependency Python script to export Omi action items into structured Markdown files and checklists tailored for Obsidian, Notion, and Logseq.

Following the successful review and approval of our conversation exporter recipe (#13701), this PR provides users with a clean workflow to turn captured action items into actionable Markdown notes and daily review task lists.

Key Features

  1. Zero-Dependency CLI Tool (action_items_to_markdown.py):

    • Built with pure Python standard library (argparse, json, pathlib, re, datetime).
    • Parses action item arrays directly from omi action-item list --json (via stdin pipe or file input).
    • Formats clean YAML frontmatter with #omi, #action-items, and date metadata for graph indexing.
    • Converts completed and uncompleted tasks into standard interactive Markdown checkboxes (- [ ] and - [x]).
    • Traversal-safe filename generation with date prefix (YYYY-MM-DD_action_items.md).
    • Cross-platform UTF-8 and BOM safe.
  2. User Guide (action_items_markdown.md):

    • Detailed setup instructions, Unix pipeline examples (omi action-item list --json | python action_items_to_markdown.py -), and Obsidian vault integration guide.
  3. Index Link (README.md):

    • Added entry to the recipe directory index.

Verification

  • Tested with synthetic and live JSON exports matching the omi_cli output format.
  • Tested pipeline mode via stdin and file arguments.
  • Verified on Python 3.10, 3.11, and 3.12.
  • Traversal protection verified against adversarial inputs.

Bounty Request

Following the Contribution Guide, requested reward: US$20–$25 docs/recipe bounty.
Payment details: Wise tag @ellyboyj or PayPal ([email protected]).

cc @kodjima33 @Git-on-my-level

Review in cubic

@Git-on-my-level

Copy link
Copy Markdown
Member

Verified end to end — thanks for the clean recipe, and welcome as a first-time contributor.

  • action_items_to_markdown.py — pure stdlib (argparse/json/re/sys/datetime/pathlib), no network, no subprocess, no eval. I ran it against synthetic exports shaped like the real CLI output: stdin pipe, --output file, --output-dir --group-by date (produces correct YYYY-MM-DD_action_items.md files), --status open, the {"items": [...]} wrapper, UTF-8-BOM input, empty input, and invalid JSON (clean error, exit 1) — all behave exactly as documented, and the emitted document matches the sample in the guide.
  • Docs match the actual CLI: --json is a root flag so omi --json action-item list is the right placement, --open exists on action-item list, and every field the script reads (id, completed, description, due_at, created_at, conversation_id) matches the dev API's ActionItemResponse and the CLI's list columns.
  • examples/README.md is agent-facing index docs (it routes agents to agent_quickstart.md); this PR only adds one bullet for the new recipe and doesn't alter any existing agent guidance, so no agent-behavior change beyond discoverability of an inert example script.

Two minor nits, neither blocking:

  1. sdks/python-cli/examples/README.md is rewritten wholesale with CRLF line endings, so every line shows as changed. Re-saving with LF would collapse the diff to just the new bullet.
  2. slugify() in action_items_to_markdown.py (line 27) is defined but never called — the date-prefix regex in main() already guards generated filenames. Drop it or keep it as a utility, your call.

Consistent with the approved conversation-export recipe (#13701). Leaving for human maintainer review for the merge and bounty call.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added docs-tooling Layer: Documentation, examples, dev tools positive-signal Automation verified a genuine fix/quality contribution labels Sep 15, 2026
ElvinGts added a commit to ElvinGts/omi that referenced this pull request Sep 15, 2026
@ElvinGts

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review and verification! Addressed both nits: dropped the unused slugify() function and re-saved README.md with LF line endings so the diff collapses cleanly to just the new recipe bullet.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against the real CLI: omi action-item list --open matches the actual --completed/--open Typer flag pair, and the script's field names (description, due_at, completed, conversation_id, id) match the dev API's action-item shape. Zero-dependency stdlib script with path-traversal-safe filenames. Docs-correctness gate passes. Not merging: mergeStateStatus is DIRTY — leaving at approve per no-rebase policy.

@Git-on-my-level

Copy link
Copy Markdown
Member

Content re-verification on the current head (33bab5b) — the maintainer approval from yesterday still reflects this exact commit, and checks against the CLI source agree:

  • action_items_markdown.md — every CLI claim checks out: --json is a root-level flag (omi_cli/main.py), --open is the real inverse of --completed on action-item list (omi_cli/commands/action_item.py), and the script's expected fields (id, description, due_at, completed, created_at) match the CLI's _LIST_COLUMNS exactly. The sample output block matches what the script actually emits, including frontmatter counts and the due/wikilink/id metadata line format.
  • action_items_to_markdown.py — still pure stdlib, no network/subprocess/eval. The traversal gate (^\d{4}-\d{2}-\d{2}$ regex validated before any filename is built, with an undated fallback) is sound since date strings come only from strftime. BOM-safe utf-8-sig input handling confirmed.
  • README.md — index entry is correct and links the right file.

One new thing since the approval: main moved and this branch now conflicts — a Catalan quickstart entry landed at the same spot in examples/README.md. A trivial rebase will clear it; since the approved commit itself is unchanged, that's a mechanical update rather than a content re-review.

Optional while rebasing: Union in the typing import of action_items_to_markdown.py is unused — feel free to drop it, purely cosmetic.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@ElvinGts

Copy link
Copy Markdown
Contributor Author

Thanks @Git-on-my-level! Rebased to incorporate the Catalan quickstart in README.md and dropped the unused Union import in action_items_to_markdown.py. The branch is cleanly mergeable with zero conflicts.

@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up verification on the current head (7b0cf08) after the rebase that followed the earlier approval:

  • Delta since the approved commit (33bab5b) is inert for this PR's files: action_items_to_markdown.py only drops the unused Union import, and the two new examples/README.md lines (conversations_markdown.md, quickstart.ca.md) arrive from main via the merge — this PR still adds exactly the action-items bullet.
  • Re-ran the script at this head with adversarial input (invalid due_at, newline/frontmatter injection, hostile ids): filenames stay YYYY-MM-DD_action_items.md / undated_action_items.md (regex-gated in --output-dir mode), task text is flattened to one line, ids are sanitized to [\w-], and there is no subprocess/network/eval anywhere in the file.
  • Docs claims still match the CLI at this head: --json is a root-level option (omi_cli/main.py), --open/--completed is the real flag pair on action-item list (omi_cli/commands/action_item.py), and the field names (description, due_at, created_at, completed, conversation_id) match the CLI's own list columns and filters.
  • The Linux/Windows Python CI lanes ran on this change set and passed; GitHub is currently recomputing mergeability after the rebase, which should settle on its own.

From the automation side this is ready; the merge call stays with the maintainer per the approval already on file.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-correctness gate passed: verified omi action-item list/--json flag and the example script (stdlib-only, no eval/exec, safe path handling) against current CLI. mergeStateStatus UNKNOWN, so approve only per hard rule (not merging).

@Git-on-my-level

Copy link
Copy Markdown
Member

Reviewed all three files on the current head and independently verified the recipe's claims — everything checks out.

What I verified

  • action_items_to_markdown.py: genuinely stdlib-only (argparse/json/re/sys/datetime/pathlib/typing), and the traversal protection is real, with two layers — parse_datetime rejects non-ISO date strings, and the date-grouping branch re-validates filename prefixes against ^\d{4}-\d{2}-\d{2}$ before writing. I ran the script with an adversarial due_at: "../../etc/passwd" input: it's neutralized and every file stayed inside --output-dir.
  • action_items_markdown.md: every documented command matches the actual CLI surface — omi --json action-item list (global --json in main.py, list in commands/action_item.py), the --open filter, omi auth login, and the omi-cli package name. The sample output block matches what the script actually renders (verified by execution, including the multiline-description flattening and the Untitled action item fallback).
  • Field mapping: description/completed/due_at/created_at/conversation_id/id all match the backend's ActionItemResponse shape, so the parser won't silently drop metadata.
  • README.md: the index entry and link target are correct.

One non-blocking nit: the [[conversation_<id>]] wikilinks won't resolve in Obsidian as-is — the sibling conversations exporter (#13701) names its notes YYYY-MM-DD_<slug>_<shortid>.md, so cross-linking from action items to exported conversations would need matching note names. Fine to address in a follow-up if second-brain cross-linking matters to users.

For the maintainers' context: the only PR-side change since the latest approval is a merge of main; the three example files themselves are unchanged. Thanks for the careful, security-conscious recipe — merging is the maintainers' call.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open on 6b82a613426a.

docs action-items markdown recipe, no tests, DIRTY.

kodjima APPROVE is the size gate, not maintainer merge.

I am not approving or merging this SHA.

@ElvinGts
ElvinGts force-pushed the docs/action-items-markdown-recipe branch from 6b82a61 to 5172534 Compare September 20, 2026 17:10
@ElvinGts

Copy link
Copy Markdown
Contributor Author

Thanks @aryanorastar! Addressed both points on the new head (517253480b):

  1. Unit Tests Added (sdks/python-cli/tests/test_action_items_to_markdown.py):

    • Comprehensive test suite (9/9 tests pass in 0.05s) using pure standard library unittest.
    • Tests cover YAML frontmatter & summary generation, status grouping (📌 Pending Tasks vs ✅ Completed Tasks), date grouping (📅 YYYY-MM-DD (Due) / (Created)), multiline description flattening, missing title fallbacks (Untitled action item), various JSON input formats (list, items, action_items, single dict), path traversal containment in --output-dir date grouping, and UTF-8 BOM handling.
  2. Clean Rebase (Zero Merge Commits, Not DIRTY):

    • Rebased cleanly on current origin/main (16fc207534).
    • Removed all prior merge commits; git history is now strictly linear (2 clean commits: docs recipe + unit tests).
    • Verified diff against origin/main touches only the 4 intended files (README.md, action_items_markdown.md, action_items_to_markdown.py, and test_action_items_to_markdown.py) with zero accidental deletions.

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on 517253480b.

The earlier hold on 6b82a61 (no tests, DIRTY) is cleared: linear rebase onto current main, plus sdks/python-cli/tests/test_action_items_to_markdown.py. Python CLI Linux 3.10 / 3.12 and Windows ACL are green on this head. Hygiene is green. Locally the new suite is 9/9.

CLI claims still match omi_cli (--json is root-level, --open/--completed is the real Typer pair, field names match the list columns). Script stays stdlib-only (no eval/exec/network/subprocess). README is one additive bullet.

I am not merging this SHA.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: all CLI commands (omi --json action-item list --open, etc.) are real; ran the added script against sample data and it produced output matching the documented example; ran the added test suite (9/9 pass). No secrets/eval/exec/shell=True. Fully verified per docs-correctness gate.

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

Labels

docs-tooling Layer: Documentation, examples, dev tools positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants