cli-lsp-client 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -5
- package/cli-lsp-client +0 -0
- package/package.json +1 -1
- package/src/cli.ts +7 -0
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@ CLI tool for getting LSP diagnostics. Uses a background daemon to keep LSP serve
|
|
|
7
7
|
- Get diagnostics from LSP servers
|
|
8
8
|
- Background daemon for fast repeated requests
|
|
9
9
|
- Built in Claude Code hook to provide feedback on file edit tool calls
|
|
10
|
+
- Comprehensive daemon management (`list`, `stop-all` commands)
|
|
11
|
+
- Multi-project support with isolated daemon instances per directory
|
|
10
12
|
|
|
11
13
|
## Supported Languages
|
|
12
14
|
|
|
@@ -40,10 +42,21 @@ Get instant diagnostic feedback for TypeScript, Python, Go, JSON, CSS, YAML, Bas
|
|
|
40
42
|
|
|
41
43
|
Configure Claude Code to use the built-in hook command:
|
|
42
44
|
|
|
43
|
-
```
|
|
45
|
+
```json
|
|
44
46
|
{
|
|
45
47
|
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
46
48
|
"hooks": {
|
|
49
|
+
"SessionStart": [
|
|
50
|
+
{
|
|
51
|
+
"matcher": "startup|resume",
|
|
52
|
+
"hooks": [
|
|
53
|
+
{
|
|
54
|
+
"type": "command",
|
|
55
|
+
"command": "npx -y cli-lsp-client warmup"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
],
|
|
47
60
|
"PostToolUse": [
|
|
48
61
|
{
|
|
49
62
|
"matcher": "Edit|MultiEdit|Write",
|
|
@@ -61,7 +74,8 @@ Configure Claude Code to use the built-in hook command:
|
|
|
61
74
|
|
|
62
75
|
#### How It Works
|
|
63
76
|
|
|
64
|
-
- Automatically
|
|
77
|
+
- **SessionStart**: Automatically warms up LSP servers when Claude Code starts for faster initial diagnostics
|
|
78
|
+
- **PostToolUse**: Runs diagnostics after each file edit (Edit, MultiEdit, Write tools)
|
|
65
79
|
- Built-in file filtering for all supported languages (11 file types)
|
|
66
80
|
- Shows errors, warnings, and hints inline
|
|
67
81
|
- Graceful error handling - never breaks your editing experience
|
|
@@ -103,16 +117,45 @@ ERROR at line 5, column 20:
|
|
|
103
117
|
Code: 2345
|
|
104
118
|
```
|
|
105
119
|
|
|
106
|
-
###
|
|
120
|
+
### Daemon Management
|
|
107
121
|
|
|
108
122
|
```bash
|
|
109
|
-
# Check daemon status
|
|
123
|
+
# Check daemon status and memory usage
|
|
110
124
|
npx cli-lsp-client status
|
|
111
125
|
|
|
112
|
-
#
|
|
126
|
+
# List all running daemons across directories
|
|
127
|
+
npx cli-lsp-client list
|
|
128
|
+
|
|
129
|
+
# Stop current directory's daemon
|
|
113
130
|
npx cli-lsp-client stop
|
|
131
|
+
|
|
132
|
+
# Stop all daemons across all directories (useful after package updates)
|
|
133
|
+
npx cli-lsp-client stop-all
|
|
134
|
+
|
|
135
|
+
# Show version
|
|
136
|
+
npx cli-lsp-client --version
|
|
137
|
+
|
|
138
|
+
# Show help
|
|
139
|
+
npx cli-lsp-client help
|
|
114
140
|
```
|
|
115
141
|
|
|
142
|
+
The `list` command shows all running daemon instances with their working directories, PIDs, and status:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
$ npx cli-lsp-client list
|
|
146
|
+
|
|
147
|
+
Running Daemons:
|
|
148
|
+
================
|
|
149
|
+
Hash | PID | Status | Working Directory
|
|
150
|
+
----------------------------------------------------------
|
|
151
|
+
h0gx9u | 12345 | ● Running | /Users/user/project-a
|
|
152
|
+
94yi9w | 12346 | ● Running | /Users/user/project-b
|
|
153
|
+
|
|
154
|
+
2/2 daemon(s) running
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Use `stop-all` when updating the CLI package to ensure all old daemon processes are terminated and fresh ones spawn with the updated code.
|
|
158
|
+
|
|
116
159
|
## Java Installation Guide
|
|
117
160
|
|
|
118
161
|
Eclipse JDT Language Server requires Java 17+ and manual setup:
|
|
@@ -159,11 +202,30 @@ pacman -S jdtls
|
|
|
159
202
|
|
|
160
203
|
For detailed setup instructions, see the [official Eclipse JDT.LS documentation](https://github.com/eclipse-jdtls/eclipse.jdt.ls).
|
|
161
204
|
|
|
205
|
+
### Additional Commands
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# Warm up LSP servers for current directory (faster subsequent requests)
|
|
209
|
+
npx cli-lsp-client warmup
|
|
210
|
+
|
|
211
|
+
# Warm up for specific directory
|
|
212
|
+
npx cli-lsp-client warmup /path/to/project
|
|
213
|
+
|
|
214
|
+
# View daemon logs
|
|
215
|
+
npx cli-lsp-client logs
|
|
216
|
+
```
|
|
217
|
+
|
|
162
218
|
## Examples
|
|
163
219
|
|
|
164
220
|
```bash
|
|
165
221
|
# Check a specific file
|
|
166
222
|
npx cli-lsp-client diagnostics src/main.ts
|
|
223
|
+
|
|
224
|
+
# List all daemon instances
|
|
225
|
+
npx cli-lsp-client list
|
|
226
|
+
|
|
227
|
+
# Stop all daemons after package update
|
|
228
|
+
npx cli-lsp-client stop-all
|
|
167
229
|
```
|
|
168
230
|
|
|
169
231
|
## Development
|
package/cli-lsp-client
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { runCommand } from './client.js';
|
|
|
6
6
|
import { formatDiagnosticsPlain } from './lsp/formatter.js';
|
|
7
7
|
import type { Diagnostic } from './lsp/types.js';
|
|
8
8
|
import { HELP_MESSAGE } from './constants.js';
|
|
9
|
+
import packageJson from '../package.json' with { type: 'json' };
|
|
9
10
|
|
|
10
11
|
export async function handleClaudeCodeHook(filePath: string): Promise<{ hasIssues: boolean; output: string }> {
|
|
11
12
|
// Check if file exists
|
|
@@ -73,6 +74,12 @@ async function run(): Promise<void> {
|
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
// Handle version command directly (no daemon needed)
|
|
78
|
+
if (command === 'version' || command === '--version' || command === '-v') {
|
|
79
|
+
console.log(packageJson.version);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
76
83
|
// Handle claude-code-hook command directly (reads JSON from stdin)
|
|
77
84
|
if (command === 'claude-code-hook') {
|
|
78
85
|
try {
|