activitysmith

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ActivitySmith

ActivitySmith

Use this skill to send push notifications and drive Live Activity lifecycle commands.
使用此skill发送推送通知并执行Live Activity生命周期命令。

Workflow

工作流程

  1. Ensure
    activitysmith-cli
    is installed and
    activitysmith
    is in
    PATH
    .
  2. Ensure
    ACTIVITYSMITH_API_KEY
    is set, or create
    skills/activitysmith/.env
    from
    .env.example
    .
  3. Run one of the scripts in
    scripts/
    .
  4. For Live Activities, save the
    Activity ID
    from
    start_activity.sh
    and pass it to
    update_activity.sh
    and
    end_activity.sh
    .
  1. 确保已安装
    activitysmith-cli
    ,且
    activitysmith
    已添加至
    PATH
    环境变量中。
  2. 确保已设置
    ACTIVITYSMITH_API_KEY
    ,或从
    .env.example
    创建
    skills/activitysmith/.env
    文件。
  3. 运行
    scripts/
    目录下的任一脚本。
  4. 对于Live Activities,保存
    start_activity.sh
    返回的
    Activity ID
    ,并将其传入
    update_activity.sh
    end_activity.sh
    中。

Auth

身份验证

ACTIVITYSMITH_API_KEY
is required.
Scripts load auth in this order:
  1. Existing shell environment
  2. skills/activitysmith/.env
ACTIVITYSMITH_API_KEY
是必填项。
脚本按以下顺序加载身份验证信息:
  1. 现有Shell环境变量
  2. skills/activitysmith/.env
    文件

Scripts

脚本说明

  • scripts/send_push.sh
    : Send a push notification.
  • scripts/start_activity.sh
    : Start a Live Activity and return an activity ID.
  • scripts/update_activity.sh
    : Update an existing Live Activity.
  • scripts/end_activity.sh
    : End an existing Live Activity.
  • scripts/send_push.sh
    :发送推送通知。
  • scripts/start_activity.sh
    :启动一个Live Activity并返回活动ID。
  • scripts/update_activity.sh
    :更新现有Live Activity。
  • scripts/end_activity.sh
    :结束现有Live Activity。

Quick Commands

快速命令

bash
./skills/activitysmith/scripts/send_push.sh -m "Build finished" -t "CI"
bash
./skills/activitysmith/scripts/start_activity.sh \
  --title "Deploy" \
  --type "segmented_progress" \
  --steps 4 \
  --current 1
bash
./skills/activitysmith/scripts/update_activity.sh \
  --activity-id "<activity_id>" \
  --title "Deploy" \
  --current 2
bash
./skills/activitysmith/scripts/end_activity.sh \
  --activity-id "<activity_id>" \
  --title "Deploy" \
  --current 4 \
  --auto-dismiss 2
bash
./skills/activitysmith/scripts/send_push.sh -m "Build finished" -t "CI"
bash
./skills/activitysmith/scripts/start_activity.sh \
  --title "Deploy" \
  --type "segmented_progress" \
  --steps 4 \
  --current 1
bash
./skills/activitysmith/scripts/update_activity.sh \
  --activity-id "<activity_id>" \
  --title "Deploy" \
  --current 2
bash
./skills/activitysmith/scripts/end_activity.sh \
  --activity-id "<activity_id>" \
  --title "Deploy" \
  --current 4 \
  --auto-dismiss 2