Bear CLI places YAML front matter in the wrong place

  • Bear Version: 2.8.1

  • OS Version: Mac Tahoe 26.5.1

  • What were you doing: using Bear CLI to create new notes

  • What feature did you use: Creating a note with both an explicit title and body content beginning with YAML frontmatter.

  • What happened: Bear inserted the title as a Markdown `#` heading before the supplied body content. This moved the YAML block below the title:

    My note title


    kind: test

    The CLI’s “insert at beginning” operation also inserts after the title, so it cannot later place a YAML block before that heading.

  • What did you expect to happen: When creating a note, I should be able to supply a title while preserving YAML frontmatter as the first content in the note. Ideally, Bear would either:

    • preserve the supplied body exactly and store the title separately, or
    • provide a dedicated frontmatter/metadata operation, or an insertion mode that inserts before the title.
1 Like

Right. What you should do in that case is just to omit the title as an argument and supply the full note content, including YAML, title, and any other content.

I will take a note about it, and we will see if we can improve the CLI in this regard.

2 Likes

I figured out this workaround but it would be great to have front matter as a first-class citizen in the CLI :slight_smile: Currently it’s very easy to break the frontmatter if we supply the title argument in any call.