Full Cargo workspace with 11 crates: - gyandoot-core: Shared types, config, error types - gyandoot-agent: Agent loop, tool execution, context compression - gyandoot-providers: LLM provider abstraction (OpenAI, Anthropic, Ollama) - gyandoot-memory: MemPalace persistent memory system - gyandoot-platform: Platform adapters (Telegram, Discord, Webhook, CLI) - gyandoot-security: Credential vault, sanitizer, threat detector - gyandoot-kanban: Task decomposition, swarm orchestration, diagnostics - gyandoot-subagents: Sub-agent spawning and orchestration - gyandoot-skills: Skills discovery, loading, preprocessing, bundles - gyandoot-profile: Multi-agent profile manager - gyandoot-gateway: Gateway sessions, routing, access control Plus: CLI entry point with clap, cross-platform installer script, KANBAN.md, .gnpl/AGENTS.md Workspace compiles clean: cargo check passes with 0 errors.
94 lines
2.3 KiB
Bash
Executable File
94 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# GyanDoot v2.0 — Cross-platform installer
|
|
# Detects OS, architecture, and installs the gyandoot binary.
|
|
|
|
GREEN='\033[0;32m'
|
|
BLUE='\033[0;34m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m'
|
|
|
|
info() { echo -e "${BLUE}[INFO]${NC} $*"; }
|
|
ok() { echo -e "${GREEN}[OK]${NC} $*"; }
|
|
err() { echo -e "${RED}[ERR]${NC} $*" >&2; exit 1; }
|
|
|
|
detect_architecture() {
|
|
local arch
|
|
arch="$(uname -m)"
|
|
case "$arch" in
|
|
x86_64|amd64) echo "x86_64" ;;
|
|
aarch64|arm64) echo "aarch64" ;;
|
|
*) err "Unsupported architecture: $arch" ;;
|
|
esac
|
|
}
|
|
|
|
detect_os() {
|
|
local os
|
|
os="$(uname -s)"
|
|
case "$os" in
|
|
Linux) echo "linux" ;;
|
|
Darwin) echo "darwin" ;;
|
|
CYGWIN*|MINGW*|MSYS*) echo "windows" ;;
|
|
*) err "Unsupported OS: $os" ;;
|
|
esac
|
|
}
|
|
|
|
install_rust_if_needed() {
|
|
if ! command -v cargo &>/dev/null; then
|
|
info "Rust toolchain not found. Installing..."
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
source "$HOME/.cargo/env"
|
|
ok "Rust installed"
|
|
else
|
|
ok "Rust already installed ($(cargo --version))"
|
|
fi
|
|
}
|
|
|
|
build_release() {
|
|
local root_dir
|
|
root_dir="$(cd "$(dirname "$0")" && pwd)"
|
|
info "Building GyanDoot v2.0 in release mode..."
|
|
cd "$root_dir"
|
|
cargo build --release
|
|
ok "Build complete"
|
|
}
|
|
|
|
install_binary() {
|
|
local root_dir
|
|
root_dir="$(cd "$(dirname "$0")" && pwd)"
|
|
local target_dir="$root_dir/target/release"
|
|
local bin_name="gyandoot"
|
|
|
|
if [ ! -f "$target_dir/$bin_name" ]; then
|
|
err "Binary not found at $target_dir/$bin_name"
|
|
fi
|
|
|
|
local install_dir="/usr/local/bin"
|
|
if [ ! -w "$install_dir" ]; then
|
|
info "Need sudo to install to $install_dir"
|
|
sudo cp "$target_dir/$bin_name" "$install_dir/$bin_name"
|
|
sudo chmod +x "$install_dir/$bin_name"
|
|
else
|
|
cp "$target_dir/$bin_name" "$install_dir/$bin_name"
|
|
chmod +x "$install_dir/$bin_name"
|
|
fi
|
|
ok "Installed to $install_dir/$bin_name"
|
|
}
|
|
|
|
main() {
|
|
local os arch
|
|
os=$(detect_os)
|
|
arch=$(detect_architecture)
|
|
info "Detected: $os / $arch"
|
|
|
|
install_rust_if_needed
|
|
build_release
|
|
install_binary
|
|
|
|
echo ""
|
|
ok "GyanDoot v2.0 installed successfully!"
|
|
echo "Run 'gyandoot --help' to get started."
|
|
}
|
|
|
|
main "$@" |