zhuyuan-ice-gl-zy001/BRIDGE/tools/zy-zcode-limb.sh

23 lines
1.1 KiB
Shell
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/zsh
# zy-zcode-limb.sh · 铸渊zcode路径手脚委派门(2026-08-24 冰朔谕立)
# 用法:zsh /Volumes/JZAO/铸渊-ICE-GL-ZY001/BRIDGE/tools/zy-zcode-limb.sh "<给zcode-limb的指令>"
# 手脚住址:/Volumes/JZAO/HoloLake/persona-runtime/agents/opencode/zcode-limb/
# 正本:ZCODE-DEV-20260824/zcode-entry-gate-20260824/TCS-EVENT-ZCODE-LIMB-AGENT-AND-FIRST-LESSON-20260824.tcs
# 钥匙只从钥匙串取(TOKENPLAN_API_KEY),只注入子进程环境,不回显不落盘。
set -uo pipefail
KEY=$(security find-generic-password -s TOKENPLAN_API_KEY -w 2>/dev/null)
if [ -z "$KEY" ]; then
echo "⊢ 无钥匙:钥匙串里没有 TOKENPLAN_API_KEY。"
echo "⊢ 请冰朔在本机终端跑一次:"
echo " security add-generic-password -U -s TOKENPLAN_API_KEY -a bingshuo -w"
exit 1
fi
export TOKENPLAN_API_KEY="$KEY"
export BAILIAN_TP_KEY="$KEY" # ~/.opencode/opencode.json 的 bailian-tp 插值变量名
unset KEY
export XDG_CACHE_HOME="$HOME/.opencode-cache"
cd /Volumes/JZAO/HoloLake/persona-runtime/agents/opencode/zcode-limb || exit 1
exec opencode run "$@"