Skip to content

Commit d01e12e

Browse files
committed
docs(readme): оновлено документацію для WSL та видалено автозбереження налаштувань
1 parent 36d2de6 commit d01e12e

2 files changed

Lines changed: 21 additions & 30 deletions

File tree

‎README.md‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ You're already investing in Claude Code – whether it's Pro, Max ×5, or Max ×
2222
- **Model selection**: Choose between Haiku (fast), Sonnet (balanced), or Opus (most capable)
2323
- **Multilingual support**: Works in English, Ukrainian, and Chinese
2424
- **Flexible backend**: Automatically uses Claude CLI, with API fallback option
25-
- **Auto-discovery & caching**: Finds and remembers your Claude CLI path automatically
25+
- **Smart runtime detection**: Finds Claude CLI from your PATH at runtime without modifying settings (perfect for WSL)
26+
- **In-memory caching**: Remembers the detected CLI path during your session for performance
2627
- **Progress indicators**: See exactly what's happening during generation
2728
- **Seamless VS Code integration**: Works directly with the built-in Git interface
2829

@@ -33,6 +34,14 @@ You're already investing in Claude Code – whether it's Pro, Max ×5, or Max ×
3334
- Git repository initialized in your workspace
3435
- Internet connection for AI generation
3536

37+
### WSL Compatibility
38+
39+
This extension works seamlessly in Windows Subsystem for Linux (WSL) environments. The extension automatically detects the Claude CLI from the system's PATH at runtime without modifying your settings, ensuring compatibility across both Windows and WSL environments:
40+
41+
- **On Windows**: The extension finds `claude.exe` from the Windows PATH
42+
- **In WSL**: The extension finds `claude` from the Linux PATH
43+
- **No conflicts**: Leaving `claudeCommit.cliPath` empty allows automatic detection in both environments
44+
3645
## Installation
3746

3847
1. Install the extension from the VS Code Marketplace
@@ -172,7 +181,7 @@ Restricts temporary prompt file permissions to owner-only (0600) on Linux/macOS.
172181

173182
### Claude CLI not found
174183

175-
The extension uses intelligent auto-detection to find Claude CLI. If it's not found automatically:
184+
The extension uses intelligent auto-detection to find Claude CLI **at runtime** without modifying your settings. If it's not found automatically:
176185

177186
1. **On first use**: The extension will prompt you to configure the path:
178187
- **Browse for CLI**: Opens a file picker to locate the executable
@@ -185,15 +194,17 @@ The extension uses intelligent auto-detection to find Claude CLI. If it's not fo
185194
```
186195
This shows the path (e.g., `/Users/you/.nvm/versions/node/v22.13.0/bin/claude`)
187196

188-
3. **Configure the path in settings**:
197+
3. **Configure the path in settings** (only if needed):
189198
- Open VS Code Settings (Cmd+, or Ctrl+,)
190199
- Search for "claudeCommit.cliPath"
191200
- Paste the path from step 2
201+
- **Note**: Leave this empty for automatic runtime detection (recommended for WSL users)
192202

193-
4. **Auto-detection locations** (checked in order):
194-
- User-configured path in settings
195-
- System PATH (via `which claude`)
196-
- Shell profile paths (~/.zshrc, ~/.bashrc)
203+
4. **Auto-detection locations** (checked in order at runtime):
204+
- User-configured path in settings (if set)
205+
- In-memory cache (from previous detection in current session)
206+
- System PATH (via `which claude` or `where claude`)
207+
- Shell profile paths (~/.zshrc, ~/.bashrc on Unix-like systems)
197208
- Common installation paths:
198209
- `/usr/local/bin/claude`
199210
- `/opt/homebrew/bin/claude`
@@ -207,8 +218,9 @@ The extension uses intelligent auto-detection to find Claude CLI. If it's not fo
207218
```
208219

209220
6. **Common issues**:
210-
- **NVM users**: Auto-detection now supports NVM paths, but you may need to configure manually once
211-
- **macOS**: The extension now loads shell profiles to find paths
221+
- **WSL users**: Keep `claudeCommit.cliPath` empty to allow runtime detection in both Windows and WSL
222+
- **NVM users**: Auto-detection supports NVM paths via shell profile sourcing
223+
- **macOS**: The extension loads shell profiles to find paths
212224
- **Windows**: Checks common npm installation directories
213225

214226
### No commit message generated

‎src/cli/detection.ts‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,6 @@ async function findCliWithGlob(pattern: string): Promise<string | null> {
7272
return null;
7373
}
7474

75-
async function autoSaveCliPath(cliPath: string): Promise<void> {
76-
const config = vscode.workspace.getConfiguration("claudeCommit");
77-
const currentPath = config.get<string>("cliPath");
78-
79-
if (!currentPath || !currentPath.trim()) {
80-
try {
81-
await config.update(
82-
"cliPath",
83-
cliPath,
84-
vscode.ConfigurationTarget.Global
85-
);
86-
console.log(`Claude CLI path auto-saved: ${cliPath}`);
87-
} catch (err) {
88-
const error = err as Error;
89-
console.warn(`Failed to auto-save CLI path: ${error.message}`);
90-
}
91-
}
92-
}
9375

9476
export async function findClaudeCliPath(): Promise<string | null> {
9577
// 1. Check user settings
@@ -118,7 +100,6 @@ export async function findClaudeCliPath(): Promise<string | null> {
118100
const foundPath = stdout.trim().split("\n")[0];
119101
if (foundPath && (await fileExists(foundPath))) {
120102
cachedCliPath = foundPath;
121-
await autoSaveCliPath(foundPath);
122103
return foundPath;
123104
}
124105
} catch {
@@ -137,7 +118,6 @@ export async function findClaudeCliPath(): Promise<string | null> {
137118
const foundPath = stdout.trim();
138119
if (foundPath && (await fileExists(foundPath))) {
139120
cachedCliPath = foundPath;
140-
await autoSaveCliPath(foundPath);
141121
return foundPath;
142122
}
143123
} catch {
@@ -151,7 +131,6 @@ export async function findClaudeCliPath(): Promise<string | null> {
151131
const found = await findCliWithGlob(p);
152132
if (found) {
153133
cachedCliPath = found;
154-
await autoSaveCliPath(found);
155134
return found;
156135
}
157136
}

0 commit comments

Comments
 (0)