@clutor/cli 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sagar Pinninti
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,15 @@
1
- # Temporary Holding Version
1
+ # @clutor/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The `clutor` command and local server.
4
+
5
+ ```bash
6
+ npm install -g @clutor/cli
7
+ clutor plan deepseek-v3 --ram 16 # will it fit, and how fast could it possibly go
8
+ clutor plan ./my-model.gguf # exact figures from a real file
9
+ clutor serve # OpenAI- and Ollama-compatible API on 127.0.0.1:4320, agent, MCP
10
+ clutor code "fix the failing test" --verify "npm test"
11
+ ```
12
+
13
+ Run `clutor --help`. Documentation: <https://github.com/isagarpinninti/clutor/blob/main/docs/GUIDE.md>.
14
+
15
+ It does not run models itself; it supervises [llama.cpp](https://github.com/ggml-org/llama.cpp)'s `llama-server` or talks to any OpenAI-compatible server.
package/dist/bin.js ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ main
4
+ } from "./chunk-6WAEQCCP.js";
5
+ import "./chunk-U5GHVJJO.js";
6
+
7
+ // src/bin.ts
8
+ import { mkdirSync, readFileSync, appendFileSync } from "fs";
9
+ import { homedir } from "os";
10
+ import { join } from "path";
11
+ import { createInterface } from "readline";
12
+ var rl;
13
+ var historyFile = join(homedir(), ".clutor", "history");
14
+ function readline() {
15
+ if (rl) return rl;
16
+ let history = [];
17
+ try {
18
+ history = readFileSync(historyFile, "utf8").split("\n").filter(Boolean).slice(-500).reverse();
19
+ } catch {
20
+ }
21
+ rl = createInterface({ input: process.stdin, output: process.stderr, history, historySize: 500 });
22
+ return rl;
23
+ }
24
+ var prompt = (q) => new Promise((resolve) => {
25
+ const r = readline();
26
+ const onClose = () => resolve("/exit");
27
+ r.once("close", onClose);
28
+ r.question(q, (a) => {
29
+ r.off("close", onClose);
30
+ if (a.trim()) {
31
+ try {
32
+ mkdirSync(join(homedir(), ".clutor"), { recursive: true, mode: 448 });
33
+ appendFileSync(historyFile, `${a.replace(/\n/g, " ")}
34
+ `, { mode: 384 });
35
+ } catch {
36
+ }
37
+ }
38
+ resolve(a);
39
+ });
40
+ });
41
+ main(process.argv.slice(2), {
42
+ out: (l) => console.log(l),
43
+ err: (l) => console.error(l),
44
+ cwd: process.cwd(),
45
+ ...process.stdin.isTTY ? { prompt } : {}
46
+ }).then(
47
+ (code) => process.exit(code),
48
+ (e) => {
49
+ console.error(e instanceof Error ? e.message : String(e));
50
+ process.exit(1);
51
+ }
52
+ );
53
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { mkdirSync, readFileSync, appendFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { createInterface, type Interface } from \"node:readline\";\nimport { main } from \"./cli\";\n\n// One readline interface for the whole process, so arrow-key history works across prompts and Ctrl-D ends an interactive session.\nlet rl: Interface | undefined;\nconst historyFile = join(homedir(), \".clutor\", \"history\");\nfunction readline(): Interface {\n if (rl) return rl;\n let history: string[] = [];\n try { history = readFileSync(historyFile, \"utf8\").split(\"\\n\").filter(Boolean).slice(-500).reverse(); } catch { /* no history yet */ }\n rl = createInterface({ input: process.stdin, output: process.stderr, history, historySize: 500 });\n return rl;\n}\nconst prompt = (q: string): Promise<string> => new Promise((resolve) => {\n const r = readline();\n const onClose = (): void => resolve(\"/exit\");\n r.once(\"close\", onClose);\n r.question(q, (a) => {\n r.off(\"close\", onClose);\n if (a.trim()) { try { mkdirSync(join(homedir(), \".clutor\"), { recursive: true, mode: 0o700 }); appendFileSync(historyFile, `${a.replace(/\\n/g, \" \")}\\n`, { mode: 0o600 }); } catch { /* history is a convenience */ } }\n resolve(a);\n });\n});\n\nmain(process.argv.slice(2), {\n out: (l) => console.log(l),\n err: (l) => console.error(l),\n cwd: process.cwd(),\n ...(process.stdin.isTTY ? { prompt } : {}),\n}).then(\n (code) => process.exit(code),\n (e: unknown) => {\n console.error(e instanceof Error ? e.message : String(e));\n process.exit(1);\n },\n);\n"],"mappings":";;;;;;;AACA,SAAS,WAAW,cAAc,sBAAsB;AACxD,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,uBAAuC;AAIhD,IAAI;AACJ,IAAM,cAAc,KAAK,QAAQ,GAAG,WAAW,SAAS;AACxD,SAAS,WAAsB;AAC7B,MAAI,GAAI,QAAO;AACf,MAAI,UAAoB,CAAC;AACzB,MAAI;AAAE,cAAU,aAAa,aAAa,MAAM,EAAE,MAAM,IAAI,EAAE,OAAO,OAAO,EAAE,MAAM,IAAI,EAAE,QAAQ;AAAA,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