feat: Implement user-dir sharing between ai user and workspace root
Perfect solution for aios concept: - workspace.nspawn: Bind=/home/ai:/root - ai user and workspace root share the SAME home directory - Same .zshrc, .claude.json, .config, all data/settings/history - INSIDE_WORKSPACE env var prevents infinite loop - Flow: ai login → enter workspace → claude starts - All configuration and memory perfectly shared
This commit is contained in:
@@ -45,23 +45,6 @@ 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
|
||||
# Note: claude auto-start is configured in ai user's .zshrc (shared with workspace root via bind mount)
|
||||
|
||||
echo "✓ Claude MCP setup complete"
|
||||
|
||||
Reference in New Issue
Block a user