mo-shared

Original🇨🇳 Chinese
Translated

Mowen CLI Shared Rules: Application configuration initialization, Mowen API Key configuration and management, basic parsing of Mowen CLI responses, and Mowen CLI security rules. Triggered when users use Mowen CLI.

2installs
Added on

NPX Install

npx skill4agent add mowenxd/cli mo-shared

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

mocli - Mowen CLI Shared Rules

This skill is a prerequisite skill for the Mowen CLI skill library, guiding you on how to complete configuration initialization, API Key configuration, interaction response parsing with
mocli
, display rules, and security rules through
mocli
.

Prerequisite References

  • How to Obtain Mowen API Key
  • mocli Output Protocol
  • mocli Common Output Fields

General Execution Flow

  1. First determine the specific
    mocli
    subcommand corresponding to the user's intent; do not use search commands instead of more precise list commands.
  2. If the command requires a UID and the user provides a name, nickname, or alias, prioritize using
    mo-remark
    to find the UID; if not found, use user search or ask the user to supplement the UID.
  3. After executing
    mocli
    , first read the top-level
    code
    ,
    status
    , and
    reason
    ; only parse
    reply
    after confirming success.
  4. When displaying list results, prioritize using ordered ID lists in the reply (such as
    note_ids
    ,
    uids
    ,
    events
    ); then retrieve details from the corresponding Map (such as
    notes
    ,
    users
    ) to avoid order errors caused by directly traversing the Map.

Configuration Initialization

For first-time use, users need to provide a Mowen API Key and use
mocli auth init --apik <api-key>
to complete initialization.

API Key Configuration and Management

  • During use, if
    mocli
    returns an
    AUTH
    error (the user may have reset the API Key on the Mowen platform or lost local configuration), remind the user to re-provide the API Key and use
    mocli auth init --apik <api-key> [--force]
    to re-initialize or replace (
    --force
    ) the API Key.
  • You can use
    mocli auth info [--profile]
    to view current configuration information; use
    --profile
    to additionally obtain the Profile information of the account corresponding to the current API Key on the Mowen platform.

Response Parsing Rules

  • code=0
    and
    status=OK
    indicate success; business data is usually in
    reply
    .
  • meta.alerts
    represents important prompts, which may appear on success or failure; prioritize attention and determine the display position based on the prompt type. For example, CLI new version reminders are usually attached after business results.
  • status=FAIL
    or
    code!=0
    indicates failure; prioritize displaying
    reason
    ,
    msg
    , and executable suggestions in
    meta.hints
    .
  • reason=AUTH
    : Remind the user to re-provide the API Key and use
    mocli auth init --apik <api-key> --force
    to update the configuration; do not output the old API Key.
  • reason=VALIDATE
    : Indicates invalid parameters, and provide optional corrections based on the parameter range of the current skill.
  • reason=NETWORK
    : Indicates network or proxy failure; if executed in a restricted environment, prompt that network/proxy permissions are required.
  • reason=API
    and
    api_error.trace_id
    exists: Display the
    trace_id
    to facilitate problem feedback, but do not disclose authentication information.
  • If an empty list or empty Map is returned, clearly state "No data matching the criteria found" and do not fabricate results.

Response Display Rules

<a id="reply-display-rules"></a>
General Rule: Based on the user's requirements and the amount of data entries, display the content as clearly, explicitly, and beautifully formatted as possible
Detailed Rules:
  • Avoid dull data; appropriately add emojis to increase data interest
  • Format timestamps into readable time
  • Display Bool values with emojis as much as possible
  • If there is little data, display information in detail
  • If there is a lot of data, use forms/lists and other formats to display it as clearly, explicitly, and beautifully formatted as possible. For table field selection:
    • First, select fields that the user cares about according to their requirements
    • If the user does not specify fields, display fields that most data entries have to maximize display space while avoiding columns with only a small amount of data
  • If the above detailed rules are inconsistent with the user's requirements, the user's requirements take precedence
Note List Display Suggestions:
  • When there is little data, display core information item by item: time, author, note title, abstract. If the user focuses on a certain field (such as reading count, paid status, public status), supplement that field first.
  • When there is a lot of data, first give a brief overview (quantity, time range, main authors or topics), then list several of the most relevant or latest key notes; do not only summarize and omit specific entries.
  • Prioritize using
    note.title
    for note titles; if the title itself does not contain 「」 or 『』, wrap it with 『』; prioritize using
    users[note.uid].name
    for authors; prioritize using
    note.brief
    for abstracts.
  • Do not fabricate content when fields are missing. You can omit missing fields or use clear placeholders such as "Untitled", "Unknown Author", "No Abstract".

Update Reminders

When
mocli
detects that a new version of the CLI is available, it will return an update reminder via
meta.alerts
. This reminder is important information and should be clearly and explicitly displayed to the user while avoiding repeated displays that cause annoyance.
When displaying update reminders:
  • Retain key information such as current version, latest version, build time, and update command.
  • You can use a prominent emoji + short text to indicate that this is a CLI update reminder, but do not rewrite or omit the specific update command.
  • If the same update reminder has been clearly and explicitly displayed in the current session (judged by current version + build time, latest version + build time first), you can continue to remind in subsequent responses, but weaken it to a short footnote that does not occupy the main content area.
  • Do not automatically execute the update command unless the user explicitly requests an update.
  • If there are both business data and update reminders in the response, display the user's requested business results first, then attach the update reminder.

Security Rules

  • Prohibited from outputting keys (user_key, api_key) in plain text to the terminal.
  • Must confirm user intent before performing write/delete operations.