Commit d7337681f2ad
Changed files (3)
dots
pi
dots/pi/agent/ensure-settings.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+# Ensure pi agent settings.json has required values without overwriting user preferences
+# This script merges required settings into ~/.pi/agent/settings.json
+
+set -euo pipefail
+
+RUNTIME_SETTINGS="$HOME/.pi/agent/settings.json"
+TEMPLATE_SETTINGS="$(dirname "$0")/settings.json"
+
+# Required settings that should always be present
+REQUIRED_SETTINGS='{
+ "hideThinkingBlock": true,
+ "quietStartup": true,
+ "skills": ["~/.config/claude/skills"]
+}'
+
+# Create runtime settings directory if it doesn't exist
+mkdir -p "$(dirname "$RUNTIME_SETTINGS")"
+
+# If runtime settings doesn't exist, copy from template
+if [ ! -f "$RUNTIME_SETTINGS" ]; then
+ echo "๐ Creating $RUNTIME_SETTINGS from template..."
+ cp "$TEMPLATE_SETTINGS" "$RUNTIME_SETTINGS"
+ exit 0
+fi
+
+# Use jq to merge required settings into existing settings
+# This preserves user settings while ensuring required ones are present
+if command -v jq >/dev/null 2>&1; then
+ echo "๐ง Ensuring required pi agent settings..."
+
+ TEMP_FILE=$(mktemp)
+ jq -s '.[0] * .[1]' "$RUNTIME_SETTINGS" <(echo "$REQUIRED_SETTINGS") > "$TEMP_FILE"
+ mv "$TEMP_FILE" "$RUNTIME_SETTINGS"
+
+ echo "โ
Pi agent settings updated:"
+ echo " - hideThinkingBlock: true"
+ echo " - quietStartup: true"
+ echo " - skills: ~/.config/claude/skills"
+else
+ echo "โ ๏ธ jq not found - cannot merge settings automatically"
+ echo " Please ensure these settings are in $RUNTIME_SETTINGS:"
+ echo " - hideThinkingBlock: true"
+ echo " - quietStartup: true"
+ echo " - skills: [\"~/.config/claude/skills\"]"
+ exit 1
+fi
dots/pi/agent/settings.json
@@ -11,6 +11,7 @@
"steeringMode": "one-at-a-time",
"followUpMode": "one-at-a-time",
"quietStartup": true,
+ "hideThinkingBlock": true,
"skills": [
"~/.config/claude/skills"
]
dots/Makefile
@@ -58,11 +58,13 @@ gh-news : ~/.config/gh-news/config.toml
all += github-notif-manager
github-notif-manager : ~/.config/github-notif-manager/config.yaml
-all += git-template copilot-hooks opencode-plugin pi-agent agent-skills agent-skill-manager-bin ai-config
+all += git-template copilot-hooks opencode-plugin pi-agent pi-agent-settings agent-skills agent-skill-manager-bin ai-config
git-template : ~/.config/git/template
copilot-hooks : ~/.config/copilot-hooks
opencode-plugin : ~/.config/opencode/plugin
pi-agent : ~/.pi/agent/extensions ~/.pi/agent/agents ~/.pi/agent/AGENTS.md ~/.pi/agent/README.md ~/.pi/agent/keybindings.json ~/.pi/agent/sessions
+pi-agent-settings : pi-agent
+ @$(dotfiles)/pi/agent/ensure-settings.sh
agent-skills : ~/.config/agent-skills
agent-skill-manager-bin : ~/bin/agent-skill-manager
ai-config : ~/.config/ai/skills ~/.config/ai/path-policies.json