ai-control: Linux-Testskripte (setup-config, start-claude)

This commit is contained in:
marcus.hinz
2026-07-05 19:07:36 +02:00
parent f59368fb41
commit 8567c4c3b2
2 changed files with 73 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Startet claude für ein Projekt genau wie das eingebaute ai-control-Terminal:
# cwd = Projektordner (Registry ~/.config/ai-control/projects.json),
# CLAUDE_CONFIG_DIR = Pool-Ordner (Zuordnung in <projekt>/ai-control.json),
# Kommando aus ~/.config/ai-control/settings.json (claudeCommand, Default claude).
set -euo pipefail
project="$1"
config="$HOME/.config/ai-control"
dir=$(jq -r --arg p "$project" '.[$p] // empty' "$config/projects.json")
if [ -z "$dir" ]; then
echo "Projekt nicht registriert: $project" >&2
exit 1
fi
dir="${dir/#\~/$HOME}"
cmd=$(jq -r '.claudeCommand // "claude"' "$config/settings.json")
pool=""
if [ -f "$dir/ai-control.json" ]; then
pool=$(jq -r '.pool // empty' "$dir/ai-control.json")
fi
if [ -n "$pool" ]; then
export CLAUDE_CONFIG_DIR="$config/pools/$pool"
fi
cd "$dir"
exec "${SHELL:-/bin/bash}" -ic "$cmd"