Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Releases/v4.0.3/.claude/PAI-Install/engine/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ export async function runRepository(
emit: EngineEventHandler
): Promise<void> {
await emit({ event: "step_start", step: "repository" });
const paiDir = state.detection?.paiDir || join(homedir(), ".claude");
const paiDir = state.detection?.paiDir || process.env.PAI_DIR || join(homedir(), ".claude");

if (state.installType === "upgrade") {
await emit({ event: "progress", step: "repository", percent: 20, detail: "Existing installation found, updating..." });
Expand Down Expand Up @@ -585,7 +585,7 @@ export async function runConfiguration(
emit: EngineEventHandler
): Promise<void> {
await emit({ event: "step_start", step: "configuration" });
const paiDir = state.detection?.paiDir || join(homedir(), ".claude");
const paiDir = state.detection?.paiDir || process.env.PAI_DIR || join(homedir(), ".claude");
const configDir = state.detection?.configDir || join(homedir(), ".config", "PAI");

// Generate settings.json
Expand Down Expand Up @@ -985,7 +985,7 @@ export async function runVoiceSetup(
}

// ── Start voice server (works with or without ElevenLabs key) ──
const paiDir = state.detection?.paiDir || join(homedir(), ".claude");
const paiDir = state.detection?.paiDir || process.env.PAI_DIR || join(homedir(), ".claude");
await emit({ event: "progress", step: "voice", percent: 25, detail: "Starting voice server..." });
const voiceServerReady = await startVoiceServer(paiDir, emit);

Expand Down
2 changes: 1 addition & 1 deletion Releases/v4.0.3/.claude/PAI-Install/engine/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function detectExisting(
*/
export function detectSystem(): DetectionResult {
const home = homedir();
const paiDir = join(home, ".claude");
const paiDir = process.env.PAI_DIR || join(home, ".claude");
const configDir = process.env.PAI_CONFIG_DIR || join(home, ".config", "PAI");

return {
Expand Down
2 changes: 1 addition & 1 deletion Releases/v4.0.3/.claude/PAI-Install/engine/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function checkVoiceServerHealth(): Promise<boolean> {
* Run all validation checks against the current state.
*/
export async function runValidation(state: InstallState): Promise<ValidationCheck[]> {
const paiDir = state.detection?.paiDir || join(homedir(), ".claude");
const paiDir = state.detection?.paiDir || process.env.PAI_DIR || join(homedir(), ".claude");
const configDir = state.detection?.configDir || join(homedir(), ".config", "PAI");
const checks: ValidationCheck[] = [];

Expand Down
10 changes: 9 additions & 1 deletion Releases/v4.0.3/.claude/PAI-Install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ echo ""
echo -e "${STEEL}┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛${RESET}"
echo ""

# ─── Custom PAI_DIR Support ──────────────────────────────
# Set PAI_DIR to install PAI into a non-default directory.
# Default: ~/.claude Example: PAI_DIR=~/Albert/.claude bash install.sh
if [ -n "${PAI_DIR:-}" ]; then
info "Custom PAI_DIR: $PAI_DIR"
export PAI_DIR
fi

# ─── Resolve Script Directory ─────────────────────────────
# Follow symlinks so install.sh works from ~/.claude/ symlink
SOURCE="${BASH_SOURCE[0]}"
Expand Down Expand Up @@ -155,7 +163,7 @@ info "Launching installer..."
echo ""

# Auto-detect headless/SSH environments and fall back to CLI mode
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && [ "$(uname)" != "Darwin" ]; then
if [ -z "${DISPLAY:-}" ] && [ -z "${WAYLAND_DISPLAY:-}" ] && [ "$(uname)" != "Darwin" ]; then
INSTALL_MODE="cli"
info "Headless environment detected — using CLI installer."
else
Expand Down