Memo Actions
list — List Memos
List memos with optional pagination, filtering, and sorting.
bash
# Default: list 10 most recent memos
$RUNTIME "$API_SCRIPT" list
# List with custom limit
$RUNTIME "$API_SCRIPT" list --limit=20
# Filter by tag
$RUNTIME "$API_SCRIPT" list --tag=ai
# Filter by state (NORMAL or ARCHIVED)
$RUNTIME "$API_SCRIPT" list --state=ARCHIVED
# Order by different criteria
$RUNTIME "$API_SCRIPT" list --order="create_time asc"
$RUNTIME "$API_SCRIPT" list --order="pinned desc, display_time desc"
# Filter using CEL expressions
$RUNTIME "$API_SCRIPT" list --filter='tags == ["ai"]'
# Show deleted memos
$RUNTIME "$API_SCRIPT" list --show-deleted
# Combine multiple parameters
$RUNTIME "$API_SCRIPT" list --limit=20 --state=NORMAL --order="create_time desc" --tag=aiImplementation details:
- Calls
GET /api/v1/memoswith query parameters:pageSize=N(from--limit)state(from--state=NORMAL|ARCHIVED)orderBy(from--order=xxx)filter(from--filter=xxxor combined with tag)showDeleted=true(when--show-deletedis present)
- When
--tagis specified, combines with filter parameter using CEL expressions - Displays results as a formatted list showing:
- Memo ID (shortened)
- Content (first 100 chars)
- Tags (if any)
- Visibility (PRIVATE/PROTECTED/PUBLIC)
- Created time (formatted to local timezone)
Response format displayed:
📝 memos/abc123
内容: 这是一条测试笔记...
标签: #ai #test
可见性: PRIVATE
创建时间: 2026-04-14 14:30
---create — Create a Memo
Create a new memo with content and optional visibility.
bash
$RUNTIME "$API_SCRIPT" create "这是一条新笔记 #test"
$RUNTIME "$API_SCRIPT" create "公开笔记内容" --visibility=PUBLIC
$RUNTIME "$API_SCRIPT" create "受保护的笔记" --visibility=PROTECTED
$RUNTIME "$API_SCRIPT" create "自定义ID笔记" --memo-id=my-custom-idImplementation details:
- Calls
POST /api/v1/memoswith body:json{ "content": "内容", "visibility": "PRIVATE", // default, or specified value "memo_id": "my-custom-id" // optional, when --memo-id is provided } - Valid visibility values:
PRIVATE(default),PROTECTED,PUBLIC memo_idis optional; if not provided, the server auto-generates an ID- Tags are automatically extracted from
#tagpatterns in content - Returns the created memo's ID and a summary
Display after creation:
✅ Memo created successfully
ID: memos/abc123
可见性: PRIVATE
标签: #testget — Get a Single Memo
Retrieve a specific memo by ID.
bash
$RUNTIME "$API_SCRIPT" get memos/abc123
$RUNTIME "$API_SCRIPT" get abc123Implementation details:
- Calls
GET /api/v1/memos/{id} - Normalizes the ID (strips
memos/prefix if present, then re-adds for the API call) - Displays full memo content, tags, visibility, timestamps
Display format:
📋 Memo: memos/abc123
━━━━━━━━━━━━━━━━━━━━━━━━
[Full content with Markdown]
━━━━━━━━━━━━━━━━━━━━━━━━
标签: #ai #test
可见性: PRIVATE
创建: 2026-04-14 14:30
更新: 2026-04-14 15:00update — Update a Memo
Update a memo's content and/or visibility.
bash
$RUNTIME "$API_SCRIPT" update abc123 "更新后的内容"
$RUNTIME "$API_SCRIPT" update abc123 "新内容" --visibility=PUBLICImplementation details:
- Calls
PATCH /api/v1/memos/{id}?updateMask=content,visibility - Body includes both
contentandvisibility(if specified) - Returns the updated memo summary
Display after update:
✅ Memo updated successfully
ID: memos/abc123
可见性: PUBLIC
标签: #newdelete — Delete a Memo
Delete a memo permanently.
bash
$RUNTIME "$API_SCRIPT" delete abc123
$RUNTIME "$API_SCRIPT" delete abc123 --forceImplementation details:
- Calls
DELETE /api/v1/memos/{id}(normal) orDELETE /api/v1/memos/{id}?force=true(with--force) - Confirmation required: Before deletion, confirm with the user by showing the memo content preview
forceparameter: whentrue, forcefully deletes memos that have related data (e.g., comments, relations)- On success, display confirmation message
Confirmation flow:
- Fetch memo content with
get - Show: "⚠️ 确定要删除这条 memo 吗?" + content preview
- If
--forceis provided, show: "模式: 强制删除(含关联数据)" - User confirms → proceed with deletion
- On success: "✅ Memo deleted: memos/abc123"
pin — Pin/Unpin a Memo
Toggle a memo's pinned status.
bash
$RUNTIME "$API_SCRIPT" pin abc123Implementation details:
- First calls
GET /api/v1/memos/{id}to check current pinned status - Then calls
PATCH /api/v1/memos/{id}?updateMask=pinnedwith{"pinned": !current_pinned} - Toggles: if pinned → unpin, if unpinned → pin
- On success, display the new pinned status
Display format:
bash
# Pinning an unpinned memo
📌 Memo pinned successfully
ID: memos/abc123
状态: 已置顶
# Unpinning a pinned memo
📌 Memo unpinned successfully
ID: memos/abc123
状态: 已取消置顶