← 返回 Skills 市场
guillaumemaka

Kilocode Model Sync

作者 Guillaume Maka · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
101
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install kilocode-model-sync
功能描述
Sync the Kilocode provider model list in openclaw.json with the live Kilo AI API. Use when: running the weekly model sync job, checking for new/removed/updat...
使用说明 (SKILL.md)

----- THIS SKILL IS DEPRECATED - DON'T RUN -----

----- KILOCODE GATEWAY IS NOW BUILT-IN IN OPENCLAW -----

Kilocode Model Sync

Workspace: ~/.openclaw/workspace-steve/ Scripts: ~/.openclaw/workspace/skills/kilocode-model-sync/scripts/ Snapshots/diffs/patches: ~/.openclaw/workspace/kilocode-models/ Telegram delivery: Use the message tool with channel=telegram, target Guillaume's chat.


Step 1 — Run the sync script

source ~/.openclaw/.env && python3 ~/.openclaw/workspace/skills/kilocode-model-sync/scripts/sync_models.py

Parse the JSON result from stdout. It contains:

Field Meaning
status "changed" | "no_change" | "error"
total_models Total models fetched from API
diff.added New models not in previous snapshot
diff.removed Models that disappeared
diff.updated Models with changed fields
snapshot_path Where today's snapshot was saved
patch_path Path to the .patch.json file (only if changed)
diff_path Path to the .diff.json file (only if changed)

Step 2 — If status == "no_change"

Write a brief memory note and stop. No notification needed.

# memory/YYYY-MM-DD.md entry:
## Kilocode Model Sync — YYYY-MM-DD
- Status: no_change
- Total models: X
- No action required.

Step 3 — If status == "changed", notify Guillaume via Telegram

Use the message tool to send to Guillaume's Telegram:

🤖 *Kilocode Model Sync — {date}*

Found changes in the Kilocode model list:
✅ Added: {N} model(s)
❌ Removed: {N} model(s)
🔄 Updated: {N} model(s)

*New models:*
{for each added: • `id` — Name (ctx: Xk tokens, cost: $Y input/$Z output per 1k)}

*Removed models:*
{for each removed: • `id` — Name}

Reply to Grog: `@steve approve` to apply, or `@steve skip` to ignore.

Format costs as $0.001/1k (multiply the raw per-token value × 1000). Use free for models with 0 cost on both input and output.


Step 4 — Wait for approval signal from Grog

Grog will relay a sessions_send message to your session containing either:

  • approve — proceed to apply
  • skip — log and stop

Step 5 — If approved, apply the patch

python3 ~/.openclaw/workspace/skills/kilocode-model-sync/scripts/apply_patch.py \x3Cpatch_path>

The script:

  1. Backs up openclaw.json with a timestamp
  2. Replaces models.providers.kilocode.models with the new list
  3. Runs openclaw gateway restart
  4. Polls openclaw gateway status until RPC probe: ok (up to 30s)

Result fields:

  • status: "ok" | "applied_restart_failed"
  • backup_path: where the backup was saved
  • gateway.ok: true/false
  • gateway.error: error message if failed

Step 6 — Write mission control entry

Append to ~/.openclaw/workspace/memory/YYYY-MM-DD.md:

## Kilocode Model Sync — YYYY-MM-DD
- **Status:** Applied ✅
- **Added:** N models — list ids
- **Removed:** N models — list ids
- **Updated:** N models — list ids
- **Backup:** backup_path
- **Gateway restart:** ok / failed (error message)
- **Approved by:** Guillaume (via Telegram)

Step 7 — Send Telegram confirmation

✅ *Kilocode Model Sync — Applied*

{N} new models added to openclaw.json.
{N} models removed.
Gateway restarted successfully. ✅

Backup saved at: {backup_path}

If gateway restart failed:

⚠️ *Kilocode Model Sync — Patch Applied, Gateway Restart Failed*

Models were written to openclaw.json but the gateway did not restart cleanly.
Error: {error}
Please restart manually: `openclaw gateway restart`

Step 8 — Report summary to Grog (sessions_send to main session)

After completion, send a concise summary to the main agent session so Grog can relay it to Guillaume if needed. Use sessions_send with label=main or sessionKey=agent:main:main.


Error handling

  • If sync_models.py exits with status "error": notify Guillaume via Telegram with the error, stop.
  • If apply_patch.py fails to write config: the script auto-restores from backup; report failure.
  • If gateway doesn't come back: report in Telegram, tell Guillaume to restart manually.
  • Always write a memory note even on failure.
