CRITICAL — First read 共享规则, which contains mocli initialization, authentication, output parsing, and security rules
Command Selection Rules
- When the user wants to "create/publish/write a Mowen note", use
mocli note create. This is a write operation; before executing, you must confirm that the user really wants to create a note, especially when using--publishfor automatic publishing. - When the user wants to "edit/modify/update the body of an existing Mowen note", use
mocli note edit. This is a write operation; before executing, you must confirm the target note ID, the source of the fully replaced body text, that the mandatory gate for overwrite risk has been completed, and that the user really wants to overwrite the original note body. - When the user wants to "set/change note privacy/make a note public or private/set partial public rules", use
mocli note set. This is a write operation; before executing, you must confirm the target note ID and privacy settings; currentlynote setonly supports privacy settings and is not used to modify the body, tags, or published content. - When the user wants to "view which tags a note currently has", use
mocli note tag --note-id <note-id>. This is a read operation and will not modify note tags. - When the user wants to "set/append/remove/overwrite the tags of a note", use
mocli note tag. This is a write operation; before executing, you must confirm the target note ID and the tag operation;--resetoverwrites the full set of tags and will ignore the--appendand--remove。 - When the user wants to "view a note's details/note information/quoted notes/comments" and already has the note ID, use
mocli note info --show-comment --show-refer. This is a read operation; only add--show-atomin other scenarios--show-atom。 - When the user wants to "search for notes related to a keyword", use
mocli notes search。 - When the user wants to "see someone's homepage/public notes/popular notes/paid notes/collections", use
mocli notes homepage。 - When the user wants to "see my own notes/private notes/unpublished notes/notes I have written", use
mocli notes mine。 - When the user wants to "see notes under one/some tags or filter my notes by tag", use
mocli notes tagged; only the current authenticated user's own tags are supported; when the tag name or ID is unclear, first usemo-tag'smocli tag mineto get candidates. - When the user mentions a person's name, nickname, or alias but does not provide a UID, prioritize using
mo-remarkto look up the UID; if there is no match, then considermocli user searchor ask the user to provide the UID. - When creating/editing a note body, if you need to convert a local file or remote URL into a Mowen file ID, first use
mo-misc'smocli misc uploadto getreply.file_id。 - When displaying a note list, prioritize traversing in the order of
reply.note_ids, then go toreply.notes[note_id]to get note details, and usereply.notes[note_id].uidtoreply.usersto get author information.
Body Resource Reference Processing Flow
When creating and editing notes, if the source content contains references to image, audio, or PDF resources, first confirm whether the user wants to "upload to Mowen and reference by file_id" or "keep the original URL/path text." Do not automatically upload user files or remote URLs without confirmation.
Scenarios that require confirmation
- When
<img src="...">appears in HTML, andsrcclearly points to an image file or can be determined to be an image resource. - When
<a href="...">appears in HTML, andhrefclearly points to an image, audio, or PDF file. - When a local file reference appears in Markdown, for example
、[报告](./report.pdf)、[音频](../audio.wav), and the file format is image, audio, or PDF.
Upload and conversion rules
- When the user chooses to upload, follow
mo-miscand usemocli misc uploadto obtain the upload result. For local files use--file, for remote URLs use--url; the original file name, alt text, or link text can be used as--filename。 - The upload result should at least read
reply.file_id; if present, also readreply.file_type、reply.file_name、reply.file_mime、reply.file_size、reply.file_meta。file_metais a JSON string that may contain metadata such as audioduration, imagewidth/height、PDFformat, etc.; if parsing fails, do not block the body conversion, only skip the corresponding enhancement attributes. - After a successful upload, convert the resource into a body syntax tree resource node: for images use
{ "type": "image", "attrs": { "uuid": "<file_id>", "alt": "<可选描述>" } }; for audio use{ "type": "audio", "attrs": { "audio-uuid": "<file_id>" } }; for PDF use{ "type": "pdf", "attrs": { "uuid": "<file_id>" } }。 - When generating an audio node, try to read the audio duration from
reply.file_meta.duration; if present, writeattrs.audio-duration, with the attribute value in string form, for example{ "type": "audio", "attrs": { "audio-uuid": "<file_id>", "audio-duration": "236.878367" } }。 - When generating a PDF node, try to supplement display information:
attrs.nameprefer to usereply.file_name,attrs.sizeprefer to usereply.file_sizein string form; iffile_metacontains clearer PDF metadata, it can be used as auxiliary reference, but do not override the file name explicitly specified by the user. - When the user chooses to keep the original URL, do not generate a resource node; keep the URL as ordinary link text in the paragraph, for example
text.marksinlinkmark. For local paths, remind the user that local paths are usually inaccessible to others in the Mowen body; if the user still requests to keep them, then keep them as ordinary text or link text. - If the HTML/Markdown resource type cannot be clearly determined to be image, audio, or PDF, keep it as an ordinary link by default and do not call upload.
- If there are multiple resources in the same body, first list the resource inventory and ask the user all at once which ones need to be uploaded and which should keep the original URL/path; after obtaining the decision, perform the upload and body tree conversion.
- If the user chooses to upload many files, remind the user that file uploads are subject to a quota, "default quota 20 times/day, Pro member users 200 times/day," to avoid exceeding the limit.
mocli note create [--file] [--publish] [--tags]
This command is used to create a Mowen note. Creating a note is a write operation; before executing the command, you must confirm with the user the source of the content to be created, whether to publish automatically, and the tags.
mocli note create receives the Mowen note body syntax tree; do not pass Markdown, HTML, plain text, or natural language descriptions directly to the command. Regardless of whether the user provides a file or a piece of natural language, first refer to mo-note-content - 墨问笔记正文语法树 to format it as body tree JSON, then based on content complexity and the possibility of subsequent editing, choose to pass it via --file or stdin.
Optional parameters:
--file string: Read note content from a file. Using an absolute path is recommended; the file content must be the formatted Mowen note body syntax tree JSON.--publish: Automatically publish the note after creation. Add this only when the user explicitly requests "publish/public/create and publish".--tags string: A comma-separated list of tags, with a maximum of 5 tags; for tag management after creation, refer tomocli note tag。
Content Formatting Process
- User provides a Markdown file: read the Markdown and convert it into body tree JSON. Level 1 to level 3 headings are converted to
headingnodes respectively, and writeattrs.levelas the string"1"、"2"、"3"; any heading beyond level 3 (including H4, H5, H6, H7, H8, and higher levels) does not generateheading, and is instead changed to aboldwith theparagraphmark, preserving the heading text and expressible inline styles; ordinary paragraphs are converted toparagraph, and blank lines may be converted to emptyparagraph; expressible styles such as bold, links, highlights, and inline code are converted tomarks; when encountering references to local images, audio, or PDF files, follow the "Body Resource Reference Handling Process" to confirm whether to upload and convert them into resource nodes; unsupported Markdown structures are conservatively converted into plain text paragraphs. - User provides an HTML file: parse or extract the body content and convert it into body tree JSON.
<h1>、<h2>、<h3>are converted respectively toattrs.levelas the string"1"、"2"、"3"of theheadingnode; any heading beyond level 3 (including the standard<h4>、<h5>、<h6>, as well as higher-level headings such as H7 and H8 parsed upstream) is changed to aboldwith theparagraphmark, preserving the heading text and expressible inline styles; supported inline styles and links are converted tomarks; when encountering<img>or<a href>that clearly points to an image, audio, or PDF, follow the "Body Resource Reference Handling Process" to confirm whether to upload and convert it into a resource node; for unsupported tags, extract the useful readable text within them and convert it into text nodes according to the original semantics; do not save the HTML tag source code itself into the note. - User provides a text file or directly pastes the body: split it into
paragraphandtextnodes by paragraph; blank lines may be converted to emptyparagraph。 - User provides only a natural language description: first generate the note body based on the description, then convert it into body tree JSON; if key information such as the title, tags, or whether to publish is unclear, confirm with the user first.
- Paragraph spacing between body blocks is handled as
mo-note-content - 段落间距, and by default an empty paragraph is inserted between adjacent body blocks. - The converted top level must be
{ "type": "doc", "content": [...] }. After generation, perform JSON syntax validation as much as possible before executing the creation command.
Usage Principles
- If the user only says "create a note/save to Mowen", do not add
--publishby default, to avoid accidental public disclosure. - Only when the user explicitly requests "publish the note/publish publicly/automatically publish after creation" should
--publish。 - be used. When the user provides tags, join them with English commas into
--tags, and ensure there are no more than 5. - When the source content provided by the user is not body tree JSON, first format it into body tree JSON, then follow the "Input Method Selection Rules" to decide whether to save it as a file or pass it via stdin.
- Temporary JSON files are only used for command input; do not write the API Key or other sensitive information into the body file.
- After execution, parse the top-level according to the shared rules
code、status、reason; on success, display the returned note ID or link; on failure, displayreason、msg、meta.hintsand other actionable information.
Input Method Selection Rules
- When the user provides a Markdown, HTML, or text file, and the content structure is relatively complex, such that after conversion to a body tree JSON it may require multiple calls to
mocli note createfor adjustment, it should be saved as a file and--file <path>should be used. This preserves the conversion result and avoids losing the content to be created due to context compression, session interruption, or repeated attempts. - When the content provided by the user is relatively long, and the current scenario is creation, organization, or polishing, and it is judged that polishing and modification will continue before and after creation, it should be saved as a file and
--file <path>。 - When the content provided by the user is relatively simple and short, for example, casually recording an event or a short plain-text natural language sentence, the formatted body tree JSON can be passed via stdin to avoid creating many scattered temporary files.
- If it cannot be determined whether the user values a traceable file or one-off quick creation more, briefly ask the user for their opinion.
Usage Examples
- Create a private note from a file (--file)
mocli note create --file /path/to/note-body.json - Create a private note from a file (stdin)
mocli note create < /path/to/note-body.json - Create a short-text note via stdin
printf '%s' '{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"今天随手记录一件事"}]}]}' | mocli note create - Create and automatically publish a note from a file
mocli note create --file /path/to/note-body.json --publish - Create a note with tags
mocli note create --file /path/to/note-body.json --tags "AI,产品思考" - Create a note with tags and automatically publish it
mocli note create --file /path/to/note-body.json --publish --tags "AI,产品思考"
mocli note edit [--note-id] [--file]
This command is used to edit the body of an existing Mowen note. Editing a note is a write operation. Before executing the command, you must confirm with the user the target note ID, the source of the complete replacement body, and whether they confirm overwriting the original body with the new body.
mocli note edit receives the complete new Mowen note body syntax tree, not a partial diff, nor Markdown, HTML, plain text, or a natural language description. Regardless of whether the user provides a file, pastes the body, or gives a natural language instruction such as "change a certain paragraph to a certain paragraph," it should first be organized into a complete body tree JSON, and then passed in via --file or stdin. The body tree format still refers to mo-note-content - 墨问笔记正文语法树。
Mowen notes can also be created or edited on the Web or Mini Program. These editors may produce nodes that the current CLI body syntax tree does not yet support, such as视频、多图画廊, etc.mocli note edit When submitting an overwrite via OpenAPI, unsupported nodes may be filtered by the server, causing the corresponding content in the original note to be lost.
Mandatory Gate for Overwrite Risk
- Before executing any
mocli note edit, you must first check the complete body tree to be finally submitted; if the check has not been completed, do not execute the edit command. - Supported node types include only:
doc、paragraph、heading、text、quote、note、image、audio、pdf、codeblock; supported marks types include only:highlight、link、bold、code。heading.attrs.levelonly supports the strings"1"、"2"、"3", representing H1, H2, and H3 respectively. - The check scope includes the
typeof all nodes in the body tree, as well as allmarks[].type; after obtainingnote info --show-atomfromreply.info.content.ast, this step must also be performed first. - If unsupported
typeormarks[].typeare found, such asgallery、video、h1、h2、h3, stop immediately and do not executemocli note edit. First list the unsupported node types and identifiable node information, clearly warn that "after overwrite submission, these nodes may be filtered and cause data loss," and only after the user explicitly confirms that they still want to continue the overwrite may the edit command be executed. - The risk warning must occur before the first execution of
mocli note edit; do not overwrite and submit first, then explain or apologize afterward.
Optional parameters:
--note-id string: The target note ID to edit. Required.--file string: Read the complete edited note content from a file. The file content must be the formatted Mowen note body syntax tree JSON.
Pre-edit confirmation process
- When the user has already provided a clear note ID and the complete new body, restate the target note ID and the body source, and execute only after confirming that the original note body will be overwritten.
- When the user only provides a note link, first extract the note ID from the link; if it cannot be reliably extracted, ask the user to provide the note ID.
- When the user only says "modify my latest note/modify a certain note" but does not give a note ID, first use
mocli notes mineor the context specified by the user to help locate candidate notes, then have the user confirm the specific note ID. - When the user requests a partial modification, first obtain the complete body tree JSON, then generate the new body after replacement based on the complete body tree; do not pass the partial modification fragment directly to
mocli note edit。 - Before editing, the "overwrite risk mandatory gate" must be completed; when unsupported nodes or marks are found, blocking risk confirmation must first be made to the user, and this prompt must not be left until after execution.
Content formatting process
- When the user provides an already formatted body tree JSON: first perform JSON syntax validation, and confirm that the top level is
{ "type": "doc", "content": [...] }。 - When the user provides a Markdown, HTML, or text file or pastes body text: follow
mocli note createcontent formatting process to convert it into a complete body tree JSON; Markdown/HTML resource references are likewise handled according to the "body resource reference handling process". - When the user requests a partial modification based on an existing note, and the current context does not have the original complete body tree, preferentially use
mocli note info --note-id <note-id> --show-atomto obtain the currentreply.info.content.astas the editing basis; if the complete body tree cannot be obtained, then have the user provide the original text, the exported body tree JSON, or enough content to generate a complete replacement draft. - From
reply.info.content.astor after reading the complete body tree from the user file, recursively check nodestypeandmarks[].type; the supported scope is based on the list in the "overwrite risk mandatory gate" andmo-note-content - 节点类型. - Temporary JSON files are only used for command input; do not write the API Key or other sensitive information into the body file.
Usage principles
mocli note editonly edits the body content and does not handle publish status, tags, or privacy settings; these settings must not be mixed into the body JSON.- Editing is a complete body overwrite, not an append, patch, or partial update; the user must understand this before execution.
--show-atomis only used before editing to read the current body tree of an existing note; after reading, a complete new body tree must still be generated and submitted withmocli note editas an overwrite.- When the content is complex, long, comes from a file, or may need repeated adjustment, it should be saved as a file and use
--file <path>。 - When the content is simple and short, and the user has confirmed that it can be overwritten in one go, the formatted body tree JSON may be passed in via stdin.
- After execution, parse the top level according to the shared rules
code、status、reason; on success, display the returned note ID; on failure, displayreason、msg、meta.hintsand other actionable information.
Usage examples
- Edit an existing note from a file
mocli note edit --note-id note-123 --file /path/to/note-body.json - Edit an existing note via stdin
mocli note edit --note-id note-123 < /path/to/note-body.json - Edit a short text note via a pipe
printf '%s' '{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"更新后的完整正文"}]}]}' | mocli note edit --note-id note-123
mocli note set [--note-id] [--privacy] [--disable-share] [--expire-at]
This command is used to set the privacy rules of an existing Mowen note. Setting a note is a write operation; before executing the command, you must confirm with the user the target note ID, the privacy type, and the sharing and expiration settings when the rule is public.
Currently mocli note set only carries the note privacy setting capabilities released by OpenAPI; do not use it to modify the body, tags, title, or other metadata.
Optional parameters:
--note-id string: The target note ID to set. Required.--privacy string: Privacy type. Required, supportspublic、private、rule。--disable-share: Takes effect only when--privacy rule, indicating that sharing and forwarding are prohibited. By default it is not added, meaning sharing and forwarding are allowed.--expire-at int: Takes effect only when--privacy rule, a second-level Unix timestamp. Default0means permanently visible; must be a non-negative integer.
Privacy type description
public: Fully public. Do not append--disable-shareor--expire-at; even if passed in, they will be ignored by the business layer.private: Private. Do not append--disable-shareor--expire-at; even if passed in, they will be ignored by the business layer.rule: Partially public/rule-based public. You can use--disable-shareto prohibit sharing and forwarding, and use--expire-atto set the public deadline;--expire-at 0means permanently visible.
Confirmation process before setting
- When the user has already provided a clear note ID and privacy type, restate the target note ID, privacy type, and rule items, and execute after confirmation.
- When the user only provides a note link, first extract the note ID from the link; if it cannot be reliably extracted, ask the user to provide the note ID.
- When the user only says "set my latest note to public/private/partially public" but does not give a note ID, first use
mocli notes mineor the context specified by the user to help locate the candidate note, then have the user confirm the specific note ID. - When the user requests "partially public/rule-based public" but does not state whether sharing is prohibited or the expiration time, the default is to allow sharing and be permanently visible; if the semantics may affect user expectations, briefly confirm.
Usage principles
- When the user only says "make this note public", use
--privacy public。 - When the user only says "set to private/visible only to myself", use
--privacy private。 - When the user only says "partially public/rule-based public", use
--privacy rule, and do not automatically add--disable-share,--expire-at; default 0. - When the user gives an expiration time in natural language, it should be converted to a second-level Unix timestamp and passed to
--expire-at, and the converted specific time should be restated to the user for confirmation before execution. - After execution, parse the top-level
code、status、reasonaccording to the shared rules; on success, display the returned note ID; on failure, display actionable information such asreason、msg、meta.hints.
Usage examples
- Set the note to fully public
mocli note set --note-id note-123 --privacy public - Set the note to private
mocli note set --note-id note-123 --privacy private - Set the note to partially public and allow sharing
mocli note set --note-id note-123 --privacy rule - Set the note to partially public and prohibit sharing
mocli note set --note-id note-123 --privacy rule --disable-share - Set the note to partially public and set an expiration time
mocli note set --note-id note-123 --privacy rule --expire-at 1893456000
mocli note tag [--note-id] [--reset] [--append] [--remove]
This command is used to view or manage the tags of an existing Mowen note. When only --note-idis passed and --reset、--append、--remove is not passed, it returns the note's current tag list, which is a read operation; tags are modified only when any tag operation parameter is passed, and before execution you must confirm with the user the target note ID, tag name, and operation type.
Optional parameters:
--note-id string: The target note ID whose tags are to be managed. Required.--reset string: A comma-separated list of tags covering all existing tags of the note; if the same command sets--appendor--remove, they will be ignored.--append string: A comma-separated list of tags to append to the note's existing tags; ignored when using--reset.--remove string: A comma-separated list of tags to remove from the note's existing tags; ignored when using--reset.
Tag Operation Instructions
- When only
--note-idis passed, query and return the note's current tag list without modifying tags. --resetmeans full overwrite, suitable when the user says "set/change/keep only these tags".--appendmeans incremental append, suitable when the user says "add/supplement tags to this note".--removemeans incremental removal, suitable when the user says "delete/remove a tag".--appendand--removecan be combined in the same command; when the same tag is both appended and removed, the server will handle it according to its own normalization rules, and users should be reminded as much as possible before execution to avoid this ambiguity.- Tags are joined with English commas; empty tags are ignored, and duplicate tags are deduplicated. A single
--reset、--append、--removeallows at most 20 tags each.
Confirmation Process Before Setting
- When the user has already provided a clear note ID and tag operation, restate the target note ID, operation type, and tag list, and execute after confirmation.
- When the user only provides a note link, first extract the note ID from the link; if it cannot be reliably extracted, ask the user to provide the note ID.
- When the user only says "add tags/change tags for my latest note" but does not provide a note ID, first use
mocli notes mineor the context specified by the user to help locate candidate notes, then ask the user to confirm the specific note ID. - When the user requests "select X tags from existing tags and then tag this note", first use
mo-tag'smocli tag mineto obtain the current existing tag candidates; after the user confirms the specific tags, execute this command. - When the user expresses both "overwrite tags" and "append/remove tags", prioritize the overwrite semantics and use
--reset; if the semantics are unclear, confirm with the user first.
Usage Principles
- When the user says "what tags does this note have/view this note's current tags", pass only
--note-idto query, do not add--reset、--append、--remove, and no pre-write confirmation is needed. - When the user says "change tags to A, B" or "keep only tags A, B", use
--reset "A,B"。 - When the user says "add tag A/add a tag A", use
--append "A"。 - When the user says "remove tag A/delete tag A", use
--remove "A"。 mocli note create --tagsandmocli note tagdo not conflict: the former only sets initial tags when creating a new note, while the latter is used to manage tags of existing notes.- Do not use
mocli note setto modify tags;note setis only used for privacy settings. - After execution, parse the top-level
code、status、reasonaccording to the shared rules; on success, display the target note ID and the tag list after the operation; on failure, displayreason、msg、meta.hintsand other actionable information.
Usage Examples
- View the note's current tags
mocli note tag --note-id note-123 - Overwrite all tags of the note
mocli note tag --note-id note-123 --reset "AI,产品思考" - Append tags to the note
mocli note tag --note-id note-123 --append "灵感" - Remove tags from the note
mocli note tag --note-id note-123 --remove "旧标签" - Append and remove tags at the same time
mocli note tag --note-id note-123 --append "新标签" --remove "旧标签"
Output Examples
{
"code": 0,
"status": "OK",
"reply": {
"note_id": "note-123",
"tags": [
{
"id": 11,
"name": "AI"
},
{
"id": 12,
"name": "产品思考"
}
]
}
}
reply field description
| Field | Type | Description |
|---|---|---|
note_id |
string | Target note ID. |
tags |
array | Tag list after the operation. Each tag contains id and name。 |
mocli note info [--note-id] [--show-atom] [--show-comment] [--show-refer]
This command is used to view the details of an existing Mowen note.note info is a read operation that does not modify note content, privacy, or tags; as long as the user has provided a clear note ID, it can be executed directly. Comments, citation indexes, and cited note brief information are additional display information on top of the note details, used to help the Agent provide the user with richer context.
Optional parameters:
--note-id string: The target note ID to view. Required.--show-comment: Return note comment information. By default, when callingnote info, it should be added to facilitate displaying comments, replies, and commenter context.--show-refer: Return citing and cited note information. By default, when callingnote info, it should be added to facilitate displaying related notes, citation relationships, and context notes.--show-atom: Return the complete NoteAtom JSON body; only takes effect for your own notes. Add it only when the current body tree is needed before editing a note; avoid using it in other scenarios such as viewing details, comments, or citations.
Usage principles
- By default, use
mocli note info --note-id <note-id> --show-comment --show-refer, enriching the displayed context with comments, citation indexes, and cited note brief information; this additional information is not a complete list of comment/citation details. - Only when editing an existing note and needing to obtain the current complete body tree as the editing basis, add
--show-atom. Do not add it in other scenarios such as viewing details, summaries, comments, citations, authors, or statistics--show-atom。 - When the user only provides a note link, first extract the note ID from the link; if it cannot be reliably extracted, ask the user to provide the note ID.
- After execution, parse the top-level
code、status、reasonaccording to the shared rules; on success, displayreply.info, and if comments or citations were requested, then combine withreply.comments、reply.users、reply.info.embed、reply.notesto display the context.
Usage examples
- View note
mocli note info --note-id note-123 --show-comment --show-refer - View the "so-and-so" note
mocli note info --note-id note-123 --show-comment --show-refer - Introduce note
mocli note info --note-id note-123 --show-comment --show-refer - Introduce the "so-and-so" note
mocli note info --note-id note-123 --show-comment --show-refer - Prepare the current NoteAtom before editing
mocli note info --note-id note-123 --show-atom
Output example
{
"code": 0,
"status": "OK",
"reply": {
"info": {
"note_id": "note-123",
"uid": "u-author",
"title": "一篇笔记",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/note-123?from=mocli",
"created_at": 1710000000,
"updated_at": 1710000300,
"public_at": 1710000600,
"content": {
"word_count": 128
},
"embed": {
"ref": {
"all": ["ref-1"],
"free": ["ref-1"]
},
"refed": {
"all": ["back-1"],
"free": ["back-1"]
}
}
},
"comments": {
"comment_ids": ["comment-1"],
"comments": {
"comment-1": {
"comment_id": "comment-1",
"uid": "u-commenter",
"created_at": 1710000900000,
"content_html": "评论内容"
}
}
},
"users": {
"u-author": {
"uid": "u-author",
"name": "作者"
},
"u-commenter": {
"uid": "u-commenter",
"name": "评论者"
}
},
"notes": {
"ref-1": {
"note_id": "ref-1",
"title": "被引用的笔记",
"url": "https://note.mowen.cn/detail/ref-1?from=mocli"
}
}
}
}
reply field description
| Field | Type | Description | Citation field |
|---|---|---|---|
info |
NoteInfo | Note detail body. The citation index is located in info.embed.ref/refed; when only using --show-atom , the complete body is located in info.content.ast。 |
NoteInfo - 笔记信息 |
comments |
object | Note comment collection. Returned by default when using --show-comment ; contains only the first 10 comments visible to the current identity. When displaying comments, first iterate over comments.comment_ids, then go to comments.comments[comment_id] to get details. |
This section comments 字段结构 |
users |
map[string]UserInfo | User information Map, with keys as UIDs. When displaying the author, comment authors, and replied-to users, look them up in this Map. |
UserInfo - 用户信息 |
notes |
map[string]NoteInfo | Brief information of citing and cited notes Map, with keys as note IDs.info.embed.ref/refed retains all citation indexes, but this field only includes brief information for 5 citing and 5 cited notes each. |
NoteInfo - 笔记信息 |
comments field structure
| Field | Type | Description | Citation field |
|---|---|---|---|
comment_ids |
array[string] | Ordered list of comment IDs. When displaying comments, iterate through this field first. | - |
comments |
map[string]CommentInfo | Comment details Map, keyed by comment ID. |
CommentInfo - 评论信息 |
Display suggestions
- Title:
info.title;info.urllink display follows the shared display rules. - Author: prefer
users[info.uid].name; ifusersdoes not contain the corresponding user, only displayinfo.uid, do not guess the nickname. - Introduction:
info.brief - Total word count:
info.content.word_count - Reading time: calculated based on
info.content.word_count, recommended 300–400 characters/minute. - Original link:
info.url - When displaying a note, try to make the title a link, or attach
urlnext to the title; for quoted notes, also prefer usingnotes[note_id].url。 - Creation time:
info.created_at - Publication time:
info.public_at; if empty or0, it means there is no publicly displayable publication time in the current output. - Last updated time:
info.updated_at - Count information: read count, like count, favorite count, share count, comment count refer to
NoteStat - 笔记计数; do not guess the quote count fromstat, useinfo.embed.ref/refedto calculate it. - How many notes contain quotes: use
len(info.embed.ref.all); you may combine withnotesto display brief information for 3-5 quoted notes (author, title, link), butnotesonly includes brief information for at most 5 quoted notes; do not add titles for IDs not included. - How many notes quote it: use
len(info.embed.refed.all); you may combine withnotesto display brief information for 3-5 quoting notes (author, title, link), butnotesonly includes brief information for at most 5 quoting notes; do not add titles for IDs not included. - Historical comments: take 3-10 in the order of
comments.comment_ids, then usecomments.comments[comment_id]to get details;commentsonly includes the first 10 comments visible to the current identity; do not describe them as the latest comments or all comments. - Comment author: prefer
users[comment.uid].name; if the comment is a reply, you may usecomment.reply_uidtousersto find the replied-to user. The currentCommentInfodoes not directly include the time and content of the replied-to comment; do not display fields that do not exist. - Missing field handling:
embed、comments、notes、usersmay all be empty; when displaying, simply skip the missing parts, and do not additionally use--show-atom。
mocli notes search [--keyword] [--count] [--focus]
This command is used to search notes by keyword.--keyword is a required parameter; if the user explicitly requests to search only notes from a specified user, first resolve that user's UID, then specify the UID via --focus .
Optional parameters:
--keyword string: search keyword (required).--count int: number of notes to return. Range:1-100. Default:20。--focus string: search only notes from a specified user (UID).
Usage examples
- Search Mowen for notes containing the keyword "AI Agent"
mocli notes search --keyword "AI Agent" - Search Mowen for 10 notes containing "产品思考"
mocli notes search --keyword "产品思考" --count 10 - Search Mowen for "Prompt"-related notes written by 老池 (specified UID)
mocli notes search --keyword "Prompt" --focus xxxxxxxx --count 20
Output example
{
"code": 0,
"status": "OK",
"reply": {
"note_ids": [
"3jv1AiAjXJ4aBC83LqdMC",
"ZVDGaChlin5voLpIp_9TM"
],
"notes": {
"3jv1AiAjXJ4aBC83LqdMC": {
"note_id": "3jv1AiAjXJ4aBC83LqdMC",
"uid": "Qiz5hxiY5wr5L76fyd8Kv",
"title": "最近心情",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/3jv1AiAjXJ4aBC83LqdMC?from=mocli"
},
"ZVDGaChlin5voLpIp_9TM": {
"note_id": "ZVDGaChlin5voLpIp_9TM",
"uid": "Qiz5hxiY5wr5L76fyd8Kv",
"title": "大家好呀,我是小白",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/ZVDGaChlin5voLpIp_9TM?from=mocli"
}
},
"users": {
"Qiz5hxiY5wr5L76fyd8Kv": {
"uid": "xxxxxxxxxxxxxx",
"name": "精卫鸟.",
"intro": "一只小小鸟,订阅我的没几个人,所以你们都是特殊的。。"
}
}
}
}
reply field description
| Field | Type | Description | Reference field |
|---|---|---|---|
note_ids |
array | Note ID list (ordered). When displaying the list, iterate over this field first. | - |
notes |
map[string]NoteInfo | Note information Map, where the key is the note ID and the value is the note information. |
NoteInfo - 笔记信息 |
users |
map[string]UserInfo | User information Map, where the key is the user UID and the value is the user information. When displaying the author, use notes[note_id].uid to look it up in this Map. |
UserInfo - 用户信息 |
mocli notes homepage [--uid] [--filter] [--count] [--recent]
This command is used to view the list of notes on a user's profile page, that is, publicly displayed notes; it is different from mocli notes mine, and will not return the private notes of the currently authenticated user. When the user does not provide --uid , the profile page of the currently authenticated user is viewed by default.
Optional parameters:
--uid string: the MoWen UID whose profile page notes are to be viewed. Defaults to the UID of the currently authenticated user.--filter string: filter type. Supports:all(全部笔记)、album(合集)、fee(付费笔记)、popular(热门笔记,即最多阅读). Default:all。--count int: number of notes to return. Range:1-100. Default:20。--recent string: recent time filter, currently supports days (d) and hours (h), such as:2h、1d, range:1h-15d. When--filter=popular, this parameter is ignored.
Usage examples
- See which notes I have published recently
mocli notes homepage --recent 3d - Give me 10 paid notes published by Erye
mocli notes homepage --uid xxxxxxxx --filter fee --count 10 - Give me a collection of 10 notes published by Lao Chi in the last 3 days
mocli notes homepage --uid xxxxxxxx --filter album --count 10 --recent 3d - Give me 30 of Teacher Chi's most popular notes
mocli notes homepage --uid xxxxxx --filter popular --count 30
Output example
{
"code": 0,
"status": "OK",
"reply": {
"note_ids": [
"3jv1AiAjXJ4aBC83LqdMC",
"ZVDGaChlin5voLpIp_9TM"
],
"notes": {
"3jv1AiAjXJ4aBC83LqdMC": {
"note_id": "3jv1AiAjXJ4aBC83LqdMC",
"uid": "Qiz5hxiY5wr5L76fyd8Kv",
"title": "最近心情",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/3jv1AiAjXJ4aBC83LqdMC?from=mocli"
},
"ZVDGaChlin5voLpIp_9TM": {
"note_id": "ZVDGaChlin5voLpIp_9TM",
"uid": "Qiz5hxiY5wr5L76fyd8Kv",
"title": "大家好呀,我是小白",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/ZVDGaChlin5voLpIp_9TM?from=mocli"
}
},
"users": {
"Qiz5hxiY5wr5L76fyd8Kv": {
"uid": "xxxxxxxxxxxxxx",
"name": "精卫鸟.",
"intro": "一只小小鸟,订阅我的没几个人,所以你们都是特殊的。。"
}
}
}
}
reply field description
| Field | Type | Description | Reference field |
|---|---|---|---|
note_ids |
array | Note ID list (ordered). When displaying the list, iterate over this field first. | - |
notes |
map[string]NoteInfo | Note information Map, where the key is the note ID and the value is the note information. |
NoteInfo - 笔记信息 |
users |
map[string]UserInfo | User information Map, where the key is the user UID and the value is the user information. When displaying the author, use notes[note_id].uid to look it up in this Map. |
UserInfo - 用户信息 |
mocli notes mine [--filter] [--count] [--recent]
This command is used to view the list of notes created by the currently authenticated user, and may include private, partially public, fully public, and paid notes. It is different from mocli notes homepage:mine is oriented toward the creation management perspective of the currently authenticated user,homepage is oriented toward the public display perspective of the profile page. When the user only says "my notes", use this command first; if the user explicitly says "my profile page notes/public profile page", use homepage。
Optional parameters:
--filter string: filter type. Supports:all(全部笔记)、fee(付费笔记)、pub(完全公开)、cond-pub(部分公开)、priv(私有). Default:all。--count int: number of notes to return. Range:1-100. Default:20。--recent string: recent time filter, supports days (d) and hours (h), such as:2h、1d, range:1h-15d。
Usage examples
- See the notes I wrote in the last 3 days
mocli notes mine --recent 3d - Give me 10 of my own paid notes
mocli notes mine --filter fee --count 10 - Give me 20 of my own private notes (last 3 days)
mocli notes mine --filter priv --count 20 --recent 3d
Output example
{
"code": 0,
"status": "OK",
"reply": {
"note_ids": [
"3jv1AiAjXJ4aBC83LqdMC",
"ZVDGaChlin5voLpIp_9TM"
],
"notes": {
"3jv1AiAjXJ4aBC83LqdMC": {
"note_id": "3jv1AiAjXJ4aBC83LqdMC",
"uid": "Qiz5hxiY5wr5L76fyd8Kv",
"title": "最近心情",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/3jv1AiAjXJ4aBC83LqdMC?from=mocli"
},
"ZVDGaChlin5voLpIp_9TM": {
"note_id": "ZVDGaChlin5voLpIp_9TM",
"uid": "Qiz5hxiY5wr5L76fyd8Kv",
"title": "大家好呀,我是小白",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/ZVDGaChlin5voLpIp_9TM?from=mocli"
}
},
"users": {
"Qiz5hxiY5wr5L76fyd8Kv": {
"uid": "xxxxxxxxxxxxxx",
"name": "精卫鸟.",
"intro": "一只小小鸟,订阅我的没几个人,所以你们都是特殊的。。"
}
}
}
}
reply field description
| Field | Type | Description | Reference field |
|---|---|---|---|
note_ids |
array | Note ID list (ordered). When displaying the list, iterate over this field first. | - |
notes |
map[string]NoteInfo | Note information Map, where the key is the note ID and the value is the note information. |
NoteInfo - 笔记信息 |
users |
map[string]UserInfo | User information Map, where the key is the user UID and the value is the user information. When displaying the author, use notes[note_id].uid Look it up in that Map. |
UserInfo - 用户信息 |
mocli notes tagged [--tag-id] [--tag-name] [--count]
This command is used to view the list of notes under a specified tag for the currently authenticated user, i.e., "filter my notes by tag". It only supports the currently authenticated user's own tags and does not support viewing notes under other users' tags. It is a read operation and does not modify any notes or tags.
Multiple tags (--tag-id and --tag-name passed in together also count) are combined with intersection (AND) logic: only notes that have all the specified tags are returned; the more tags specified, the narrower the results.
Optional parameters:
--tag-id string: a comma-separated list of tag IDs, up to 5; empty items and invalid IDs (non-numeric, 0, negative numbers) are ignored.--tag-name string: a comma-separated list of tag names, up to 5; tag names are resolved by the server to the currently authenticated user's tags.--count int: number of notes to return. Range:1-100. Default:20。
--tag-id and --tag-name at least one must be provided; when the two are used together, names are first resolved into tag IDs, then merged and deduplicated with explicit IDs before performing intersection filtering together.
Usage principles
- When the user provides tag names, use
--tag-namedirectly; tag name resolution depends on the currently authenticated user's existing tags, and if a name does not exist, that name will not match any notes. - When the user only provides a vague tag description, or needs to first choose from existing tags, first use
mo-tag'smocli tag mineto get the names and IDs of the currently existing tags, and after confirming, execute this command. - When the tag ID is clear (for example, from
mocli tag mineormocli note tagreturnedtags[].id), prefer--tag-idto avoid name ambiguity. - Tags are joined with English commas; empty tags are ignored, duplicate tags are deduplicated;
--tag-idand--tag-nameeach support up to 5, and excess parts are truncated. - Multiple tags have intersection semantics and only return notes that have all the specified tags at the same time; when the user wants a union result of "any tag matches", query separately by a single tag multiple times and merge the results yourself, and explain this difference to the user.
- After execution, parse the top-level
code、status、reasonaccording to the shared rules; on success, display the note list in the order ofreply.note_ids, and on failure, display executable information such asreason、msg、meta.hints. - If
reply.note_idsis empty, clearly state that no notes were returned under this tag combination, and do not fabricate notes.
Usage examples
- View notes under the "AI" tag
mocli notes tagged --tag-name "AI" - View 10 notes that have both the "AI" and "Product Thinking" tags (intersection)
mocli notes tagged --tag-name "AI,产品思考" --count 10 - View notes by tag ID
mocli notes tagged --tag-id "11,12" - Combine tag IDs and names for intersection filtering
mocli notes tagged --tag-id "11" --tag-name "产品思考"
Output example
{
"code": 0,
"status": "OK",
"reply": {
"note_ids": [
"3jv1AiAjXJ4aBC83LqdMC",
"ZVDGaChlin5voLpIp_9TM"
],
"notes": {
"3jv1AiAjXJ4aBC83LqdMC": {
"note_id": "3jv1AiAjXJ4aBC83LqdMC",
"uid": "Qiz5hxiY5wr5L76fyd8Kv",
"title": "最近心情",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/3jv1AiAjXJ4aBC83LqdMC?from=mocli"
},
"ZVDGaChlin5voLpIp_9TM": {
"note_id": "ZVDGaChlin5voLpIp_9TM",
"uid": "Qiz5hxiY5wr5L76fyd8Kv",
"title": "大家好呀,我是小白",
"brief": "笔记摘要",
"url": "https://note.mowen.cn/detail/ZVDGaChlin5voLpIp_9TM?from=mocli"
}
},
"users": {
"Qiz5hxiY5wr5L76fyd8Kv": {
"uid": "xxxxxxxxxxxxxx",
"name": "精卫鸟.",
"intro": "一只小小鸟,订阅我的没几个人,所以你们都是特殊的。。"
}
}
}
}
reply field description
| Field | Type | Description | Referenced field |
|---|---|---|---|
note_ids |
array | Note ID list (ordered). When displaying the list, iterate over this field first. | - |
notes |
map[string]NoteInfo | Note information Map, keyed by note ID, with the value being note information. |
NoteInfo - 笔记信息 |
users |
map[string]UserInfo | User information Map, keyed by user UID, with the value being user information. When displaying the author, use notes[note_id].uid to look it up in that Map. |
UserInfo - 用户信息 |
** Reference ** 公共展示规则