Initial monorepo — everything BlackRoad in one place
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
This commit is contained in:
120
bin/blackroad-ai.bak
Executable file
120
bin/blackroad-ai.bak
Executable file
@@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env bash
|
||||
# BlackRoad AI - Unlimited local AI assistant
|
||||
# Routes through your unlimited copilot system with local models first
|
||||
|
||||
set -e
|
||||
|
||||
UNLIMITED_COPILOT="$HOME/blackroad-unlimited-copilot.py"
|
||||
|
||||
# Colors (BlackRoad brand - #F5A623 amber primary)
|
||||
AMBER='\033[38;5;214m' # Primary brand (F5A623)
|
||||
BLUE='\033[38;5;33m' # Electric blue (2979FF)
|
||||
GREEN='\033[38;5;82m' # Success
|
||||
RED='\033[38;5;196m' # Error
|
||||
RESET='\033[0m'
|
||||
|
||||
# Check if Python script exists
|
||||
if [ ! -f "$UNLIMITED_COPILOT" ]; then
|
||||
echo -e "${RED}Error: blackroad-unlimited-copilot.py not found${RESET}"
|
||||
echo "Expected location: $UNLIMITED_COPILOT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Handle different subcommands
|
||||
case "${1:-}" in
|
||||
suggest|explain|s|e)
|
||||
# Code generation/explanation - use unlimited system
|
||||
shift
|
||||
|
||||
if [ -z "$*" ]; then
|
||||
echo -e "${BLUE}Usage:${RESET} blackroad-ai suggest \"your question\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Enhanced header
|
||||
echo -e "${PINK}╔═══════════════════════════════════════════════════════════════╗${RESET}"
|
||||
echo -e "${PINK}║${RESET} BlackRoad AI - Unlimited Intelligence ${PINK}║${RESET}"
|
||||
echo -e "${PINK}╠═══════════════════════════════════════════════════════════════╣${RESET}"
|
||||
|
||||
# Check what's available
|
||||
if curl -s -m 1 http://octavia:11434/api/tags > /dev/null 2>&1; then
|
||||
models=$(ssh octavia "curl -s http://localhost:11434/api/tags | jq -r '.models | length'" 2>/dev/null || echo "?")
|
||||
echo -e "${PINK}║${RESET} ${GREEN}✅ Octavia Online${RESET} - $models local models ready ${PINK}║${RESET}"
|
||||
else
|
||||
echo -e "${PINK}║${RESET} ${AMBER}⚠️ Local AI loading...${RESET} falling back to cloud ${PINK}║${RESET}"
|
||||
fi
|
||||
|
||||
echo -e "${PINK}║${RESET} ${GREEN}Cost:${RESET} \$0/month (local) + fallback to cloud ${PINK}║${RESET}"
|
||||
echo -e "${PINK}║${RESET} ${GREEN}Rate Limits:${RESET} None on local models ${PINK}║${RESET}"
|
||||
echo -e "${PINK}║${RESET} ${GREEN}Privacy:${RESET} Code stays local on your network ${PINK}║${RESET}"
|
||||
echo -e "${PINK}╚═══════════════════════════════════════════════════════════════╝${RESET}"
|
||||
echo ""
|
||||
|
||||
python3 "$UNLIMITED_COPILOT" "$@"
|
||||
;;
|
||||
|
||||
status)
|
||||
# Show system status with enhanced header
|
||||
echo -e "${PINK}╔═══════════════════════════════════════════════════════════════╗${RESET}"
|
||||
echo -e "${PINK}║${RESET} BlackRoad AI - System Status ${PINK}║${RESET}"
|
||||
echo -e "${PINK}╠═══════════════════════════════════════════════════════════════╣${RESET}"
|
||||
|
||||
# Check Ollama (Octavia)
|
||||
echo -e "${BLUE}Ollama (octavia:11434):${RESET}"
|
||||
if ssh -o ConnectTimeout=2 octavia "curl -s http://localhost:11434/api/tags" > /dev/null 2>&1; then
|
||||
models=$(ssh octavia "curl -s http://localhost:11434/api/tags | jq -r '.models | length'" 2>/dev/null || echo "?")
|
||||
echo -e " ${GREEN}✅ Online${RESET} - $models models available"
|
||||
echo -e " Models: codellama, llama3, qwen2.5, gemma, lucidia"
|
||||
else
|
||||
echo -e " ${AMBER}⚠️ Offline (will use fallbacks)${RESET}"
|
||||
fi
|
||||
|
||||
# Check gh copilot (fallback)
|
||||
echo -e "\n${BLUE}GitHub Copilot (fallback):${RESET}"
|
||||
if command -v gh > /dev/null && gh auth status > /dev/null 2>&1; then
|
||||
echo -e " ${GREEN}✅ Authenticated${RESET}"
|
||||
else
|
||||
echo -e " ${AMBER}⚠️ Not authenticated${RESET}"
|
||||
fi
|
||||
|
||||
# Show available methods
|
||||
echo -e "\n${BLUE}Available Methods:${RESET}"
|
||||
python3 "$UNLIMITED_COPILOT" 2>&1 | grep -E "^\s+•" || echo " Run 'python3 $UNLIMITED_COPILOT' for details"
|
||||
;;
|
||||
|
||||
methods|list)
|
||||
# List available methods
|
||||
python3 "$UNLIMITED_COPILOT"
|
||||
;;
|
||||
|
||||
help|--help|-h|"")
|
||||
# Show help
|
||||
echo -e "${PINK}╔═══════════════════════════════════════════════╗${RESET}"
|
||||
echo -e "${PINK}║${RESET} BlackRoad AI ${PINK}║${RESET}"
|
||||
echo -e "${PINK}╚═══════════════════════════════════════════════╝${RESET}"
|
||||
echo ""
|
||||
echo -e "${BLUE}Usage:${RESET}"
|
||||
echo " blackroad-ai suggest \"write a hello world in rust\""
|
||||
echo " blackroad-ai explain \"what does this function do?\""
|
||||
echo " blackroad-ai status # Check system health"
|
||||
echo " blackroad-ai methods # List all AI methods"
|
||||
echo ""
|
||||
echo -e "${GREEN}Features:${RESET}"
|
||||
echo " • Uses local AI first (unlimited, free)"
|
||||
echo " • Automatic fallback to cloud APIs"
|
||||
echo " • 10+ access methods"
|
||||
echo " • Zero rate limits on local models"
|
||||
echo ""
|
||||
echo -e "${AMBER}Aliases:${RESET}"
|
||||
echo " suggest -> s"
|
||||
echo " explain -> e"
|
||||
;;
|
||||
|
||||
*)
|
||||
# Unknown command - show help
|
||||
echo -e "${AMBER}Unknown command: $1${RESET}"
|
||||
echo ""
|
||||
"$0" help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user