ctx-cloud-status

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Context Mode Cloud Status

Context Mode Cloud 状态

Display the current cloud sync configuration, connection health, and event statistics.
显示当前云同步配置、连接健康状况以及事件统计信息。

Instructions

操作说明

  1. Read sync config using Bash:
    cat ~/.context-mode/sync.json 2>/dev/null || echo "NOT_CONFIGURED"
  2. If not configured (file missing or empty), display:
    ## context-mode cloud status
    - [ ] Cloud sync: NOT CONFIGURED
    
    Run `/ctx-cloud-setup` to connect to Context Mode Cloud.
    Stop here.
  3. If configured, extract the config values. Never display the full API token — mask it as
    ctx_****<last4>
    .
  4. Run health check using Bash:
    bash
    curl -sf -o /dev/null -w "%{http_code}" \
      -H "Authorization: Bearer <API_TOKEN>" \
      "<API_URL>/api/health"
  5. Check sync stats — read the stats file if it exists:
    cat ~/.context-mode/sync-stats.json 2>/dev/null || echo "NO_STATS"
    This file may contain:
    events_sent
    ,
    last_sync_at
    ,
    errors_count
    ,
    last_error
    .
  6. Display results as markdown directly in the conversation:
    ## context-mode cloud status
    
    ### Connection
    - [x] Cloud sync: ENABLED
    - [x] API URL: https://api.context-mode.com
    - [x] API Token: ctx_****abcd
    - [x] Organization: org_abc123
    - [x] Health check: PASS (200 OK)
    
    ### Sync Settings
    - Batch size: 50
    - Flush interval: 30s
    
    ### Statistics
    - Events sent: 1,247
    - Last sync: 2 minutes ago
    - Errors: 0
    Use
    [x]
    for healthy items,
    [ ]
    for issues,
    [-]
    for warnings.
    Variations:
    • If
      enabled
      is
      false
      :
      - [-] Cloud sync: DISABLED (config exists but sync is turned off)
    • If health check fails:
      - [ ] Health check: FAIL (<http_code> or connection error)
    • If no stats file exists:
      ### Statistics
      - No sync data yet. Events will appear after the next Claude Code session.
    • If there are recent errors:
      - [-] Errors: 3 (last: "Sync failed: 401 Unauthorized")
  7. Actionable guidance — after the status display, add context-specific advice:
    • If everything is healthy: "Cloud sync is working normally."
    • If health check fails: "Run
      /ctx-cloud-setup
      to reconfigure your connection."
    • If sync is disabled: "To re-enable, set
      enabled: true
      in
      ~/.context-mode/sync.json
      ."
    • If errors are present: "Check your API token validity in the dashboard: Settings > API Tokens."
  1. 使用Bash读取同步配置
    cat ~/.context-mode/sync.json 2>/dev/null || echo "NOT_CONFIGURED"
  2. 若未配置(文件缺失或为空),显示:
    ## context-mode cloud status
    - [ ] Cloud sync: NOT CONFIGURED
    
    Run `/ctx-cloud-setup` to connect to Context Mode Cloud.
    在此步骤停止。
  3. 若已配置,提取配置值。绝对不要显示完整的API token——将其掩码为
    ctx_****<last4>
  4. 使用Bash运行健康检查
    bash
    curl -sf -o /dev/null -w "%{http_code}" \
      -H "Authorization: Bearer <API_TOKEN>" \
      "<API_URL>/api/health"
  5. 检查同步统计信息——若统计文件存在则读取:
    cat ~/.context-mode/sync-stats.json 2>/dev/null || echo "NO_STATS"
    该文件可能包含:
    events_sent
    last_sync_at
    errors_count
    last_error
  6. 直接在对话中以markdown格式显示结果
    ## context-mode cloud status
    
    ### Connection
    - [x] Cloud sync: ENABLED
    - [x] API URL: https://api.context-mode.com
    - [x] API Token: ctx_****abcd
    - [x] Organization: org_abc123
    - [x] Health check: PASS (200 OK)
    
    ### Sync Settings
    - Batch size: 50
    - Flush interval: 30s
    
    ### Statistics
    - Events sent: 1,247
    - Last sync: 2 minutes ago
    - Errors: 0
    健康项使用
    [x]
    ,问题项使用
    [ ]
    ,警告项使用
    [-]
    变体情况:
    • enabled
      false
      - [-] Cloud sync: DISABLED (config exists but sync is turned off)
    • 若健康检查失败:
      - [ ] Health check: FAIL (<http_code> or connection error)
    • 若统计文件不存在:
      ### Statistics
      - No sync data yet. Events will appear after the next Claude Code session.
    • 若存在近期错误:
      - [-] Errors: 3 (last: "Sync failed: 401 Unauthorized")
  7. 可操作指导——显示状态后,添加特定场景的建议:
    • 若一切正常:“云同步运行正常。”
    • 若健康检查失败:“运行
      /ctx-cloud-setup
      重新配置连接。”
    • 若同步已禁用:“如需重新启用,请在
      ~/.context-mode/sync.json
      中设置
      enabled: true
      。”
    • 若存在错误:“请在控制台检查您的API token有效性:Settings > API Tokens。”