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

@@ -46,21 +46,16 @@ cp -rf ./cfg/zshrc $ROOTFS/root/.zshrc
# Copy .zshrc for user 'ai'
cp -rf ./cfg/zshrc $ROOTFS/home/ai/.zshrc
# Add MCP auto-setup and claude auto-start for ai user (login shell only)
# Add auto container login for ai user
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
# Auto-start claude in interactive login shell
# Auto-start workspace container and login (aios concept: start from container)
if [[ -o login ]] && [[ -o interactive ]]; then
if command -v claude &>/dev/null; then
claude
fi
# Start workspace container
sudo machinectl start workspace 2>/dev/null || true
sleep 2
# Enter workspace container as root
exec sudo machinectl shell workspace
fi
EOF