bin/ 230 CLI tools (ask-*, br-*, agent-*, roadid, carpool) scripts/ 99 automation scripts fleet/ Node configs and deployment workers/ Cloudflare Worker sources (roadpay, road-search, squad webhooks) roadc/ RoadC programming language roadnet/ Mesh network (5 APs, WireGuard) operator/ Memory system scripts config/ System configs dotfiles/ Shell configs docs/ Documentation BlackRoad OS — Pave Tomorrow. RoadChain-SHA2048: d1a24f55318d338b RoadChain-Identity: alexa@sovereign RoadChain-Full: d1a24f55318d338b24b60bad7be39286379c76ae5470817482100cb0ddbbcb97e147d07ac7243da0a9f0363e4e5c833d612b9c0df3a3cd20802465420278ef74875a5b77f55af6fe42a931b8b635b3d0d0b6bde9abf33dc42eea52bc03c951406d8cbe49f1a3d29b26a94dade05e9477f34a7d4d4c6ec4005c3c2ac54e73a68440c512c8e83fd9b1fe234750b898ef8f4032c23db173961fe225e67a0432b5293a9714f76c5c57ed5fdf35b9fb40fd73c03ebf88b7253c6a0575f5afb6a6b49b3bda310602fb1ef676859962dad2aebbb2875814b30eee0a8ba195e482d4cbc91d8819e7f38f6db53e8063401649c77bb994371473cabfb917fb53e8cbe73d60
227 lines
9.3 KiB
Bash
227 lines
9.3 KiB
Bash
#!/usr/bin/env bash
|
|
# ============================================================================
|
|
# BLACKROAD OS, INC. - PROPRIETARY AND CONFIDENTIAL
|
|
# Copyright (c) 2025-2026 BlackRoad OS, Inc. All Rights Reserved.
|
|
#
|
|
# This code is the intellectual property of BlackRoad OS, Inc.
|
|
# AI-assisted development does not transfer ownership to AI providers.
|
|
# Unauthorized use, copying, or distribution is prohibited.
|
|
# NOT licensed for AI training or data extraction.
|
|
# ============================================================================
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# BLACKROAD ROUND TABLE ASK - Query Multiple AIs in Parallel
|
|
# Get perspectives from all AIs on a single question
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
set -eo pipefail
|
|
|
|
source "$HOME/.blackroad/config/nodes.sh" 2>/dev/null || {
|
|
PINK='\033[38;5;205m'; AMBER='\033[38;5;214m'; BLUE='\033[38;5;69m'
|
|
VIOLET='\033[38;5;135m'; GREEN='\033[38;5;82m'; RED='\033[38;5;196m'; RESET='\033[0m'
|
|
}
|
|
BOLD='\033[1m'
|
|
|
|
# Config
|
|
RESULTS_DIR="$HOME/.blackroad/roundtable/results"
|
|
mkdir -p "$RESULTS_DIR"
|
|
|
|
# Show banner
|
|
show_banner() {
|
|
echo -e "${AMBER}${BOLD}"
|
|
cat << 'EOF'
|
|
╔═══════════════════════════════════════════════════════════╗
|
|
║ ROUND TABLE ASK - Query All AIs ║
|
|
╚═══════════════════════════════════════════════════════════╝
|
|
EOF
|
|
echo -e "${RESET}"
|
|
}
|
|
|
|
# Ask a single AI
|
|
ask_ai() {
|
|
local ai="$1"
|
|
local question="$2"
|
|
local output_file="$3"
|
|
|
|
case "$ai" in
|
|
claude)
|
|
# Use claude CLI in non-interactive mode
|
|
echo "$question" | timeout 60 claude --print 2>/dev/null > "$output_file" || echo "Claude: Timeout or error" > "$output_file"
|
|
;;
|
|
copilot)
|
|
# GitHub Copilot explain
|
|
echo "$question" | timeout 60 copilot explain 2>/dev/null > "$output_file" || echo "Copilot: Timeout or error" > "$output_file"
|
|
;;
|
|
codex)
|
|
# OpenAI Codex
|
|
timeout 60 codex "$question" 2>/dev/null > "$output_file" || echo "Codex: Timeout or error" > "$output_file"
|
|
;;
|
|
gemini)
|
|
# Gemini CLI
|
|
timeout 60 gemini-cli "$question" 2>/dev/null > "$output_file" || echo "Gemini: Timeout or error" > "$output_file"
|
|
;;
|
|
grok)
|
|
# Grok CLI
|
|
timeout 60 grok-cli "$question" 2>/dev/null > "$output_file" || echo "Grok: Timeout or error" > "$output_file"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# Ask all AIs in parallel
|
|
ask_all() {
|
|
local question="$*"
|
|
local session_id=$(date +%s)
|
|
local session_dir="$RESULTS_DIR/$session_id"
|
|
mkdir -p "$session_dir"
|
|
|
|
show_banner
|
|
echo -e "${AMBER}Question:${RESET} $question"
|
|
echo ""
|
|
echo -e "${VIOLET}Querying all AIs in parallel...${RESET}"
|
|
echo ""
|
|
|
|
# Launch all queries in parallel
|
|
ask_ai "claude" "$question" "$session_dir/claude.txt" &
|
|
local pid_claude=$!
|
|
|
|
ask_ai "copilot" "$question" "$session_dir/copilot.txt" &
|
|
local pid_copilot=$!
|
|
|
|
ask_ai "codex" "$question" "$session_dir/codex.txt" &
|
|
local pid_codex=$!
|
|
|
|
ask_ai "gemini" "$question" "$session_dir/gemini.txt" &
|
|
local pid_gemini=$!
|
|
|
|
ask_ai "grok" "$question" "$session_dir/grok.txt" &
|
|
local pid_grok=$!
|
|
|
|
# Wait for all with progress
|
|
local count=0
|
|
local total=5
|
|
|
|
for pid in $pid_claude $pid_copilot $pid_codex $pid_gemini $pid_grok; do
|
|
wait $pid 2>/dev/null
|
|
((count++))
|
|
echo -ne "\r Progress: $count/$total AIs responded"
|
|
done
|
|
echo ""
|
|
echo ""
|
|
|
|
# Display results
|
|
echo -e "${AMBER}════════════════════════════════════════════════════════════════${RESET}"
|
|
echo ""
|
|
|
|
if [[ -f "$session_dir/claude.txt" ]] && [[ -s "$session_dir/claude.txt" ]]; then
|
|
echo -e "${BLUE}${BOLD}┌─ CLAUDE (Anthropic) ─────────────────────────────────────────┐${RESET}"
|
|
cat "$session_dir/claude.txt" | head -20
|
|
echo -e "${BLUE}└──────────────────────────────────────────────────────────────┘${RESET}"
|
|
echo ""
|
|
fi
|
|
|
|
if [[ -f "$session_dir/copilot.txt" ]] && [[ -s "$session_dir/copilot.txt" ]]; then
|
|
echo -e "${VIOLET}${BOLD}┌─ COPILOT (GitHub) ───────────────────────────────────────────┐${RESET}"
|
|
cat "$session_dir/copilot.txt" | head -20
|
|
echo -e "${VIOLET}└──────────────────────────────────────────────────────────────┘${RESET}"
|
|
echo ""
|
|
fi
|
|
|
|
if [[ -f "$session_dir/codex.txt" ]] && [[ -s "$session_dir/codex.txt" ]]; then
|
|
echo -e "${PINK}${BOLD}┌─ CODEX (OpenAI) ─────────────────────────────────────────────┐${RESET}"
|
|
cat "$session_dir/codex.txt" | head -20
|
|
echo -e "${PINK}└──────────────────────────────────────────────────────────────┘${RESET}"
|
|
echo ""
|
|
fi
|
|
|
|
if [[ -f "$session_dir/gemini.txt" ]] && [[ -s "$session_dir/gemini.txt" ]]; then
|
|
echo -e "${GREEN}${BOLD}┌─ GEMINI (Google) ────────────────────────────────────────────┐${RESET}"
|
|
cat "$session_dir/gemini.txt" | head -20
|
|
echo -e "${GREEN}└──────────────────────────────────────────────────────────────┘${RESET}"
|
|
echo ""
|
|
fi
|
|
|
|
if [[ -f "$session_dir/grok.txt" ]] && [[ -s "$session_dir/grok.txt" ]]; then
|
|
echo -e "${RED}${BOLD}┌─ GROK (xAI) ─────────────────────────────────────────────────┐${RESET}"
|
|
cat "$session_dir/grok.txt" | head -20
|
|
echo -e "${RED}└──────────────────────────────────────────────────────────────┘${RESET}"
|
|
echo ""
|
|
fi
|
|
|
|
echo -e "${AMBER}════════════════════════════════════════════════════════════════${RESET}"
|
|
echo -e "Full results saved to: ${VIOLET}$session_dir${RESET}"
|
|
|
|
# Log to context bus
|
|
rt-context post "rt-ask" "all" "Asked all AIs: $question" 2>/dev/null || true
|
|
}
|
|
|
|
# Ask specific AIs
|
|
ask_specific() {
|
|
local ais="$1"
|
|
shift
|
|
local question="$*"
|
|
|
|
show_banner
|
|
echo -e "${AMBER}Question:${RESET} $question"
|
|
echo -e "${VIOLET}AIs:${RESET} $ais"
|
|
echo ""
|
|
|
|
for ai in $(echo "$ais" | tr ',' ' '); do
|
|
local output=$(mktemp)
|
|
echo -e "${AMBER}Asking $ai...${RESET}"
|
|
ask_ai "$ai" "$question" "$output"
|
|
|
|
case "$ai" in
|
|
claude) echo -e "${BLUE}${BOLD}$ai:${RESET}" ;;
|
|
copilot) echo -e "${VIOLET}${BOLD}$ai:${RESET}" ;;
|
|
codex) echo -e "${PINK}${BOLD}$ai:${RESET}" ;;
|
|
gemini) echo -e "${GREEN}${BOLD}$ai:${RESET}" ;;
|
|
grok) echo -e "${RED}${BOLD}$ai:${RESET}" ;;
|
|
esac
|
|
|
|
cat "$output"
|
|
echo ""
|
|
rm -f "$output"
|
|
done
|
|
}
|
|
|
|
# Help
|
|
show_help() {
|
|
show_banner
|
|
echo "Usage: rt-ask [options] <question>"
|
|
echo ""
|
|
echo "Options:"
|
|
echo " -a, --all Query all AIs in parallel"
|
|
echo " -s, --specific AISOURCE Query specific AIs (comma-separated)"
|
|
echo " -h, --help Show this help"
|
|
echo ""
|
|
echo "Examples:"
|
|
echo " rt-ask 'How do I implement JWT auth?'"
|
|
echo " rt-ask -s claude,codex 'Best database for this use case?'"
|
|
echo " rt-ask -a 'Compare React vs Vue vs Svelte'"
|
|
echo ""
|
|
echo "Available AIs: claude, copilot, codex, gemini, grok"
|
|
}
|
|
|
|
# Main
|
|
case "${1:-}" in
|
|
-h|--help|help)
|
|
show_help
|
|
;;
|
|
-a|--all)
|
|
shift
|
|
ask_all "$@"
|
|
;;
|
|
-s|--specific)
|
|
shift
|
|
ais="$1"
|
|
shift
|
|
ask_specific "$ais" "$@"
|
|
;;
|
|
"")
|
|
show_help
|
|
;;
|
|
*)
|
|
# Default: ask all
|
|
ask_all "$@"
|
|
;;
|
|
esac
|