Commit Graph

69 Commits

Author SHA1 Message Date
Claude
b41052b9a8 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
2025-11-07 16:45:12 +00:00
Claude
100471646e fix: Share claude config/memory between ai user and container
ai user now uses workspace container's claude via wrapper function.
This ensures ai user and container root share the same:
- claude configuration
- MCP settings
- conversation history/memory

Flow:
1. ai user login → workspace starts
2. ai user runs 'claude' → calls workspace container's claude
3. Container root runs 'claude' → same claude instance
4. Configuration and memory are shared
2025-11-07 16:40:54 +00:00
Claude
5264e9866c 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
2025-11-07 16:35:01 +00:00
Claude
1ca53c489c fix: Create child containers before user setup
Moved user-continer.sh execution before setup-user.sh.
Child containers are created by root for root to use, not for ai user.
2025-11-07 15:32:45 +00:00
Claude
d1c3ab94cb refactor: Remove unnecessary backup step in container creation
Simplified user-continer.sh by removing temp backup.
Directly copy aios to workspace and restore-img.
2025-11-07 15:30:17 +00:00
Claude
fd25a50395 refactor: Simplify child container creation by copying aios itself
Changed from building new containers to simply copying the aios base:
- Backup current aios to /tmp
- Copy backup as workspace
- Copy backup as restore-img
- Much faster and simpler than pacstrap
- Child containers have same config as parent aios
2025-11-07 15:25:01 +00:00
Claude
642ccb28a6 refactor: Create child containers during build as root, not at ai user login
- Renamed init-containers.sh to user-continer.sh
- Moved container creation from ai user first login to build.zsh
- Removed initialization check from ai user .zshrc
- Child containers (workspace, restore-img) now pre-created by root
- ai user simply uses pre-existing containers
2025-11-07 15:21:14 +00:00
Claude
e2b0d7a51d refactor: Simplify install.sh and rename arch to aios throughout
- Simplified install.sh to just extract and mv
- Renamed root.x86_64/var/lib/machines/arch to aios
- Updated all references in build.zsh, setup-user.sh, setup-claude.sh
2025-11-07 15:00:01 +00:00
Claude
1aab33cb04 feat: Add automatic workspace container initialization on first login
- Created init-containers.sh to create workspace and restore-img
- Runs automatically on ai user's first login
- Uses ~/.aios-initialized flag to run once
- Updated sudoers to allow pacstrap, arch-chroot commands
2025-11-07 14:54:51 +00:00
Claude
cdf38812fc fix: Add securetty config and enable systemd-machined for container operations
- Added pts/0-9 to /etc/securetty for systemd-nspawn login
- Enabled systemd-machined for ai user to use machinectl
- Added arch-install-scripts package for pacstrap support inside aios
2025-11-07 14:50:03 +00:00
Claude
abdb399552 fix: Remove unused BACKUP variable from install.sh 2025-11-07 14:44:43 +00:00
Claude
49da9ec86a fix: Don't pre-create child containers - let ai user create them as needed
Changed to only prepare /var/lib/machines/ directory inside aios.
ai user will create child containers (workspace, restore-img, etc.) using machinectl as needed.
2025-11-07 14:41:36 +00:00
Claude
e88b241519 fix: Restructure containers - aios contains child containers internally
Changed from 3 separate containers to 1 container with child containers inside:
- /var/lib/machines/aios/ (main container)
  - /var/lib/machines/restore-img/ (child container)
  - /var/lib/machines/workspace/ (child container)

