cli-lsp-client 1.0.0 → 1.2.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/cli-lsp-client +0 -0
- package/package.json +1 -1
- package/src/cli.ts +11 -0
package/cli-lsp-client
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { startDaemon } from './daemon.js';
|
|
|
5
5
|
import { runCommand } from './client.js';
|
|
6
6
|
import { formatDiagnosticsPlain } from './lsp/formatter.js';
|
|
7
7
|
import type { Diagnostic } from './lsp/types.js';
|
|
8
|
+
import { HELP_MESSAGE } from './constants.js';
|
|
8
9
|
|
|
9
10
|
export async function handleClaudeCodeHook(filePath: string): Promise<{ hasIssues: boolean; output: string }> {
|
|
10
11
|
// Check if file exists
|
|
@@ -51,6 +52,10 @@ export async function handleClaudeCodeHook(filePath: string): Promise<{ hasIssue
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
function showHelp(): void {
|
|
56
|
+
console.log(HELP_MESSAGE);
|
|
57
|
+
}
|
|
58
|
+
|
|
54
59
|
async function run(): Promise<void> {
|
|
55
60
|
const args = process.argv.slice(2);
|
|
56
61
|
const command = args[0] || 'status';
|
|
@@ -62,6 +67,12 @@ async function run(): Promise<void> {
|
|
|
62
67
|
return;
|
|
63
68
|
}
|
|
64
69
|
|
|
70
|
+
// Handle help command directly (no daemon needed)
|
|
71
|
+
if (command === 'help' || command === '--help' || command === '-h') {
|
|
72
|
+
showHelp();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
65
76
|
// Handle claude-code-hook command directly (reads JSON from stdin)
|
|
66
77
|
if (command === 'claude-code-hook') {
|
|
67
78
|
try {
|