Files
architecture/Makefile
Hugo Nijhuis 83a92cd3b7 Add Makefile for managing Claude Code config symlinks
- Move commands, scripts, settings to repo root
- Add Makefile with install/uninstall/status targets
- Symlinks ~/.claude/* to this repo for version control
- Update documentation with setup instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:52:27 +01:00

55 lines
1.5 KiB
Makefile

.PHONY: install uninstall status
CLAUDE_DIR := $(HOME)/.claude
REPO_DIR := $(shell pwd)
# Items to symlink
ITEMS := commands scripts skills agents settings.json
install:
@echo "Installing Claude Code config symlinks..."
@mkdir -p $(CLAUDE_DIR)
@for item in $(ITEMS); do \
if [ -e "$(REPO_DIR)/$$item" ]; then \
if [ -L "$(CLAUDE_DIR)/$$item" ]; then \
echo " $$item: already symlinked"; \
elif [ -e "$(CLAUDE_DIR)/$$item" ]; then \
echo " $$item: backing up existing to $$item.bak"; \
mv "$(CLAUDE_DIR)/$$item" "$(CLAUDE_DIR)/$$item.bak"; \
ln -s "$(REPO_DIR)/$$item" "$(CLAUDE_DIR)/$$item"; \
echo " $$item: symlinked"; \
else \
ln -s "$(REPO_DIR)/$$item" "$(CLAUDE_DIR)/$$item"; \
echo " $$item: symlinked"; \
fi \
fi \
done
@echo "Done! Restart Claude Code to apply changes."
uninstall:
@echo "Removing Claude Code config symlinks..."
@for item in $(ITEMS); do \
if [ -L "$(CLAUDE_DIR)/$$item" ]; then \
rm "$(CLAUDE_DIR)/$$item"; \
echo " $$item: removed symlink"; \
if [ -e "$(CLAUDE_DIR)/$$item.bak" ]; then \
mv "$(CLAUDE_DIR)/$$item.bak" "$(CLAUDE_DIR)/$$item"; \
echo " $$item: restored backup"; \
fi \
fi \
done
@echo "Done!"
status:
@echo "Claude Code config status:"
@for item in $(ITEMS); do \
if [ -L "$(CLAUDE_DIR)/$$item" ]; then \
target=$$(readlink "$(CLAUDE_DIR)/$$item"); \
echo " $$item: symlink -> $$target"; \
elif [ -e "$(CLAUDE_DIR)/$$item" ]; then \
echo " $$item: exists (not symlinked)"; \
else \
echo " $$item: not found"; \
fi \
done