refactor: Simplify startup - user manages containers and MCP

Changes:
- Delete cfg/setup-claude.sh (MCP setup now manual)
- Remove restore container creation (user manages backups)
- Remove workspace auto-entry from .zshrc
- Remove MCP auto-registration
- Change ai user .zshrc to run claude once on login (not exec)
- User now manually starts containers and registers MCP as needed

New flow:
1. ai user auto-login
2. claude starts once (not exec, returns to shell after exit)
3. User manually starts workspace container if needed
4. User manually registers MCP servers
This commit is contained in:
Claude
2025-11-08 13:04:28 +00:00
parent 2162463382
commit 5d7f06282e
4 changed files with 8 additions and 85 deletions

View File

@@ -61,29 +61,13 @@ cp -rf ./cfg/zshrc $ROOTFS/root/.zshrc
# Copy .zshrc for user 'ai'
cp -rf ./cfg/zshrc $ROOTFS/home/ai/.zshrc
# Add workspace container auto-start and entry (shared .zshrc for ai user and workspace root)
# Add claude auto-start on login (once, not exec)
cat >> $ROOTFS/home/ai/.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
# aios concept: container from start (ai user and workspace root share this .zshrc)
# Start claude on login (once)
if [[ -o login ]] && [[ -o interactive ]]; then
if [[ -z "$INSIDE_WORKSPACE" ]]; then
# Running as ai user on aios OS - enter workspace container
export INSIDE_WORKSPACE=1
sudo machinectl start workspace 2>/dev/null || true
sleep 1
exec sudo machinectl shell workspace
else
# Running as root inside workspace container - start claude
if command -v claude &>/dev/null; then
claude
fi
if command -v claude &>/dev/null; then
claude
fi
fi
EOF