diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d1279d2 --- /dev/null +++ b/Makefile @@ -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 diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100644 index 0000000..eb2e5b7 --- /dev/null +++ b/scripts/setup.sh @@ -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"