Skip to content

Add patch CLI command for existing memory documents#171

Merged
G9Pedro merged 1 commit intomasterfrom
cursor/document-patch-command-cba8
Mar 14, 2026
Merged

Add patch CLI command for existing memory documents#171
G9Pedro merged 1 commit intomasterfrom
cursor/document-patch-command-cba8

Conversation

@G9Pedro
Copy link
Copy Markdown
Contributor

@G9Pedro G9Pedro commented Mar 13, 2026

Summary

  • add a new patch command implementation at src/commands/patch.ts
  • support three patch modes:
    • clawvault patch <path> --append "content"
    • clawvault patch <path> --replace "old" --with "new"
    • clawvault patch <path> --section "## Name" --content "body" (section upsert)
  • preserve YAML frontmatter by delegating document mutation to ClawVault.patch(...)
  • keep indexing scoped to the patched document via existing vault patch/reindex behavior
  • register registerPatchCommand in src/cli/index.ts
  • add focused tests in src/commands/patch.test.ts for all modes and CLI registration

Testing

  • npm run build && npx vitest run src/commands/patch.test.ts
  • npm test

Notes

  • followed scope limits: only added new src/commands/patch.ts and src/commands/patch.test.ts, and updated only the CLI entry point registration file (src/cli/index.ts).
Open in Web Open in Cursor 

Co-authored-by: G9Pedro <G9Pedro@users.noreply.github.com>
@G9Pedro G9Pedro marked this pull request as ready for review March 14, 2026 00:20
@G9Pedro G9Pedro merged commit 46e3ca1 into master Mar 14, 2026
2 checks passed
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.

2 participants