Files
cindy/scripts/dev.sh
Lizi bb3f71d084 chore: Cindy 首次开源提交 / initial open-source release
Cindy 是心动网络 (X.D. Network Inc.) 的跨端 AI Agent 客户端。
本次提交包含 Desktop(Electron)、Mobile(Expo)及全部共享 packages
的完整源码,以 Apache-2.0 协议开源。

This is the first public release of Cindy, X.D. Network's cross-platform
AI agent client: the Electron desktop app, the Expo mobile app, and all
shared workspace packages, licensed under Apache-2.0.

- 许可与合规:根 LICENSE(Apache-2.0)+ NOTICE;第三方组件归属声明与
  SPDX SBOM 收口在 docs/legal/notices/,由 pnpm licenses:generate 生成。
- 社区文件:README / CONTRIBUTING / CODE_OF_CONDUCT / SECURITY / SUPPORT
  中英双语;issue / PR 模板与 CI workflow 在 .github/。
- 协议层以公开 submodule 引入:github.com/makecindy/cindy-protocol。
- 提交前已通过仓库门禁:全量 pnpm test:unit 与涉及 package 的 typecheck。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 08:30:44 +08:00

47 lines
1.1 KiB
Bash
Raw 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.

#!/usr/bin/env bash
# 一键启动 desktop + server,重复执行会先杀旧进程再重启
set -e
kill_existing() {
# 杀掉旧的 electron-forge / tsx dev 进程
taskkill //F //FI "WINDOWTITLE eq *electron-forge*" 2>/dev/null || true
taskkill //F //IM electron.exe 2>/dev/null || true
# 杀掉占用 server 端口的进程
local port="${PORT:-3333}"
local pid
pid=$(netstat -ano 2>/dev/null | grep ":${port} " | grep LISTENING | awk '{print $5}' | head -1)
if [ -n "$pid" ] && [ "$pid" != "0" ]; then
taskkill //F //PID "$pid" 2>/dev/null || true
fi
sleep 1
}
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT_DIR"
echo "==> Killing existing processes..."
kill_existing
echo "==> Starting server..."
pnpm --filter server dev &
SERVER_PID=$!
sleep 2
echo "==> Starting desktop..."
pnpm --filter desktop dev &
DESKTOP_PID=$!
echo ""
echo "==> Both running. Press Ctrl+C to stop all."
echo " Server PID: $SERVER_PID"
echo " Desktop PID: $DESKTOP_PID"
# Ctrl+C 时杀掉两个子进程
trap 'echo "==> Stopping..."; kill $SERVER_PID $DESKTOP_PID 2>/dev/null; exit 0' INT TERM
wait