feat: Implement aios core concept - start from container with claude

Implemented the 3 core requirements:
1. Auto-login as ai user (already done)
2. ai user automatically starts workspace container on login
3. Container root automatically starts claude with MCP

Flow:
aios boot → ai user auto-login → workspace starts → enter workspace as root → claude auto-starts

Changes:
- ai user .zshrc: auto-start workspace and exec into it
- root .zshrc: auto-start claude with MCP
- Moved user-continer.sh to after setup-claude.sh to include all configs
This commit is contained in:
Claude
2025-11-07 16:35:01 +00:00
parent 1ca53c489c
commit 5264e9866c
3 changed files with 35 additions and 21 deletions

View File

@@ -45,4 +45,23 @@ sleep 2
arch-chroot $ROOTFS /bin/sh -c 'pkill aigpt'
arch-chroot $ROOTFS /bin/sh -c 'if command -v sqlite3 &>/dev/null; then sqlite3 /root/.config/syui/ai/gpt/memory.db "PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL;"; fi'
# Add claude auto-start for root user (container concept)
echo "Configuring claude auto-start for root..."
cat >> $ROOTFS/root/.zshrc <<'EOF'
# MCP auto-setup (run once after .claude.json is created)
if [[ -f ~/.claude.json ]] && ! grep -q '"aigpt"' ~/.claude.json 2>/dev/null; then
if command -v claude &>/dev/null && command -v aigpt &>/dev/null; then
claude mcp add aigpt aigpt server &>/dev/null || true
fi
fi
# Auto-start claude in interactive login shell
if [[ -o login ]] && [[ -o interactive ]]; then
if command -v claude &>/dev/null; then
claude
fi
fi
EOF
echo "✓ Claude MCP setup complete"