pma-mem

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Memos

Memos

Operate Memos by sending HTTP requests to
$MEMOS_URL
(default
http://memos:5230
). Authenticate with a Personal Access Token stored in
$MEMOS_TOKEN
.
Keep this entry file small. Load only the references needed for the current turn.
通过向
$MEMOS_URL
(默认值为
http://memos:5230
)发送HTTP请求来操作Memos。使用存储在
$MEMOS_TOKEN
中的个人访问令牌进行身份验证。
请保持此入口文件精简,仅加载当前会话所需的参考文档。

Always-On Rules

通用规则

  1. Confirm
    $MEMOS_URL
    and
    $MEMOS_TOKEN
    before making any request. If missing, ask the user for them.
  2. Prefer
    curl -s
    piped to
    jq
    so results are easy to inspect.
  3. All authenticated requests must include
    -H "Authorization: Bearer $MEMOS_TOKEN"
    .
  4. API base path is
    /api/v1/
    . There is no v2 API.
  5. PATCH requests use
    updateMask
    as a query parameter, not in the body.
  6. Resource names follow
    {collection}/{id}
    format (e.g.
    memos/abc123
    ,
    users/roy
    ).
  7. Pagination uses
    pageSize
    +
    pageToken
    /
    nextPageToken
    .
  8. Error responses are gRPC-style:
    {"code": N, "message": "...", "details": []}
    .
  9. Memo visibility values:
    PRIVATE
    ,
    PROTECTED
    (logged-in users),
    PUBLIC
    .
  10. Memo state values:
    NORMAL
    ,
    ARCHIVED
    .
  1. 发送任何请求前先确认
    $MEMOS_URL
    $MEMOS_TOKEN
    已配置,若缺失请向用户索要。
  2. 优先使用
    curl -s
    管道传值给
    jq
    ,方便查看返回结果。
  3. 所有需要身份验证的请求都必须携带
    -H "Authorization: Bearer $MEMOS_TOKEN"
    请求头。
  4. API基础路径为
    /api/v1/
    ,目前没有v2版本API。
  5. PATCH请求将
    updateMask
    作为查询参数传递,不要放在请求体中。
  6. 资源名称遵循
    {集合名}/{id}
    格式(例如
    memos/abc123
    users/roy
    )。
  7. 分页使用
    pageSize
    +
    pageToken
    /
    nextPageToken
    参数实现。
  8. 错误响应为gRPC风格:
    {"code": N, "message": "...", "details": []}
  9. 备忘录可见性取值:
    PRIVATE
    PROTECTED
    (仅登录用户可见)、
    PUBLIC
    (公开)。
  10. 备忘录状态取值:
    NORMAL
    (正常)、
    ARCHIVED
    (已归档)。

Quick Start

快速入门

bash
undefined
bash
undefined

Health check (no auth needed)

Health check (no auth needed)

curl -s "$MEMOS_URL/api/v1/instance/profile" | jq
curl -s "$MEMOS_URL/api/v1/instance/profile" | jq

List memos

List memos

curl -s -H "Authorization: Bearer $MEMOS_TOKEN"
"$MEMOS_URL/api/v1/memos?pageSize=10" | jq
curl -s -H "Authorization: Bearer $MEMOS_TOKEN"
"$MEMOS_URL/api/v1/memos?pageSize=10" | jq

Create memo

Create memo

curl -s -X POST -H "Authorization: Bearer $MEMOS_TOKEN"
-H 'Content-Type: application/json'
"$MEMOS_URL/api/v1/memos"
-d '{"content":"Hello from CLI","visibility":"PRIVATE"}' | jq
curl -s -X POST -H "Authorization: Bearer $MEMOS_TOKEN"
-H 'Content-Type: application/json'
"$MEMOS_URL/api/v1/memos"
-d '{"content":"Hello from CLI","visibility":"PRIVATE"}' | jq

Search memos by content filter

Search memos by content filter

curl -s -H "Authorization: Bearer $MEMOS_TOKEN"
"$MEMOS_URL/api/v1/memos?filter=content.contains("keyword")" | jq
curl -s -H "Authorization: Bearer $MEMOS_TOKEN"
"$MEMOS_URL/api/v1/memos?filter=content.contains("keyword")" | jq

Update memo content

Update memo content

curl -s -X PATCH -H "Authorization: Bearer $MEMOS_TOKEN"
-H 'Content-Type: application/json'
"$MEMOS_URL/api/v1/memos/{uid}?updateMask=content"
-d '{"content":"Updated content"}' | jq
curl -s -X PATCH -H "Authorization: Bearer $MEMOS_TOKEN"
-H 'Content-Type: application/json'
"$MEMOS_URL/api/v1/memos/{uid}?updateMask=content"
-d '{"content":"Updated content"}' | jq

Delete memo

Delete memo

curl -s -X DELETE -H "Authorization: Bearer $MEMOS_TOKEN"
"$MEMOS_URL/api/v1/memos/{uid}" | jq
curl -s -X DELETE -H "Authorization: Bearer $MEMOS_TOKEN"
"$MEMOS_URL/api/v1/memos/{uid}" | jq

Archive memo

Archive memo

curl -s -X PATCH -H "Authorization: Bearer $MEMOS_TOKEN"
-H 'Content-Type: application/json'
"$MEMOS_URL/api/v1/memos/{uid}?updateMask=state"
-d '{"state":"ARCHIVED"}' | jq
undefined
curl -s -X PATCH -H "Authorization: Bearer $MEMOS_TOKEN"
-H 'Content-Type: application/json'
"$MEMOS_URL/api/v1/memos/{uid}?updateMask=state"
-d '{"state":"ARCHIVED"}' | jq
undefined

Reference Packs

参考文档包

Load only what the current task needs:
  • references/rest-api.md
    Full API endpoint reference: MemoService, UserService, AttachmentService, InstanceService, AuthService, ShortcutService.
  • references/workflows.md
    Common workflows: bulk operations, tag management, memo relations, comments, reactions, search patterns, and attachment handling.
仅加载当前任务所需的内容:
  • references/rest-api.md
    完整API端点参考:MemoService、UserService、AttachmentService、InstanceService、AuthService、ShortcutService。
  • references/workflows.md
    常用工作流:批量操作、标签管理、备忘录关联、评论、反应、搜索模式及附件处理。

Quick Routing

快速指引

Choose references by intent:
  • Single memo CRUD or API details: load
    references/rest-api.md
    .
  • Bulk operations, search, tag workflows, or attachments: load
    references/workflows.md
    .
  • Full understanding of all endpoints: load both.
根据用户意图选择参考文档:
  • 单条备忘录CRUD或API详情:加载
    references/rest-api.md
  • 批量操作、搜索、标签工作流或附件处理:加载
    references/workflows.md
  • 如需完整了解所有端点:同时加载两份文档。