Commit fab7d65417ef

Vincent Demeester <vincent@sbr.pm>
2026-02-02 13:40:49
fix(dots): symlink individual pi agent files, not entire directory
Pi runtime needs ~/.pi/agent/ as a real directory to write: - auth.json (authentication tokens) - settings.json (runtime preferences) - sessions/ (session history) We now symlink only the dotfiles we manage: - extensions/ (claude-hooks.ts for auto-discovery) - AGENTS.md (global agent instructions) - README.md (documentation) This hybrid approach allows: - Pi to manage its runtime state - Our dotfiles to provide extensions and configuration - Proper auto-discovery of extensions in ~/.pi/agent/extensions/ Fixes the nested ~/.pi/agent/agent symlink issue.
1 parent 7f559cb
Changed files (2)
dots
home
common
dots/Makefile
@@ -57,7 +57,7 @@ all += git-template copilot-hooks opencode-plugin pi-agent
 git-template : ~/.config/git/template
 copilot-hooks : ~/.config/copilot-hooks
 opencode-plugin : ~/.config/opencode/plugin
-pi-agent : ~/.pi/agent
+pi-agent : ~/.pi/agent/extensions ~/.pi/agent/AGENTS.md ~/.pi/agent/README.md
 
 # Backward compatibility: symlink ~/.claude to ~/.config/claude
 ~/.claude : force
@@ -65,11 +65,23 @@ pi-agent : ~/.pi/agent
 	@mkdir -p ~/.config
 	@ln -snf ~/.config/claude ~/.claude
 
-# Pi agent configuration goes to ~/.pi instead of ~/.config/pi
-~/.pi/agent : force
-	@echo "๐Ÿ“‹ Linking $(dotfiles)/pi/agent -> ~/.pi/agent"
-	@mkdir -p ~/.pi
-	@ln -snf $(dotfiles)/pi/agent ~/.pi/agent
+# Pi agent configuration - symlink individual files into pi's runtime directory
+# Pi manages: ~/.pi/agent/{auth.json,settings.json,sessions/}
+# We provide: extensions/, AGENTS.md, README.md
+~/.pi/agent/extensions : force
+	@echo "๐Ÿ“‹ Linking $(dotfiles)/pi/agent/extensions -> ~/.pi/agent/extensions"
+	@mkdir -p ~/.pi/agent
+	@ln -snf $(dotfiles)/pi/agent/extensions ~/.pi/agent/extensions
+
+~/.pi/agent/AGENTS.md : force
+	@echo "๐Ÿ“‹ Linking $(dotfiles)/pi/agent/AGENTS.md -> ~/.pi/agent/AGENTS.md"
+	@mkdir -p ~/.pi/agent
+	@ln -snf $(dotfiles)/pi/agent/AGENTS.md ~/.pi/agent/AGENTS.md
+
+~/.pi/agent/README.md : force
+	@echo "๐Ÿ“‹ Linking $(dotfiles)/pi/agent/README.md -> ~/.pi/agent/README.md"
+	@mkdir -p ~/.pi/agent
+	@ln -snf $(dotfiles)/pi/agent/README.md ~/.pi/agent/README.md
 
 # Generate ntfy client.yml from template with passage secrets injected
 ~/.config/ntfy/client.yml : $(dotfiles)/.config/ntfy/client.yml.in $(dotfiles)/.config/ntfy/ntfy-update-config force
home/common/dev/ai.nix
@@ -66,8 +66,6 @@ in
     # amp-cli
   ];
 
-
-
   # aichat configuration is now managed in dots/.config/aichat/
   # See dots/Makefile for config.yaml generation from template
 }