ai user operates child containers from within aios using machinectl.
2025-11-07 14:40:46 +00:00
Claude
a35a6bc870 feat: Auto-register aigpt MCP server on first login
Add automatic MCP registration in .zshrc that runs after .claude.json is created.
On second login, aigpt server will be automatically registered to Claude Code.
2025-11-07 14:28:58 +00:00
Claude
a447cb98f0 fix: Skip bootstrap_packages validation when not specified in mkarchiso 2025-11-07 13:26:59 +00:00
Claude
a833a60bac fix: Remove set -e from build.zsh to prevent early exit on errors 2025-11-07 13:25:43 +00:00
Claude
7b889fd5a2 revert: Remove bootstrap_packages configuration (not needed with custom mkarchiso) 2025-11-07 13:22:51 +00:00
Claude
87738e1e0b fix: Add bootstrap_packages.x86_64 configuration for mkarchiso 2025-11-07 13:19:33 +00:00
Claude
19337566a9 fix: Handle missing tarball in cleanup gracefully 2025-11-07 13:16:48 +00:00
Claude
fb31108cf7 feat: Add cleanup step to build.zsh before building 2025-11-07 13:15:36 +00:00
Claude
355c3dceb4 fix: Remove exec from claude auto-start to allow manual shell usage
Allow users to exit claude and continue using shell manually.
When claude exits, user returns to zsh instead of logging out.
2025-11-07 13:05:26 +00:00
Claude
511cf960d6 feat: Pre-create containers in build.zsh
Changed container creation from install-time to build-time:

Before:
- build.zsh: create only aios
- install.sh: machinectl clone aios → aiosback, workspace

After:
- build.zsh: create aios + aiosback + workspace (cp -a)
- install.sh: just extract and move to /var/lib/machines/

Benefits:
- Simpler install.sh (no machinectl clone operations)
- Faster installation (no clone overhead)
- All containers included in tarball
- Consistent initial state
2025-11-07 12:53:12 +00:00
Claude
506b93b5f4 refactor: Move core aios packages to build.zsh
Moved essential aios components to build.zsh (base layer):
- sudoers configuration (wheel group permissions)
- aigpt install (aios core package)
- aibot install (aios core package) - renamed from 'ai' to 'aibot'

Updated module responsibilities:
- build.zsh: Arch base + aios core packages (required)
- setup-user.sh: User customization only
- setup-claude.sh: Claude MCP configuration only

Benefits:
- Clear separation: base vs customization
- aigpt/aibot always included (core aios functionality)
- Modules can be optionally skipped for customization
2025-11-07 12:35:19 +00:00
Claude
d65b1242fe refactor: Modularize build.zsh into separate setup scripts
Separated build.zsh into 3 clear parts:

1. build.zsh (Arch Linux base construction)
   - archiso bootstrap
   - pacstrap base system
   - install base packages
   - install Claude Code

2. cfg/setup-user.sh (User setup)
   - Create ai user
   - Configure sudoers
   - Setup auto-login
   - Configure zshrc and auto-start

3. cfg/setup-claude.sh (Claude/aigpt setup)
   - Install aigpt
   - Configure MCP
   - Setup symlinks
   - Initialize database

Benefits:
- Each file has a single, clear responsibility
- Easier to maintain and modify
- Can skip/customize setup steps if needed
- GitHub Actions simplified to just run build.zsh
2025-11-07 12:25:51 +00:00
Claude
7abf48a8fd feat: Add auto-start claude for ai user in login shell
- Add claude auto-start to ai user's .zshrc
- Only triggers in interactive login shell
- Uses exec to replace shell process with claude
- Enables seamless AI-first experience

Usage: machinectl shell workspace /bin/su - ai
→ Auto-login + Auto-start claude
2025-11-07 12:17:19 +00:00
Claude
4caa0bbbc6 fix: Improve force removal of existing images in install.sh
- Increase sleep time to 2 seconds
- Add SIGKILL as last resort
- Continue with warning if removal fails
2025-11-07 11:47:12 +00:00
Claude
5f4384d812 feat: Remove existing images before cloning in install.sh
- Check if aiosback and workspace already exist
- Stop, terminate, and remove existing images before clone
- Prevents 'File exists' error on re-installation
2025-11-07 11:29:55 +00:00
Claude
74f6eea1a3 fix: Uncomment install.sh in .gitignore 2025-11-07 11:27:35 +00:00
Claude
ea207bedd5 Merge remote-tracking branch 'origin/main' into claude/aios-initial-direction-011CUrcij89bjpsbc7k8wQeo 2025-11-07 11:26:27 +00:00
Claude
4cbc1562f5 chore: Remove outdated aios-install.sh 2025-11-07 11:25:35 +00:00
97be1cd8c4 rm aios-install.sh
Some checks failed
build and push image / Release (push) Failing after 1m16s
2025-11-07 20:24:54 +09:00
syui
514930c2e3 Merge pull request #1 from syui/claude/aios-initial-direction-011CUrcij89bjpsbc7k8wQeo
Some checks failed
build and push image / Release (push) Failing after 1m24s
Claude/aios initial direction 011 c urcij89bjpsbc7k8w qeo
2025-11-07 16:14:43 +09:00
Claude
7d531c2608 fix: Remove claude.service and fix network settings
- Remove cfg/claude.service (claude should be run manually, not as systemd service)
- Fix bind mount: change %h to /root for proper path resolution
- Fix network: change to VirtualEthernet=no for internet access
- Update install.sh to create proper nspawn configs for all containers
- Create /root/.config/syui/ai directory in install.sh

