feat(memos-local): add data export endpoint and UI (closes #1474)#1475
Open
owensun6 wants to merge 1 commit intoMemTensor:mainfrom
Open
feat(memos-local): add data export endpoint and UI (closes #1474)#1475owensun6 wants to merge 1 commit intoMemTensor:mainfrom
owensun6 wants to merge 1 commit intoMemTensor:mainfrom
Conversation
- SqliteStore.exportAll(): dump all memories/tasks/skills as JSON - SqliteStore.exportMemoriesAsCsv(): memories-only CSV with ISO timestamps - GET /api/export?format=json|csv endpoint in ViewerServer - Export buttons in Settings → General tab (i18n: en + zh) - exportData() JS helper triggers file download via <a> click Closes MemTensor#1474
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the data export feature requested in #1474.
GET /api/export?format=json— downloads a full backup of all memories, tasks, and skills as a single JSON file (memos-export-YYYY-MM-DDTHH-MM-SS.json)GET /api/export?format=csv— downloads memories only as CSV with ISO 8601 timestamps (memos-memories-YYYY-MM-DDTHH-MM-SS.csv)Changes
src/storage/sqlite.tsSqliteStore.exportAll()andexportMemoriesAsCsv()methodssrc/viewer/server.tsGET /api/exportroute +handleExport()handlersrc/viewer/html.tsexportData()JS helper, i18n keysTest plan
npx vitest runContext
I'm an OpenClaw user and ran into the lack of backup/export while working with the plugin daily. The pre-existing test failures (embedding fetch errors,
update-install) are network-dependent and present onmainbefore this PR.