-
Notifications
You must be signed in to change notification settings - Fork 322
Expand file tree
/
Copy pathcli.ts
More file actions
45 lines (42 loc) · 1.33 KB
/
cli.ts
File metadata and controls
45 lines (42 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export function isTopLevelHelpInvocation(args: string[]): boolean {
return args[0] === "--help";
}
export function isInteractiveNoArgInvocation(
args: string[],
stdinIsTTY: boolean | undefined,
): boolean {
return args.length === 0 && stdinIsTTY === true;
}
export function formatTopLevelHelp(): string {
return [
"Usage:",
" plannotator --help",
" plannotator [--browser <name>]",
" plannotator review [PR_URL]",
" plannotator annotate <file.md | file.html | https://... | folder/> [--no-jina]",
" plannotator last",
" plannotator copy-last",
" plannotator archive",
" plannotator sessions",
" plannotator improve-context",
"",
"Note:",
" running 'plannotator' without arguments is for hook integration and expects JSON on stdin",
].join("\n");
}
export function formatInteractiveNoArgClarification(): string {
return [
"plannotator (without arguments) is usually launched automatically by Claude Code hooks.",
"It expects hook JSON on stdin.",
"",
"For interactive use, try:",
" plannotator review",
" plannotator annotate <file.md | file.html | https://...>",
" plannotator last",
" plannotator copy-last",
" plannotator archive",
" plannotator sessions",
"",
"Run 'plannotator --help' for top-level usage.",
].join("\n");
}