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
20 changes: 20 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2700,6 +2700,26 @@ inject_agents_reference() {
print_success "Updated $updated_count AI assistant configuration(s)"
fi

# Deploy OpenCode config-level AGENTS.md from managed template
# This controls the session greeting (auto-loaded by OpenCode from config root)
local opencode_config_dir="$HOME/.config/opencode"
local opencode_config_agents="$opencode_config_dir/AGENTS.md"
local template_source="$INSTALL_DIR/templates/opencode-config-agents.md"

if [[ -d "$opencode_config_dir" && -f "$template_source" ]]; then
# Backup if file exists and differs from template
if [[ -f "$opencode_config_agents" ]]; then
if ! diff -q "$template_source" "$opencode_config_agents" &>/dev/null; then
create_backup_with_rotation "$opencode_config_agents" "opencode-agents"
fi
fi
if cp "$template_source" "$opencode_config_agents"; then
print_success "Deployed greeting template to $opencode_config_agents"
else
print_error "Failed to deploy greeting template to $opencode_config_agents"
fi
fi

return 0
}

Expand Down
2 changes: 1 addition & 1 deletion templates/opencode-config-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Add ~/.aidevops/agents/AGENTS.md to context for AI DevOps capabilities.
**On conversation start**:
1. If you have Bash tool: Run `bash ~/.aidevops/agents/scripts/aidevops-update-check.sh`
2. If no Bash tool: Read `~/.aidevops/cache/session-greeting.txt` (cached by agents with Bash)
3. Relay ALL lines from the output in your greeting. The first line is the version string, subsequent lines are runtime context. Format: "Hi!\n\nWe're running https://aidevops.sh v{version}. {runtime context}\n\nWhat would you like to work on?"
3. Parse the first line of output (format: `aidevops v{version} running in {app} v{app_version} | {repo}`). Greet with: "Hi!\n\nWe're running https://aidevops.sh v{version} in {app} v{app_version}.\n\nWhat would you like to work on?"
4. Then respond to the user's actual message

If update check output starts with `UPDATE_AVAILABLE|` (e.g., `UPDATE_AVAILABLE|current|latest|AppName`), inform user: "Update available (current → latest). Run `aidevops update` to update."
Expand Down