Implementation:20000419 Fauxnix installClaudeShell
| Knowledge Sources | |
|---|---|
| Domains | Install, Environment_Management, Agent_Integration |
| Last Updated | 2026-10-26 00:00 GMT |
Overview
Concrete installer that builds the bash.exe launcher, saves the previous CLAUDE_CODE_GIT_BASH_PATH value, and sets the user-level environment variable so Claude Code's built-in Bash tool runs commands through fauxnix.
Description
The installClaudeShell function (src/facade-launch.ts) is the entry point for fauxnix install --claude-shell. It calls buildLauncher to produce bash.exe, reads the current CLAUDE_CODE_GIT_BASH_PATH user env var via getUserEnv, saves the previous value to claude-shell.previous.txt (if different and not already saved), and sets the user-level env var to the launcher path via setUserEnv (which calls PowerShell [Environment]::SetEnvironmentVariable('...', value, 'User')). It returns status lines guiding the user to restart Claude Code from a new terminal. uninstallClaudeShell (--claude-shell-off) restores or clears the previous value and removes bash.exe, the marker file, and the previous-value file.
Usage
Run via fauxnix install --claude-shell (install) or fauxnix install --claude-shell-off (uninstall/restore). The CLI prints the returned status lines.
Code Reference
Source Location
- Repository: fauxnix
- File: src/facade-launch.ts
- Lines: installClaudeShell L206-224; uninstallClaudeShell L227-243; setUserEnv L176-182; getUserEnv L184-196; SHELL_ENV L198; PREVIOUS_FILE L199
Signature
export async function setUserEnv(name: string, value: string | null): Promise<void>;
export async function getUserEnv(name: string): Promise<string | null>;
export async function installClaudeShell(env?: NodeJS.ProcessEnv): Promise<string[]>;
export async function uninstallClaudeShell(env?: NodeJS.ProcessEnv): Promise<string[]>;
Import
import { installClaudeShell, uninstallClaudeShell } from './facade-launch.js';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| env | NodeJS.ProcessEnv | No | Override process.env for the launcher dir and env-var I/O |
Outputs
| Name | Type | Description |
|---|---|---|
| (return) | string[] | Status lines (launcher ready, saved previous, set env, restart hint, undo hint) |
Usage Examples
Install
import { installClaudeShell } from './facade-launch.js';
for (const line of await installClaudeShell()) console.log(line);
// "launcher ready: C:\...\bash.exe"
// "set user CLAUDE_CODE_GIT_BASH_PATH=C:\...\bash.exe"
// "restart Claude Code from a new terminal to pick it up"
Uninstall / Restore
import { uninstallClaudeShell } from './facade-launch.js';
for (const line of await uninstallClaudeShell()) console.log(line);
// "restored CLAUDE_CODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe"
// "removed launcher: C:\...\fauxnix\bin\bash.exe"