ai-control: start-claude.sh auf Einzeiler reduziert
This commit is contained in:
@@ -1,29 +1,3 @@
|
||||
#!/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"
|
||||
cd "$(dirname "$0")"
|
||||
CLAUDE_CONFIG_DIR=~/.config/ai-control/pools/private exec claude
|
||||
|
||||
Reference in New Issue
Block a user