Skip to content

Commit f5df111

Browse files
committed
Updated route auto-detection
1 parent ea84fdd commit f5df111

3 files changed

Lines changed: 327 additions & 33 deletions

File tree

‎README.md‎

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ You're already investing in Claude Code – whether it's Pro, Max ×5, or Max ×
3131
## Installation
3232

3333
1. Install the extension from the VS Code Marketplace
34-
2. Ensure Claude CLI is installed and available in your system PATH
34+
2. Ensure Claude CLI is installed (comes with your Claude Code subscription)
3535
3. Open a project with a Git repository
3636
4. Look for the sparkle ✨ button in your Source Control panel
37+
5. On first use, if CLI is not auto-detected, you'll be prompted to configure the path
3738

38-
**That's it!** No configuration needed if you're using Claude CLI.
39+
**That's it!** The extension will automatically find Claude CLI or guide you through one-time setup.
3940

4041
## How to Use
4142

@@ -51,64 +52,95 @@ You're already investing in Claude Code – whether it's Pro, Max ×5, or Max ×
5152

5253
This extension keeps it simple with just a few optional settings:
5354

54-
* `claude-commit.preferredMethod`: Choose AI backend (`auto`, `cli`, or `api`) – defaults to `auto`
55-
* `claude-commit.apiKey`: Your Anthropic API key (only needed if using API method)
56-
* `claude-commit.language`: Interface language (`en` for English, `ua` for Ukrainian)
55+
* `claudeCommit.cliPath`: Path to Claude CLI executable (leave empty for auto-detection)
56+
* `claudeCommit.preferredMethod`: Choose AI backend (`auto`, `cli`, or `api`) – defaults to `auto`
57+
* `claudeCommit.apiKey`: Your Anthropic API key (only needed if using API method)
58+
* `claudeCommit.language`: Interface language (`en` for English, `ua` for Ukrainian)
5759

5860
## Configuration Examples
5961

60-
### Using only Claude CLI
62+
### Auto-detection (recommended)
6163
```json
6264
{
63-
"claude-commit.preferredMethod": "cli"
65+
"claudeCommit.preferredMethod": "auto"
66+
}
67+
```
68+
The extension will automatically search for Claude CLI in common locations.
69+
70+
### Manual CLI path (for NVM users or custom installations)
71+
```json
72+
{
73+
"claudeCommit.cliPath": "/Users/you/.nvm/versions/node/v22.13.0/bin/claude",
74+
"claudeCommit.preferredMethod": "cli"
6475
}
6576
```
6677

6778
### Using Anthropic API as fallback
6879
```json
6980
{
70-
"claude-commit.preferredMethod": "auto",
71-
"claude-commit.apiKey": "your-api-key-here"
81+
"claudeCommit.preferredMethod": "auto",
82+
"claudeCommit.apiKey": "your-api-key-here"
7283
}
7384
```
7485

7586
### Ukrainian interface
7687
```json
7788
{
78-
"claude-commit.language": "ua"
89+
"claudeCommit.language": "ua"
7990
}
8091
```
8192

8293
## Troubleshooting
8394

8495
### Claude CLI not found
8596

86-
If the extension can't find Claude CLI:
97+
The extension uses intelligent auto-detection to find Claude CLI. If it's not found automatically:
98+
99+
1. **On first use**: The extension will prompt you to configure the path:
100+
- **Browse for CLI**: Opens a file picker to locate the executable
101+
- **Enter Path Manually**: Type the full path directly
102+
- **Skip (Use API)**: Fall back to API method (requires API key)
87103

