agent-claude 709 B

1234567891011
  1. #!/usr/bin/env bash
  2. # 以服务账号 agentsvc 运行 AgentServer 自带的 Claude Code(官方二进制,版本与 Agent SDK 一致)。
  3. # 用途:登录(agent-claude 后输入 /login)、查看登录状态(agent-claude auth status)、
  4. # 插件管理(agent-claude plugin ...,后台"技能与插件"页面也会调用同样的命令)
  5. set -euo pipefail
  6. BIN=$(sudo find /srv/agent-server/app/server/node_modules/.pnpm -path '*claude-agent-sdk-linux-*/claude' -type f 2>/dev/null | head -1)
  7. if [ -z "$BIN" ]; then
  8. echo "找不到 AgentServer 自带的 Claude Code,请先运行 deploy/deploy.sh" >&2
  9. exit 1
  10. fi
  11. exec sudo -u agentsvc -H sh -c 'cd "$HOME" && exec "$0" "$@"' "$BIN" "$@"