Working flow:
- aios OS boot -> ai user login
- machinectl login workspace
- manually run 'claude' command
2025-11-07 07:02:43 +00:00
Claude
ff161f84a0 feat: Add workspace container with claude auto-start
- Create cfg/claude.service for systemd auto-start of Claude Code
- Enable claude.service on container boot
- Update install.sh to automatically create workspace container
- Update aios.zsh to start workspace and connect when shell:true
- Add machinectl to sudoers NOPASSWD for ai user
- Workspace container starts on login, claude.service auto-runs inside
2025-11-07 06:02:40 +00:00
Claude
ab50bc29f0 fix: Configure Claude Code settings via symlink for sharing
- Move MCP config to ~/.config/syui/ai/claude/ (bind-mounted)
- Create symlink ~/.config/claude -> ~/.config/syui/ai/claude
- Apply to both root and ai user
- Settings now shared across containers via bind mount
- No need to copy config files, they are automatically shared
2025-11-06 17:12:49 +00:00
Claude
c2149966ec chore: Add build artifacts to .gitignore 2025-11-06 16:00:49 +00:00
Claude
a3e1878c14 feat: Add machinectl management and backup/restore system
- Create cfg/aios-ctl.zsh with machinectl control commands
  - aios-start/stop/shell/login for basic operations
  - aios-backup to save current state to aiosback
  - aios-reset to restore from backup (preserves config files)
  - aios-update to update packages in backup
- Create cfg/install.sh for automated installation
  - Extracts tarball to /var/lib/machines/aios
  - Creates systemd-nspawn configuration
  - Automatically creates initial backup image (aiosback)
- Include aios-ctl.zsh in container at /opt/aios-ctl.zsh
- Include install.sh in tarball for easy deployment
- Config files in ~/.config/syui/ai are bind-mounted and preserved across resets
2025-11-06 15:56:00 +00:00
Claude
8e74f906a0 feat: Add optional auto-startup for claude
- Create cfg/aios.zsh startup script with config-based claude launch
- Install startup script to /usr/local/bin/aios-startup
- Create default config at ~/.config/syui/ai/os/config.json
- Source startup script from user 'ai' .zshrc
- Enable optional "shell mode" via config {"shell": true}
2025-11-06 15:39:47 +00:00
Claude
baece04bba fix: Configure sudo for specific commands only
Changed sudo configuration to allow NOPASSWD for specific commands only:
- pacman -Syu --noconfirm (system update)
- rm -rf /var/lib/pacman/db.lck (unlock pacman)
- poweroff (shutdown)
- reboot (reboot)

This is more secure than allowing all commands without password.
2025-11-06 15:19:48 +00:00
Claude
69754d9df0 feat: Add default user 'ai' with auto-login
Added user setup:
- Username: ai
- Password: root
- Shell: zsh
- Groups: wheel (sudo enabled)

Auto-login configuration:
- getty@tty1 with --autologin ai
- .zshrc copied for both root and ai user

This provides a ready-to-use environment with AI-first user.
2025-11-06 15:18:04 +00:00
Claude
a411b36108 fix: Create Claude MCP config file directly
claude mcp add command does not support args parameter.
Changed to directly create claude_desktop_config.json with full config:
- command: aigpt
- args: ["server", "--enable-layer4"]