安全使用建议
This skill appears to do what it says (fetch Kilocode models and update openclaw.json) but there are a few things to check before running it: - Metadata mismatch: the registry lists no required env vars, but the SKILL.md and scripts require KILOCODE_API_KEY (in ~/.openclaw/.env or env). Don't run it until you confirm the metadata or the skill's origin. - Sensitive files: the scripts read ~/.openclaw/.env and will write snapshots, diffs, patch files, and modify ~/.openclaw/openclaw.json. Inspect those files and ensure .env contains only the KILOCODE_API_KEY (or that you are comfortable exposing any other keys present) before running. - Review the generated patch before applying: sync_models.py writes a patch that will overwrite models.providers.kilocode.models. Prefer a manual review of the patch file (kilocode-models-YYYY-MM-DD.patch.json) before applying. - Gateway restart: apply_patch.py will run `openclaw gateway restart` (looks for a hardcoded nvm path then PATH). Make sure restarting the gateway is safe in your environment and that the backup created (openclaw.json.bak.TIMESTAMP) is recoverable. - Deprecated note: SKILL.md contains a big header saying the skill is deprecated and that Kilocode gateway is now built-in. That suggests this skill may be obsolete—confirm whether you actually need it. If you still want to proceed: verify the KILOCODE_API_KEY value, inspect the snapshot/diff/patch files under ~/.openclaw/workspace/kilocode-models/, and run sync_models.py manually in a non-production environment, review the produced patch, and then run apply_patch.py only after manual approval.
功能分析
Type: OpenClaw Skill Name: kilocode-model-sync Version: 1.0.0 The skill performs high-risk operations including reading sensitive environment variables from `~/.openclaw/.env`, modifying the core `openclaw.json` configuration file, and executing system commands to restart the gateway service. While these actions are aligned with the stated purpose of syncing model lists from the Kilo AI API, the broad file system access and execution privileges in `apply_patch.py` and `sync_models.py` represent a significant attack surface. Additionally, the skill contains hardcoded paths to specific Node.js versions and instructions for external data exfiltration/notification via Telegram to specific users, which is characteristic of a highly customized or internal tool with broad permissions.
能力评估
Purpose & Capability
Name/description (sync Kilocode models into openclaw.json) align with the scripts' behavior: fetch models from https://api.kilo.ai, produce snapshots/diffs/patches, write a patch that replaces models.providers.kilocode.models, and restart the OpenClaw gateway. However, the registry metadata claims no required env vars while both SKILL.md and the scripts require KILOCODE_API_KEY in ~/.openclaw/.env (or env). That metadata mismatch is unexpected and should be corrected.
Instruction Scope
SKILL.md instructions are concrete and match the included scripts: source ~/.openclaw/.env, run sync_models.py, review results, optionally run apply_patch.py which backs up and writes openclaw.json and restarts the gateway. The instructions reference using the agent's 'message' tool and sessions_send for Telegram and approval workflow—these are outside the scripts but consistent with an operator-driven sync flow. The skill does not attempt to read unrelated system paths beyond ~/.openclaw and the user workspace.
Install Mechanism
This is an instruction-only skill with included Python scripts and no install spec. Nothing is downloaded at runtime by the skill itself. The attack surface from installation is low, but running the scripts will write to disk (snapshots, patch files) under ~/.openclaw/workspace which is expected for this task.
Credentials
The runtime requires an API credential (KILOCODE_API_KEY) read from ~/.openclaw/.env or from OS env, but the registry metadata did not declare any required environment variables—this is an inconsistency. The scripts only use that token for the kilo.ai API, which is proportionate, but load_env will parse the whole ~/.openclaw/.env (which may contain other secrets). The SKILL.md explicitly instructs sourcing that file, which could expose other secrets to the process—be cautious and ensure the .env contains only intended values.
Persistence & Privilege
The skill is not always: true (not force-included) and disable-model-invocation is true (the model cannot autonomously call it), which reduces autonomous risk. The scripts do modify a configuration file (~/.openclaw/openclaw.json) and restart the gateway — that is appropriate for a config-sync skill but is a privileged operation; ensure you trust the source before allowing it to run and that backups are kept (the script creates backups).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kilocode-model-sync
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kilocode-model-sync 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
**This version officially deprecates the kilocode-model-sync skill.** - Added prominent deprecation notice: Kilocode Gateway is now built-in to OpenClaw; do not run this skill. - Documentation updated to reflect end-of-life status and recommend against use. - All previous operational steps and usage details retained for reference, but strictly marked as deprecated. - No functional or code changes; this release is a documentation and process update only.
元数据
Slug kilocode-model-sync
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Kilocode Model Sync 是什么?

Sync the Kilocode provider model list in openclaw.json with the live Kilo AI API. Use when: running the weekly model sync job, checking for new/removed/updat... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 101 次。

如何安装 Kilocode Model Sync?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kilocode-model-sync」即可一键安装,无需额外配置。

Kilocode Model Sync 是免费的吗?

是的,Kilocode Model Sync 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Kilocode Model Sync 支持哪些平台?

Kilocode Model Sync 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Kilocode Model Sync?

由 Guillaume Maka(@guillaumemaka)开发并维护,当前版本 v1.0.0。

💬 留言讨论