Academic paper knowledge organizer
Something went wrong. Try again.
3.0 kB ยท 101 lines
Shell
at claude
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102#!/bin/bash# Quick start script for alcanzai development setup# Run this once to get everything ready
set -e # Exit on any error
echo "๐ alcanzai Development Setup"echo "=============================="echo ""
# Color codes for outputGREEN='\033[0;32m'BLUE='\033[0;34m'YELLOW='\033[1;33m'NC='\033[0m' # No Color
# Check if uv is installedif ! command -v uv &> /dev/null; then echo "๐ฆ Installing uv (Python package manager)..." curl https://astral.sh/uv/install.sh | sh echo ""fi
# Install dependenciesecho -e "${BLUE}๐ Installing dependencies...${NC}"uv sync --all-extrasecho -e "${GREEN}โ Dependencies installed${NC}"echo ""
# Set up pre-commit hooksecho -e "${BLUE}๐ Setting up git pre-commit hooks...${NC}"pre-commit installecho -e "${GREEN}โ Pre-commit hooks configured${NC}"echo ""
# Create necessary directoriesecho -e "${BLUE}๐ Creating vault directories...${NC}"mkdir -p vault/_meta vault/Papers vault/Articles vault/PDFsecho -e "${GREEN}โ Vault directories created${NC}"echo ""
# Check if .env existsif [ ! -f .env ]; then echo -e "${YELLOW}โ ๏ธ Creating .env file...${NC}" cat > .env << 'EOF'# API ConfigurationANTHROPIC_API_KEY=sk-ant-YOUR_API_KEY_HERE
# GROBID Configuration (Docker)GROBID_URL=http://localhost:8070
# Vault ConfigurationVAULT_PATH=./vaultEOF echo -e "${YELLOW}โ ๏ธ Please edit .env and add your ANTHROPIC_API_KEY${NC}" echo ""fi
# Start GROBIDecho -e "${BLUE}๐ณ Starting GROBID service...${NC}"if command -v docker-compose &> /dev/null; then docker-compose up -d grobid 2>/dev/null || true echo -e "${YELLOW}โณ Waiting for GROBID to start (30 seconds)...${NC}" sleep 3 # Quick start check max_attempts=30 attempt=0 while [ $attempt -lt $max_attempts ]; do if curl -s http://localhost:8070/api/isalive > /dev/null 2>&1; then echo -e "${GREEN}โ GROBID is running${NC}" break fi attempt=$((attempt + 1)) sleep 1 done if [ $attempt -eq $max_attempts ]; then echo -e "${YELLOW}โ ๏ธ GROBID is still starting. Wait a bit longer or check: docker-compose logs grobid${NC}" fielse echo -e "${YELLOW}โ ๏ธ Docker Compose not found. Install it or run: docker-compose up -d grobid${NC}"fiecho ""
# Activate virtual environmentecho -e "${BLUE}๐ง Virtual environment created at: .venv${NC}"echo "Activate it with: source .venv/bin/activate"echo ""
# Summaryecho -e "${GREEN}========================================${NC}"echo -e "${GREEN}โ
Setup complete!${NC}"echo -e "${GREEN}========================================${NC}"echo ""echo "Next steps:"echo " 1. Edit .env and add your ANTHROPIC_API_KEY"echo " 2. Activate venv: source .venv/bin/activate"echo " 3. Validate setup: alcanzai validate"echo " 4. Run tests: pytest tests/ -m 'not integration'"echo " 5. Try importing: alcanzai ingest 1706.03762"echo ""echo "For detailed info, see: DEVELOPER.md"echo ""