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 .agent/scripts/generate-opencode-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ echo -e " ${GREEN}✓${NC} Created /webmaster-keywords command"
cat > "$OPENCODE_COMMAND_DIR/onboarding.md" << 'EOF'
---
description: Interactive onboarding wizard - discover services, configure integrations
agent: Build+
agent: Onboarding
---

Read ~/.aidevops/agents/onboarding.md and follow its instructions.
Expand Down
17 changes: 16 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3717,7 +3717,22 @@ echo " aidevops uninstall - Remove aidevops"
if [[ "$launch_onboarding" =~ ^[Yy]?$ || "$launch_onboarding" == "Y" ]]; then
echo ""
echo "Starting OpenCode with Onboarding agent..."
opencode --agent Onboarding --prompt "/onboarding"
# Detect available auth provider and select appropriate model
# Prefer Anthropic (Claude) > Google (Gemini) > OpenCode Zen > OpenAI
local onboarding_model=""
local auth_file="$HOME/.local/share/opencode/auth.json"
if [[ -f "$auth_file" ]]; then
if jq -e '.anthropic' "$auth_file" &>/dev/null; then
onboarding_model="anthropic/claude-sonnet-4-5"
elif jq -e '.google' "$auth_file" &>/dev/null; then
onboarding_model="google/gemini-2.5-flash"
fi
fi
if [[ -n "$onboarding_model" ]]; then
opencode --agent Onboarding --prompt "/onboarding" --model "$onboarding_model"
else
opencode --agent Onboarding --prompt "/onboarding"
fi
Comment on lines +3731 to +3735

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid code duplication, you can refactor this block to build the opencode command arguments dynamically. This avoids repeating the base command opencode --agent Onboarding --prompt "/onboarding".

Suggested change
if [[ -n "$onboarding_model" ]]; then
opencode --agent Onboarding --prompt "/onboarding" --model "$onboarding_model"
else
opencode --agent Onboarding --prompt "/onboarding"
fi
local opencode_args=("--agent" "Onboarding" "--prompt" "/onboarding")
if [[ -n "$onboarding_model" ]]; then
opencode_args+=("--model" "$onboarding_model")
fi
opencode "${opencode_args[@]}"

else
echo ""
echo "You can run /onboarding anytime in OpenCode to configure services."
Expand Down
2 changes: 1 addition & 1 deletion templates/deploy-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ create_backup_with_rotation() {
if (( backup_count > BACKUP_KEEP_COUNT )); then
local to_delete=$((backup_count - BACKUP_KEEP_COUNT))
# Delete oldest backups (sorted by name = sorted by date)
find "$backup_type_dir" -maxdepth 1 -type d -name "20*" -print0 2>/dev/null | sort -z | head -z -n "$to_delete" | xargs -0 rm -rf
find "$backup_type_dir" -maxdepth 1 -type d -name "20*" 2>/dev/null | sort | head -n "$to_delete" | while read -r old_backup; do rm -rf "$old_backup"; done
print_info "Rotated backups: removed $to_delete old backup(s)"
fi

Expand Down
Loading