Files
pxe_boot_alma/scripts/set_cline_provider.sh
T
andersenandClaude Fable 5 6d398b826a refactor: move tree under homelab/, add alma10 hardening and kickstart docs
- restructure boot/kickstarts/scripts/docs into homelab/
- docs: alma9->10 breaking changes, CIS hardening, kickstart changes
- add find_cron_entries.sh helper and codex running memory notes

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-06 22:35:07 -04:00

52 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT=/usr/local/valherun/pxe_boot_alma
DB=/home/valherun/.config/Code/User/globalStorage/state.vscdb
KEY=saoudrizwan.claude-dev
profile="${1:-local-mistral}"
case "$profile" in
local|local-mistral|mistral)
preset="$ROOT/scripts/cline-presets/local-mistral-openai.json"
;;
remote|remote-qwen|qwen)
preset="$ROOT/scripts/cline-presets/remote-qwen-openai.json"
;;
*)
echo "usage: $0 {local-mistral|remote-qwen}" >&2
exit 1
;;
esac
python3 - "$DB" "$KEY" "$preset" <<'PY'
import json
import sqlite3
import sys
db_path, key, preset_path = sys.argv[1:4]
with open(preset_path, "r", encoding="utf-8") as f:
preset = json.load(f)
conn = sqlite3.connect(db_path)
cur = conn.cursor()
row = cur.execute("select value from ItemTable where key=?", (key,)).fetchone()
state = {}
if row and row[0]:
try:
state = json.loads(row[0])
except Exception:
state = {}
state.update(preset)
value = json.dumps(state, separators=(",", ":"))
cur.execute(
"insert into ItemTable(key, value) values(?, ?) on conflict(key) do update set value=excluded.value",
(key, value),
)
conn.commit()
conn.close()
print(value)
PY