ai-control: Linux-Testskripte (setup-config, start-claude)
This commit is contained in:
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
# Bereitet ~/.config/ai-control auf einer frischen Maschine vor — dasselbe
|
||||
# Layout, das die App anlegt:
|
||||
# settings.json App-Settings (claudeCommand; poolSyncDir ungesetzt = lokal)
|
||||
# projects.json Projekt-Registry (Name -> Pfad, ~-relativ)
|
||||
# icons/ gemeinsames Icon-Verzeichnis
|
||||
# pools/<pool>/ oauth-Pool: pool.json, settings.json, CLAUDE.md
|
||||
# Vorhandene Dateien bleiben unangetastet.
|
||||
#
|
||||
# Aufruf: setup-config.sh [pool-id] (Default: private)
|
||||
set -euo pipefail
|
||||
|
||||
pool="${1:-private}"
|
||||
config="$HOME/.config/ai-control"
|
||||
pooldir="$config/pools/$pool"
|
||||
|
||||
mkdir -p "$config/icons" "$pooldir"
|
||||
|
||||
[ -f "$config/settings.json" ] || cat > "$config/settings.json" <<'EOF'
|
||||
{
|
||||
"claudeCommand": "claude"
|
||||
}
|
||||
EOF
|
||||
|
||||
[ -f "$config/projects.json" ] || echo '{}' > "$config/projects.json"
|
||||
|
||||
[ -f "$pooldir/pool.json" ] || cat > "$pooldir/pool.json" <<EOF
|
||||
{
|
||||
"name": "$pool",
|
||||
"credentialType": "oauth"
|
||||
}
|
||||
EOF
|
||||
|
||||
# UI-Defaults wie init_pool_config: Prompt-Vorschläge/Away-Summary aus
|
||||
[ -f "$pooldir/settings.json" ] || cat > "$pooldir/settings.json" <<'EOF'
|
||||
{
|
||||
"promptSuggestionEnabled": false,
|
||||
"awaySummaryEnabled": false
|
||||
}
|
||||
EOF
|
||||
|
||||
[ -f "$pooldir/CLAUDE.md" ] || : > "$pooldir/CLAUDE.md"
|
||||
|
||||
echo "fertig: $config (Pool: $pool)"
|
||||
Executable
+29
@@ -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"
|
||||
Reference in New Issue
Block a user