Skip to content

feat(md): add --format flag for rev-iso/legacy filename formats#69

Open
MrDwarf7 wants to merge 4 commits into
afar1:mainfrom
MrDwarf7:mrdwarf7/cli-options
Open

feat(md): add --format flag for rev-iso/legacy filename formats#69
MrDwarf7 wants to merge 4 commits into
afar1:mainfrom
MrDwarf7:mrdwarf7/cli-options

Conversation

@MrDwarf7
Copy link
Copy Markdown

@MrDwarf7 MrDwarf7 commented Apr 10, 2026

Summary

Add --format flag to ft md command to support both rev-iso (new default) and legacy filename formats for exported markdown files.

Benefits

  • Users can now choose between ISO-style filenames (2024_01_15-Mon-author-slug.md) or legacy format (2024-01-15-author-slug.md)
  • Default is rev-iso for better sorting/organization
  • Maintains backward compatibility via --format legacy

Changes

  • src/cli.ts: Added --format <type> option with choices legacy or rev-iso, default rev-iso
  • src/md-export.ts: Added FilenameFormat type, parsePostedAt() for date parsing, bookmarkFilenameLegacy() and updated bookmarkFilename() to handle both formats

Docs

Updated README to document the new --format option in the md command section.


Note

Medium Risk
Moderate risk because it changes the default markdown export filename scheme, which can affect downstream tooling and incremental exports (skip/overwrite behavior) based on existing filenames.

Overview
Adds a --format option to ft md to choose the markdown export filename scheme, defaulting to the new rev-iso format.

Updates the exporter to support both rev-iso (YYYY_MM_DD-DOW-author-slug.md) and the prior legacy format, including date parsing for multiple timestamp string shapes and wiring the selected format through exportBookmarks().

Reviewed by Cursor Bugbot for commit 052125c. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 052125c. Configure here.

Comment thread src/md-export.ts
Comment thread src/cli.ts Outdated
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 10, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

- Replace fake type assertion with Commander .choices() for runtime
  validation of --format values (typos now error instead of silently
  defaulting to rev-iso)
- Add format migration guard: when existing .md files use legacy names
  but rev-iso is requested, prompt user to back up + regen, force
  regen in-place, continue with duplicates, or cancel
@MrDwarf7 MrDwarf7 force-pushed the mrdwarf7/cli-options branch from 4a38204 to b3f96a6 Compare April 10, 2026 17:50
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 10, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

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