88-
1. **Check Claude is installed**: Run in terminal:
104+
2. **Find your Claude CLI path manually**:
89105
```bash
90106
which claude
91107
```
92-
This should show the path to Claude (e.g., `/Users/you/.nvm/versions/node/v22.13.0/bin/claude`)
93-
94-
2. **Verify authentication**: Ensure Claude CLI is authenticated:
108+
This shows the path (e.g., `/Users/you/.nvm/versions/node/v22.13.0/bin/claude`)
109+
110+
3. **Configure the path in settings**:
111+
- Open VS Code Settings (Cmd+, or Ctrl+,)
112+
- Search for "claudeCommit.cliPath"
113+
- Paste the path from step 2
114+
115+
4. **Auto-detection locations** (checked in order):
116+
- User-configured path in settings
117+
- System PATH (via `which claude`)
118+
- Shell profile paths (~/.zshrc, ~/.bashrc)
119+
- Common installation paths:
120+
- `/usr/local/bin/claude`
121+
- `/opt/homebrew/bin/claude`
122+
- `~/.local/bin/claude`
123+
- `~/.nvm/versions/node/*/bin/claude` (NVM)
124+
- `~/.npm-global/bin/claude`
125+
126+
5. **Verify authentication**: Ensure Claude CLI is authenticated:
95127
```bash
96-
claude setup-token
128+
claude --version
97129
```
98130

99-
3. **Common issues**:
100-
- **NVM users**: VS Code might not see NVM paths – restart VS Code after installing Claude
101-
- **macOS**: If using zsh, paths might differ between terminal and VS Code
102-
- **Windows**: Ensure Claude is in your system PATH
131+
6. **Common issues**:
132+
- **NVM users**: Auto-detection now supports NVM paths, but you may need to configure manually once
133+
- **macOS**: The extension now loads shell profiles to find paths
134+
- **Windows**: Checks common npm installation directories
103135

104136
### No commit message generated
105137

106138
1. Ensure you have changes in your repository (staged or unstaged)
107139
2. Check that Claude CLI is properly authenticated
108140
3. Try using API method as fallback:
109141
- Get API key from https://console.anthropic.com/
110-
- Add to settings: `claude-commit.apiKey`
111-
- Set `claude-commit.preferredMethod` to `api`
142+
- Add to settings: `claudeCommit.apiKey`
143+
- Set `claudeCommit.preferredMethod` to `api`
112144

113145
### Extension not working
114146

@@ -118,6 +150,7 @@ If the extension can't find Claude CLI:
118150
4. Try generating a commit message manually via Command Palette:
119151
- Press `Cmd+Shift+P` (or `Ctrl+Shift+P`)
120152
- Type "Claude Commit: Generate"
153+
5. If CLI path is incorrect, clear `claudeCommit.cliPath` in settings to trigger re-detection
121154

122155
## Privacy & Security
123156

‎package.json‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "claude-git-commit",
33
"displayName": "Claude Git Commit",
44
"description": "AI-powered git commit message generator using Claude AI",
5-
"version": "1.0.2",
5+
"version": "1.0.3",
66
"publisher": "ZakhariiMelnyk",
77
"icon": "icon.png",
88
"engines": {
@@ -45,11 +45,17 @@
4545
"configuration": {
4646
"title": "Claude Commit",
4747
"properties": {
48+
"claudeCommit.cliPath": {
49+
"type": "string",
50+
"default": "",
51+
"description": "Path to Claude Code CLI executable (leave empty for auto-detection)",
52+
"order": 1
53+
},
4854
"claudeCommit.apiKey": {
4955
"type": "string",
5056
"default": "",
5157
"description": "Anthropic API key for Claude AI (optional if using Claude Code CLI)",
52-
"order": 1
58+
"order": 2
5359
},
5460
"claudeCommit.preferredMethod": {
5561
"type": "string",
@@ -60,7 +66,7 @@
6066
],
6167
"default": "auto",
6268
"description": "Preferred method for generating commits: auto (try CLI first, then API), cli (Claude Code CLI only), or api (Anthropic API only)",
63-
"order": 2
69+
"order": 3
6470
},
6571
"claudeCommit.language": {
6672
"type": "string",
@@ -74,7 +80,7 @@
7480
"Ukrainian"
7581
],
7682
"description": "Language for commit messages",
77-
"order": 3
83+
"order": 4
7884
}
7985
}
8086
}

0 commit comments

Comments
 (0)