OpenWriterControle/integrations/claude-code/install-claude.sh
Darren Hinde bf02ad0d5c
refactor: Rename repository to OpenAgents Control (#100)
* refactor: Rename repository to OpenAgents Control

Update all project references from "OpenAgents" to "OpenAgents Control":
- Updated core config files (package.json, registry.json)
- Updated documentation (README.md, docs/)
- Updated scripts (install.sh, update.sh, test scripts)
- Updated agent and command files
- Updated integrations and packages
- Updated all GitHub URLs to use OpenAgentsControl

Naming convention:
- Display name: "OpenAgents Control"
- Repository URL: OpenAgentsControl

* feat: Enable subagent-to-subagent delegation (ContextScout integration)

Allow coding-related subagents to call ContextScout for context discovery:
- CoderAgent: Can now discover coding standards on-demand
- TestEngineer: Can now discover test coverage and TDD guidelines
- CodeReviewer: Can now discover code review and security patterns
- BuildAgent: Can now discover build validation standards
- DocWriter: Can now discover documentation formatting guidelines

Changes per subagent:
- Added `task: true` to tools section
- Added permission allowlist for ContextScout only (deny all other delegation)
- Added Context Discovery workflow section with when-to-call guidance

This enables subagents to be self-sufficient for finding relevant standards
instead of relying on orchestrator to provide all context files.

Benefits:
- Subagents can discover what they need when context isn't explicit
- Maintains security (only ContextScout allowed via task tool)
- Follows existing patterns (uses task tool like main agents)

* fix: Set OPENCODE_BRANCH in CI tests to use PR branch for downloads

- Add OPENCODE_BRANCH environment variable to E2E tests
- Add OPENCODE_BRANCH environment variable to profile smoke tests
- Ensures tests download files from the PR branch instead of main
- Fixes E2E test failures after repository rename to OpenAgentsControl
2026-01-18 09:31:35 +00:00

111 lines
2.7 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# install-claude.sh
# Installs OpenAgents Control to Claude Code with automatic conversion
#
set -euo pipefail
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Determine paths
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
OPENCODE_DIR="$REPO_ROOT/.opencode/agent"
CONVERTER_DIR="$SCRIPT_DIR/converter"
PLUGIN_DEST="$HOME/.claude/plugins/openagents-control-bridge"
NODE_BIN="${NODE_BIN:-node}"
echo -e "${GREEN}🚀 OpenAgents Control → Claude Code Installer${NC}"
echo -e " Source: $OPENCODE_DIR"
echo -e " Destination: $PLUGIN_DEST"
echo ""
# Check prerequisites
check_prereqs() {
local missing=()
# Check for node
if ! command -v "$NODE_BIN" >/dev/null 2>&1; then
missing+=("$NODE_BIN")
fi
# Check for bash
if ! command -v bash >/dev/null 2>&1; then
missing+=("bash")
fi
if [ ${#missing[@]} -gt 0 ]; then
echo -e "${RED}✗ Missing required commands: ${missing[*]}${NC}" >&2
echo -e " Install Node.js: https://nodejs.org/" >&2
exit 1
fi
}
# Run converter
run_converter() {
echo -e "${YELLOW}🔄 Converting agents to Claude format...${NC}"
cd "$CONVERTER_DIR"
if ! "$NODE_BIN" src/convert-agents.js 2>&1 | grep -q "Conversion complete"; then
echo -e "${RED}✗ Conversion failed${NC}" >&2
exit 1
fi
echo -e "${GREEN}✅ Conversion complete${NC}"
}
# Install plugin
install_plugin() {
echo -e "${YELLOW}📦 Installing plugin...${NC}"
# Create destination
mkdir -p "$HOME/.claude/plugins"
# Remove old installation
if [ -d "$PLUGIN_DEST" ]; then
echo "🗑️ Removing old installation..."
rm -rf "$PLUGIN_DEST"
fi
# Copy from generated (always fresh conversion)
cp -r "$CONVERTER_DIR/generated" "$PLUGIN_DEST"
echo -e "${GREEN}✅ Installation complete${NC}"
}
# Verify installation
verify() {
if [ ! -f "$PLUGIN_DEST/agents/core/openagent.md" ]; then
echo -e "${RED}✗ Installation verification failed${NC}" >&2
echo " Expected: $PLUGIN_DEST/agents/core/openagent.md" >&2
exit 1
fi
echo ""
echo -e "${GREEN}✨ Installation successful!${NC}"
echo ""
echo "To use with Claude Code:"
echo " claude --plugin-dir $PLUGIN_DEST"
echo ""
echo "Or add to your Claude Code settings for automatic loading:"
echo ' { "plugins": ["openagents-control-bridge"] }'
echo ""
echo "Verify Claude Code installation:"
echo " claude --version"
}
# Main workflow
main() {
check_prereqs
run_converter
install_plugin
verify
}
# Allow specifying custom Node.js binary via NODE_BIN environment variable
main "$@"