- Rename sync-knowledgebases to kb-sync (drop the aliased indirection) - Generalize source discovery: scan each ~/work project for either docs/knowledgebase or documentation/knowledgebase - Add kb-publish: rsync collected docs into the site repo, build the MkDocs site, and commit/push to publish to GitLab Pages
112 lines
4.8 KiB
Plaintext
112 lines
4.8 KiB
Plaintext
# Natera-specific environment and tooling
|
|
# Sourced last from .zshrc on Natera machines (when this file is present).
|
|
# All Natera config lives here only.
|
|
|
|
# PATH for Natera/Claude tooling
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
|
|
# Claude Code (Bedrock)
|
|
export CLAUDE_CODE_USE_BEDROCK=1
|
|
# export AWS_REGION=us-west-2
|
|
export ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION=us-west-2
|
|
export ANTHROPIC_SMALL_FAST_MODEL=global.anthropic.claude-haiku-4-5-20251001-v1:0
|
|
export CLAUDE_CODE_ENABLE_TELEMETRY=1
|
|
|
|
# Primary model (what Claude Code uses by default)
|
|
export ANTHROPIC_MODEL='us.anthropic.claude-opus-5'
|
|
# Family pins (used by /model and for subagents)
|
|
export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-5[1m]'
|
|
export ANTHROPIC_DEFAULT_SONNET_MODEL='us.anthropic.claude-sonnet-5[1m]'
|
|
export ANTHROPIC_DEFAULT_HAIKU_MODEL='us.anthropic.claude-haiku-4-5-20251001-v1:0'
|
|
|
|
export CLAUDE_CODE_USE_MANTLE=1
|
|
export AWS_REGION=us-east-1
|
|
|
|
# Raise the default 64000 output cap (helpful on Opus 4.7)
|
|
export CLAUDE_CODE_MAX_OUTPUT_TOKENS=128000
|
|
# Request a 1-hour prompt cache TTL instead of the 5-minute default.
|
|
# Good for long-lived sessions; writes are billed at a higher rate.
|
|
#export ENABLE_PROMPT_CACHING_1H=1
|
|
|
|
# OpenTelemetry (Natera staging)
|
|
export OTEL_METRICS_EXPORTER=otlp
|
|
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
|
|
export OTEL_RESOURCE_ATTRIBUTES="user.email=$USER@natera.com"
|
|
|
|
# Jellyfish AI reporting — endpoint + bearer token live in zshrc-natera.private
|
|
# (sourced last, so its protocol/endpoint overrides take effect). See the
|
|
# Jellyfish block in zshrc-natera.private.example for the shape.
|
|
|
|
# Project-specific aliases
|
|
alias workbench='cd ~/work/rosalis'
|
|
alias core='cd ~/work/yalp-core'
|
|
alias histo='cd ~/work/yalp-histology'
|
|
alias pipeline='cd ~/work/yalp-pipeline-integration'
|
|
alias assayapi='cd ~/work/yalp-assay-qc-api'
|
|
alias assay='cd ~/work/yalp-assay-qc'
|
|
alias lvsync='cd ~/work/yalp-lv-sync'
|
|
|
|
# YALP Core development aliases
|
|
alias yalp:db:password='core && yalp-db-pw-dev | pbcopy'
|
|
alias yalp:db:rebuild='core && make local_db_destroy && make local_db_init && make local_db_start'
|
|
alias yalp:db:start='core && make local_db_start'
|
|
alias yalp:db:stop='core && make local_db_stop'
|
|
alias yalp:api='core && make local_run_api'
|
|
alias yalp:psql='core && docker exec -it yalp-core-postgres psql -U postgres -d yalp_core_db'
|
|
alias yalp:start='core && make local_db_start && make local_run_api'
|
|
|
|
# YALP Core perf testing — close all boring tunnels, kill stale API, start perf DB + API (backgrounded)
|
|
alias yalp:perf='core && boring list 2>/dev/null | tail -n +2 | awk "{print \$2}" | while read -r t; do boring close "$t" 2>/dev/null; done; lsof -ti :9258 | xargs kill 2>/dev/null; make local_container_db && make local_perf_db_start && make local_perf_run_api &>/dev/null & echo "YALP Core perf API starting on :9258 (pid $!)"'
|
|
alias yalp:perf:stop='lsof -ti :9258 | xargs kill 2>/dev/null && echo "YALP Core perf API stopped" || echo "No process on :9258"'
|
|
|
|
# Collect knowledgebase docs from all ~/work projects into ~/work/knowledgebases.
|
|
# Shareable with teammates — no site-specific dependencies.
|
|
kb-sync() {
|
|
local src_base="$HOME/work"
|
|
local dest_base="$HOME/work/knowledgebases"
|
|
mkdir -p "$dest_base"
|
|
for project_dir in "$src_base"/*/; do
|
|
local project="${project_dir%/}"
|
|
project="${project##*/}"
|
|
local kb_dir=""
|
|
for candidate in "$project_dir"docs/knowledgebase "$project_dir"documentation/knowledgebase; do
|
|
[[ -d "$candidate" ]] && kb_dir="$candidate" && break
|
|
done
|
|
[[ -z "$kb_dir" ]] && continue
|
|
echo "Syncing $project..."
|
|
rm -rf "$dest_base/$project"
|
|
cp -R "$kb_dir" "$dest_base/$project"
|
|
done
|
|
echo "Done. Knowledgebases collected in $dest_base"
|
|
}
|
|
|
|
# Build and publish the browsable knowledgebase site to GitLab Pages.
|
|
# Runs kb-sync first, then updates the site repo.
|
|
kb-publish() {
|
|
local dest_base="$HOME/work/knowledgebases"
|
|
local site_repo="$HOME/work/yalp-knowledgebases"
|
|
kb-sync
|
|
if [[ ! -d "$site_repo" ]]; then
|
|
echo "Site repo not found at $site_repo — clone ewagoner/yalp-knowledgebases first."
|
|
return 1
|
|
fi
|
|
echo "Updating site repo..."
|
|
rsync -av --delete "$dest_base/" "$site_repo/knowledgebases/"
|
|
python3 "$site_repo/scripts/build_site.py"
|
|
(cd "$site_repo" && git add -A && git commit -m "sync: $(date +%Y-%m-%d)" && git push)
|
|
echo "Site published."
|
|
}
|
|
|
|
# Natera repos use master as primary; rewrite "git switch main" to "git switch master"
|
|
git() {
|
|
if [[ "$1" == "switch" && "${2:-}" == "main" ]]; then
|
|
command git switch master "${@:3}"
|
|
else
|
|
command git "$@"
|
|
fi
|
|
}
|
|
|
|
# Sensitive values (AWS profile, OTEL endpoint, cert paths, refresh alias) are in zshrc-natera.private
|
|
# Copy zshrc-natera.private.example to zshrc-natera.private and fill in. That file is gitignored.
|
|
[[ -f ~/dotfiles/zshrc-natera.private ]] && source ~/dotfiles/zshrc-natera.private
|