Skip to content

Instantly share code, notes, and snippets.

@Dulani
Created July 30, 2026 16:04
Show Gist options
  • Select an option

  • Save Dulani/8a6bb6538029d4b8593fb48e072e8cc9 to your computer and use it in GitHub Desktop.

Select an option

Save Dulani/8a6bb6538029d4b8593fb48e072e8cc9 to your computer and use it in GitHub Desktop.
HP Pavilion x360 Setup: Diagnostics & Pi Agent Installer
#!/usr/bin/env bash
set -eo pipefail
echo "=========================================================="
echo " HP Pavilion x360 Setup: Diagnostics & Pi Agent Installer "
echo "=========================================================="
echo ""
# 1. Update system and install required tools
echo "[1/5] Installing DNF packages (Node.js, Git, Diagnostics)..."
sudo dnf install -y nodejs npm git btop s-tui lm_sensors smartmontools libinput evtest
# 2. Install Google Cloud SDK (Tarball method to avoid GPG crypto issues)
if ! command -v gcloud &> /dev/null; then
echo "[2/5] Installing Google Cloud CLI (gcloud)..."
cd ~
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz
tar -xf google-cloud-cli-linux-x86_64.tar.gz
rm google-cloud-cli-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh --quiet
# Ensure gcloud is in PATH for current session and future bash sessions
export PATH="$HOME/google-cloud-sdk/bin:$PATH"
if ! grep -q "google-cloud-sdk/bin" ~/.bashrc; then
echo 'export PATH="$HOME/google-cloud-sdk/bin:$PATH"' >> ~/.bashrc
fi
else
echo "[2/5] gcloud CLI is already installed."
fi
# 3. Install Pi Coding Agent globally
echo "[3/5] Installing Pi Coding Agent (@earendil-works/pi-coding-agent)..."
sudo npm install -g @earendil-works/pi-coding-agent
# 4. Configure Pi Agent Settings
echo "[4/5] Setting up ~/.pi/agent configuration..."
mkdir -p ~/.pi/agent/skills
cat <<'EOF' > ~/.pi/agent/settings.json
{
"defaultProvider": "google",
"defaultModel": "gemini-3.6-flash",
"defaultThinkingLevel": "high",
"enabledModels": [
"google/gemini-3.1-pro-preview",
"google/gemini-3.6-flash",
"google/gemini-3.5-flash"
]
}
EOF
# 5. Clone Agent Memory Lake repo and symlink skill
if [ ! -d "$HOME/agent_memory" ]; then
echo "[5/5] Cloning Agent Memory Lake repository..."
git clone https://github.com/Dulani/agent_memory.git "$HOME/agent_memory"
else
echo "[5/5] agent_memory repository already exists."
fi
ln -sfn "$HOME/agent_memory" "$HOME/.pi/agent/skills/agent-memory"
echo ""
echo "=========================================================="
echo " Setup Successfully Completed! "
echo "=========================================================="
echo ""
echo "Next Steps to complete setup:"
echo " 1) Authenticate Google Cloud CLI:"
echo " gcloud auth login"
echo " gcloud config set project long-acres"
echo ""
echo " 2) Set your Gemini API Key in ~/.pi/agent/auth.json:"
echo ' cat <<EOF > ~/.pi/agent/auth.json'
echo ' {'
echo ' "google": {'
echo ' "type": "api_key",'
echo ' "key": "YOUR_GEMINI_API_KEY"'
echo ' }'
echo ' }'
echo ' EOF'
echo ""
echo " 3) Test hardware for Ghost Touches / Diagnostics:"
echo " sudo libinput debug-events"
echo " btop"
echo ""
echo " 4) Launch Pi Agent and recall handoff plan:"
echo " pi"
echo ' Query: "Recall handoff-pavilion-x360-diagnostics-and-pi-setup"'
echo "=========================================================="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment