Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PROJECT_INDEX.json

Large diffs are not rendered by default.

43 changes: 39 additions & 4 deletions setup-claude-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@

set -e # Exit on error

# Initialize flags
OVERWRITE_COMMANDS=false

# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--overwrite-commands)
OVERWRITE_COMMANDS=true
shift
;;
-h|--help)
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " --overwrite-commands Overwrite existing command files"
echo " -h, --help Show this help message"
echo ""
exit 0
;;
*)
echo "Unknown option: $1"
echo "Use --help for usage information"
exit 1
;;
esac
done

echo "🚀 Agent OS Claude Code Setup"
echo "============================="
echo ""
Expand Down Expand Up @@ -37,11 +64,15 @@ echo "📥 Downloading Claude Code command files to ~/.claude/commands/"

# Commands
for cmd in plan-product create-spec execute-tasks analyze-product hygiene-check update-documentation; do
if [ -f "$HOME/.claude/commands/${cmd}.md" ]; then
if [ -f "$HOME/.claude/commands/${cmd}.md" ] && [ "$OVERWRITE_COMMANDS" = false ]; then
echo " ⚠️ ~/.claude/commands/${cmd}.md already exists - skipping"
else
curl -s -o "$HOME/.claude/commands/${cmd}.md" "${BASE_URL}/commands/${cmd}.md"
echo " ✓ ~/.claude/commands/${cmd}.md"
if [ -f "$HOME/.claude/commands/${cmd}.md" ] && [ "$OVERWRITE_COMMANDS" = true ]; then
echo " ✓ ~/.claude/commands/${cmd}.md (overwritten)"
else
echo " ✓ ~/.claude/commands/${cmd}.md"
fi
fi
done

Expand All @@ -53,11 +84,15 @@ mkdir -p "$HOME/.claude/agents"
# Agent definitions for Builder Methods subagent architecture
agents=("context-fetcher" "date-checker" "file-creator" "git-workflow" "test-runner")
for agent in "${agents[@]}"; do
if [ -f "$HOME/.claude/agents/${agent}.md" ]; then
if [ -f "$HOME/.claude/agents/${agent}.md" ] && [ "$OVERWRITE_COMMANDS" = false ]; then
echo " ⚠️ ~/.claude/agents/${agent}.md already exists - skipping"
else
curl -s -o "$HOME/.claude/agents/${agent}.md" "${BASE_URL}/claude-code/agents/${agent}.md"
echo " ✓ ~/.claude/agents/${agent}.md"
if [ -f "$HOME/.claude/agents/${agent}.md" ] && [ "$OVERWRITE_COMMANDS" = true ]; then
echo " ✓ ~/.claude/agents/${agent}.md (overwritten)"
else
echo " ✓ ~/.claude/agents/${agent}.md"
fi
fi
done

Expand Down
29 changes: 27 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,40 @@ else
echo " Existing standards files were preserved"
fi
fi
# Check for existing Claude Code commands and offer update
if [ -d "$HOME/.claude/commands" ] && [ "$(ls -A $HOME/.claude/commands 2>/dev/null)" ]; then
echo ""
echo "🔄 Claude Code commands detected. Would you like to update them to match the latest Agent OS? (y/n)"
read -r -p "Update Claude commands? " response
echo ""
if [[ $response =~ ^[Yy]$ ]]; then
echo "📦 Updating Claude Code commands..."
curl -sSL "${BASE_URL}/setup-claude-code.sh" | bash --overwrite-commands
if [ $? -eq 0 ]; then
echo "✅ Claude Code commands updated successfully!"
else
echo "⚠️ Command update had issues, but Agent OS base installation is complete"
fi
else
echo "ℹ️ Claude Code commands not updated. You can update them later with:"
echo " curl -sSL https://raw.githubusercontent.com/carmandale/agent-os/main/setup-claude-code.sh | bash --overwrite-commands"
fi
fi

echo ""
echo "Next steps:"
echo ""
echo "1. Customize your coding standards in ~/.agent-os/standards/"
echo ""
echo "2. Install commands for your AI coding assistant(s):"
echo ""
echo " - Using Claude Code? Install the Claude Code commands with:"
echo " curl -sSL https://raw.githubusercontent.com/carmandale/agent-os/main/setup-claude-code.sh | bash"
if [ ! -d "$HOME/.claude/commands" ] || [ -z "$(ls -A $HOME/.claude/commands 2>/dev/null)" ]; then
echo " - Using Claude Code? Install the Claude Code commands with:"
echo " curl -sSL https://raw.githubusercontent.com/carmandale/agent-os/main/setup-claude-code.sh | bash"
else
echo " - Claude Code commands are installed. To update them:"
echo " curl -sSL https://raw.githubusercontent.com/carmandale/agent-os/main/setup-claude-code.sh | bash --overwrite-commands"
fi
echo ""
echo " - Using Cursor? Install the Cursor commands with:"
echo " curl -sSL https://raw.githubusercontent.com/carmandale/agent-os/main/setup-cursor.sh | bash"
Expand Down
6 changes: 5 additions & 1 deletion tools/aos
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,11 @@ check_comprehensive_status() {
if [ "$integrity_ok" = true ]; then
print_status "success" "Integrity OK"
else
print_status "warning" "Integrity issues detected (mismatch or missing files). Run setup to sync."
print_status "warning" "Integrity issues detected (mismatch or missing files)."
echo " 💡 To sync all components: ./setup.sh"
if [ -d "$HOME/.claude/commands" ]; then
echo " 💡 To sync Claude commands only: ./setup-claude-code.sh --overwrite-commands"
fi
fi
else
print_status "error" "Not installed"
Expand Down
Loading