omm-push

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

omm-push — Cloud Push Workflow

omm-push — 云端推送工作流

Purpose

用途

Automate the full workflow of pushing .omm/ architecture docs to the oh-my-mermaid cloud service.
自动完成将.omm/架构文档推送至oh-my-mermaid云端服务的完整工作流。

Prerequisites

前提条件

Ensure the
omm
CLI is available:
bash
command -v omm || npm install -g oh-my-mermaid
If the install command fails (permission denied), tell the user: "Please run
npm install -g oh-my-mermaid
in your terminal, then try again."
确保
omm
CLI工具可用:
bash
command -v omm || npm install -g oh-my-mermaid
如果安装命令失败(权限不足),请告知用户: "请在终端中运行
npm install -g oh-my-mermaid
,然后重试。"

Workflow

工作流

Step 1: Check Login Status

步骤1:检查登录状态

Run
omm share
via Bash. If it errors with "not logged in":
  • Tell the user: "You need to log in first."
  • Run
    omm login
    — this opens a browser for GitHub OAuth
  • Wait for the user to complete login
通过Bash运行
omm share
。若报错提示“not logged in”:
  • 告知用户:“您需要先登录。”
  • 运行
    omm login
    ——此操作会打开浏览器进行GitHub OAuth授权
  • 等待用户完成登录

Step 2: Check Project Link

步骤2:检查项目关联状态

Run
omm share
via Bash. If it errors with "no project slug":
  • Run
    omm link
    — this sets the cloud project slug from the directory name
  • Confirm: "Linked to {slug}"
通过Bash运行
omm share
。若报错提示“no project slug”:
  • 运行
    omm link
    ——此操作会根据目录名称设置云端项目slug
  • 确认提示:“已关联至{slug}”

Step 3: Push

步骤3:推送

Run
omm push
via Bash.
Handle errors:
  • 401 Unauthorized: "Login expired. Run
    omm login
    again."
  • 403 Free plan limit: "Free plan allows 1 project. Upgrade at https://ohmymermaid.com/pricing"
  • Network error: "Cannot reach server. Check your connection."
通过Bash运行
omm push
处理错误:
  • 401 未授权:“登录已过期,请重新运行
    omm login
    。”
  • 403 免费版限制:“免费版仅允许1个项目。请访问https://ohmymermaid.com/pricing升级。”
  • 网络错误:“无法连接服务器,请检查您的网络连接。”

Step 4: Report

步骤4:结果报告

On success, output:
  • Number of files uploaded
  • View URL:
    https://ohmymermaid.com/p/{slug}
  • Share URL (if Pro): "Run
    omm share
    to get the shareable link"
成功时输出:
  • 已上传文件数量
  • 查看链接:
    https://ohmymermaid.com/p/{slug}
  • 分享链接(专业版用户):“运行
    omm share
    获取可分享链接”

Rules

规则

  • Always check login before pushing
  • Always check link before pushing
  • Do NOT skip steps — each depends on the previous
  • If any step fails, stop and report the error with guidance
  • 推送前务必检查登录状态
  • 推送前务必检查项目关联状态
  • 不得跳过步骤——每个步骤都依赖前一步骤
  • 若任何步骤失败,请停止操作并附带指引报告错误