This ensures aigpt is properly registered with Layer 4 enabled.
2025-11-06 15:14:42 +00:00
Claude
b7077becdb feat: Auto-register aigpt to Claude MCP during build
Added automatic MCP registration:
- claude mcp add aigpt $(which aigpt) server

This eliminates manual MCP setup after installation.
Users can immediately use 'claude' with aigpt memory system.
2025-11-06 15:13:03 +00:00
Claude
22b1502f58 fix: Add missing os-release copy to build process
cfg/os-release was not being copied, causing NAME to remain 'Arch Linux'
instead of 'aios'.

Added os-release copy to both:
- build.zsh
- .github/workflows/release.yml
2025-11-06 14:51:31 +00:00
Claude
bf27244544 fix: Update arch-chroot paths for new archiso structure
archiso now creates bootstrap with systemd-nspawn standard structure:
root.x86_64/var/lib/machines/arch/ instead of root.x86_64/

Changes:
- build.zsh: Updated all arch-chroot paths to root.x86_64/var/lib/machines/arch
- build.zsh: Updated file copy paths for .zshrc, mcp.json, config.toml
- .github/workflows/release.yml: Same path updates
- Added aigpt + Claude Code installation steps to GitHub Actions

This aligns with systemd-nspawn's standard container directory structure
(/var/lib/machines/).
2025-11-06 14:26:53 +00:00
Claude
34f40e82c1 feat: Improve os-release with standard fields
- Added ID_LIKE=arch (indicates Arch Linux base)
- Added VERSION_ID and VERSION (version information)
- Added VERSION_CODENAME=rolling
- Reorganized fields in standard order
- Updated IMAGE_VERSION to 2024.11.06
2025-11-06 13:35:21 +00:00
Claude
f5c5b83955 fix: Change "ai os" to "aios" in cfg files
- cfg/os-release: NAME and PRETTY_NAME
- cfg/profiledef.sh: iso_publisher and iso_application
2025-11-06 13:34:31 +00:00
Claude
80e40a53ec Refactor aios: Focus on Claude Code + aigpt simplicity
Simplified aios to focus on core value:
- Pre-configured systemd-nspawn environment
- Claude Code + aigpt (MCP) pre-installed
- Shared memory across containers

Philosophy:
Don't build new tools. Use existing ones (Claude Code, systemd-nspawn).
Just provide the optimal environment and automation.

Changes:
- Added cfg/zshrc: Shell config with claude alias
- Updated build.zsh: Install Claude Code (npm) + aigpt
- Updated aios-install.sh: Simplified installation flow
- Updated README.md: Focus on simplicity and practicality

Installation:
1. npm i -g @anthropic-ai/claude-code
2. Build aigpt from source
3. Configure .zshrc with aliases
4. Set up systemd-nspawn with bind mounts

Usage:
$ sudo machinectl shell aios
$ claude  # or: ai
2025-11-06 13:19:48 +00:00
Claude
ee4b8c052f Implement aios initial direction: AI-managed OS with shared memory
This commit implements the new direction for aios:
- AI conversation interface replaces traditional shell
- aigpt integration for shared memory across containers
- systemd-nspawn for environment isolation

Changes:
- Added aios-install.sh: Complete installer script
- Added cfg/mcp.json: MCP server configuration for aigpt
- Added cfg/config.toml: aios configuration with permission system
- Added cfg/nspawn/aios.nspawn: systemd-nspawn configuration
- Updated build.zsh: Integrated aigpt installation and setup
- Updated README.md: Documented new architecture and philosophy

Architecture:
User → AI Chat → Commands → Execution
         ↓
     aigpt (shared memory)
         ↓
  systemd-nspawn (isolated environment)

Philosophy:
Simply insert AI into existing flows (shell → AI chat)
2025-11-06 12:36:50 +00:00
94d16d9a21 add scpt
Some checks failed
build and push image / Release (push) Failing after 1m36s
2025-08-10 07:56:31 +09:00
ccd4aab9af add ai.conf
Some checks failed
build and push image / Release (push) Failing after 2m24s
2025-07-04 11:46:50 +09:00