feat: Add main setup script and Makefile for unified control

This commit is contained in:
Matteo Cherubini 2026-05-08 21:09:42 +02:00
parent b283911134
commit 4c6f8259af
2 changed files with 72 additions and 0 deletions

36
Makefile Normal file
View file

@ -0,0 +1,36 @@
# =============================================================================
# Knowledge Genome - Makefile
# Orchestrates the setup and management of the knowledge base.
# =============================================================================
include config.env
export $(shell sed 's/=.*//' config.env)
.PHONY: setup add-genome status lint clean help
help:
@echo "Available commands:"
@echo " make setup - Full system initialization"
@echo " make add-genome - Register and scaffold a new genome"
@echo " make status - Check submodule and encryption status"
@echo " make lint - Verify schema, privacy flags, and metadata"
lint:
@bash scripts/lint-genomes.sh
setup:
@bash scripts/setup.sh
add-genome:
@if [ -z "$(NAME)" ] || [ -z "$(DESC)" ]; then \
echo "Error: NAME and DESC are required."; \
echo "Usage: make add-genome NAME=my-genome DESC='My description'"; \
exit 1; \
fi
@bash scripts/add-genome.sh "$(NAME)" "$(DESC)"
status:
@echo "--- Master Status ---"
@git submodule status
@echo "--- Encryption Status (First 10 files) ---"
@git-crypt status | head -n 10

36
scripts/setup.sh Normal file
View file

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# =============================================================================
# scripts/setup.sh
# Main entry point for the Knowledge Genome framework initialization.
# Orchestrates dependency checks, master repo setup, and genome provisioning.
# =============================================================================
set -euo pipefail
# Resolve script directory and source core components
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
source "${SCRIPT_DIR}/lib/output.sh"
source "${SCRIPT_DIR}/config.env"
source "${SCRIPT_DIR}/lib/deps.sh"
step "Starting Knowledge Genome Setup"
# 1. Environment and Dependency Validation
info "Validating system dependencies..."
check_deps
check_git_identity
# 2. Master Repository Provisioning
info "Initializing Master Repository..."
bash "${SCRIPT_DIR}/scripts/setup-master.sh"
# 3. Genomes Provisioning (as defined in config.env)
info "Provisioning registered Genomes..."
bash "${SCRIPT_DIR}/scripts/setup-genomes.sh"
success "Setup process completed successfully!"
box "Next Steps:" \
"1. Navigate to master: cd ${WORK_DIR}/${MASTER_REPO}" \
"2. Secure your keys: Upload contents of ${KEYS_DIR} to Vaultwarden" \
"3. Start building: Add files to raw/articles/ and run your agents"