-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathclaude-code.ps1
More file actions
116 lines (104 loc) · 3.84 KB
/
Copy pathclaude-code.ps1
File metadata and controls
116 lines (104 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Artemis Claude Code Launcher + Task Board
# ============================================
# Launches Claude Code with Artemis AI Girlfriend integration.
# Also starts the Task Board API (port 19280) if not running.
#
# Prerequisites:
# 1. Install Claude Code: npm install -g @anthropic-ai/claude-code
# 2. Start Shiki Daemon first: .\shiki.cmd
#
# Usage:
# .\claude-code.ps1 — Launch Claude Code (task loop mode)
# .\claude-code.ps1 "draw me Natsume" — Launch with initial prompt
# .\claude-code.ps1 -BoardOnly — Start task Board only (no Claude)
# .\claude-code.ps1 -KillBoard — Stop task Board API
param(
[string]$Prompt = "",
[switch]$BoardOnly = $false,
[switch]$KillBoard = $false
)
$ErrorActionPreference = "Stop"
$BoardPort = 19280
function Start-TaskBoard {
$existing = Get-NetTCPConnection -LocalPort $BoardPort -ErrorAction SilentlyContinue
if ($existing) {
Write-Host " ✅ Task Board already running on :$BoardPort" -ForegroundColor Green
Write-Host " Open: http://127.0.0.1:$BoardPort" -ForegroundColor Cyan
return
}
Write-Host " 🚀 Starting Task Board API on :$BoardPort..." -ForegroundColor Magenta
$apiScript = Join-Path $PSScriptRoot ".claude\task_board_api.py"
Start-Process python -ArgumentList $apiScript -WindowStyle Hidden
Start-Sleep -Seconds 1
Write-Host " ✅ Task Board: http://127.0.0.1:$BoardPort" -ForegroundColor Green
}
function Stop-TaskBoard {
$procs = Get-WmiObject Win32_Process -Filter "CommandLine LIKE '%task_board_api.py%'" -ErrorAction SilentlyContinue
if ($procs) {
foreach ($p in $procs) { Stop-Process -Id $p.ProcessId -Force -ErrorAction SilentlyContinue }
Write-Host " 🛑 Task Board stopped" -ForegroundColor Yellow
} else {
Write-Host " ⚪ Task Board not running" -ForegroundColor DarkGray
}
}
Write-Host "🌸 Artemis × Claude Code" -ForegroundColor Magenta
Write-Host "=========================" -ForegroundColor DarkGray
Write-Host ""
if ($KillBoard) {
Stop-TaskBoard
exit 0
}
if ($BoardOnly) {
Start-TaskBoard
# Open browser
Start-Process "http://127.0.0.1:$BoardPort"
exit 0
}
# Verify Claude Code
$claudeCmd = Get-Command claude -ErrorAction SilentlyContinue
if (-not $claudeCmd) {
Write-Host "❌ Claude Code not found!" -ForegroundColor Red
Write-Host " Install: npm install -g @anthropic-ai/claude-code" -ForegroundColor Yellow
exit 1
}
Write-Host "✅ Claude Code found: $($claudeCmd.Source)" -ForegroundColor Green
# Check services
$ports = @{
"llama" = 8080
"live2d" = 19200
"artemis_bridge" = 19250
"webchat" = 19270
}
Write-Host ""
Write-Host "📡 Service Status:" -ForegroundColor Cyan
foreach ($name in $ports.Keys) {
$port = $ports[$name]
try {
$c = New-Object System.Net.Sockets.TcpClient("127.0.0.1", $port)
$c.Close()
Write-Host " ✅ $name (:$port)" -ForegroundColor Green
} catch {
Write-Host " ⚠️ $name (:$port) — OFFLINE" -ForegroundColor Yellow
}
}
# Start Task Board
Write-Host ""
Start-TaskBoard
Write-Host ""
Write-Host "📂 Project: D:\AI_Girlfriend" -ForegroundColor Cyan
Write-Host "🧩 MCP tools: 14 total (8 Artemis + 6 Task Queue)" -ForegroundColor DarkGray
Write-Host "🔄 Task loop: getNextTask → ongoing → execute → reply → completed" -ForegroundColor DarkGray
Write-Host ""
# Launch Claude Code
Push-Location D:\AI_Girlfriend
try {
if ($Prompt) {
Write-Host "🚀 Launching Claude Code with prompt..." -ForegroundColor Magenta
claude --dangerously-load-development-channels server:artemis -p $Prompt
} else {
Write-Host "🚀 Launching Claude Code (task loop mode)..." -ForegroundColor Magenta
claude --dangerously-load-development-channels server:artemis
}
} finally {
Pop-Location
}