-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.ts
More file actions
84 lines (73 loc) · 2.31 KB
/
program.ts
File metadata and controls
84 lines (73 loc) · 2.31 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { Command } from "commander";
import { commandBuffer } from "./commands/buffer.js";
import { commandLog } from "./commands/chat.js";
import { commandColor } from "./commands/color.js";
import { commandComplete } from "./commands/complete.js";
import { commandFormat } from "./commands/format.js";
import { commandMain } from "./commands/main.js";
import { commandModels } from "./commands/models.js";
import { commandProviders } from "./commands/providers.js";
import { commandRepl } from "./commands/repl.js";
const program = new Command();
program
.name("chatvim")
.description("Chatvim: LLM-powered coding assistant")
.version("0.3.10")
.action(commandMain);
program
.command("buffer")
.argument("[input]", "Input text to buffer (optional; can be piped)")
.description(
"Buffer input and show a spinner while waiting (argument or stdin)",
)
.action(commandBuffer);
program
.command("color")
.argument("[input]", "Markdown input to colorize (optional; can be piped)")
.description(
"Apply syntax highlighting to Markdown input (argument or stdin)",
)
.action(commandColor);
program
.command("complete")
.argument(
"[input]",
"Prompt text to send to the LLM (optional; can be piped)",
)
.description("Send a prompt to the LLM (argument or stdin)")
.option("--chunk", "Put each chunk in a JSON object on a new line", false)
.option("--add-delimiters", "Add delimiters to the response", false)
.action(commandComplete);
program
.command("format")
.argument("[input]", "Markdown input to format (optional; can be piped)")
.description(
"Format Markdown input with proper line wrapping (argument or stdin)",
)
.action(commandFormat);
program
.command("log")
.description("Chat with a markdown file to maintain context")
.argument(
"[input]",
"Prompt text to send to the LLM (optional; can be piped)",
)
.option(
"--file <file>",
"Markdown file to use as context (optional)",
"chat.md",
)
.action(commandLog);
program
.command("models")
.description("List available models")
.action(commandModels);
program
.command("providers")
.description("List available providers")
.action(commandProviders);
program
.command("repl")
.description("Start a REPL for interactive chat with the LLM")
.action(commandRepl);
export { program };