Skip to content

[Feature] Add atomic frontmatter updates to zn CLI #708

Description

@10wpressure

User Story

As an automation or AI-agent user, I want to update individual frontmatter fields through the zn CLI without replacing the complete note or using MCP.

Problem

The CLI supports reading, replacing, appending, and prepending note content, but it cannot safely update individual frontmatter fields.

Task workflows therefore require either:

  • the slower MCP update operation; or
  • rewriting the complete Markdown note, risking lost body content or unrelated metadata.

Solution

Add an atomic frontmatter update command:

zn meta set "inbox/Tasks/Example.md" \
   --set status=in_progress \
   --set assignee=author_name \
   --set updated=2026-08-31T13:00:00Z \
   --unset blocked-by \
   --json

Optionally support conditional updates for safe concurrent claims:

zn meta set "inbox/Tasks/Example.md" \
   --if status=open \
   --set status=in_progress \
   --set assignee=author_name

Acceptance Criteria

  • Individual frontmatter fields can be set and removed
  • Multiple fields can be changed in one operation
  • Note body and unrelated frontmatter fields are preserved
  • Update is written atomically
  • Missing notes and malformed frontmatter return clear errors
  • --json returns the updated path and metadata
  • Conditional updates fail without changing the note when the condition does not match
  • CLI documentation includes an automation/task-management example

Contribution

I’d be happy to contribute an implementation if this feature fits the project’s direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions