loz 0.0.4 → 0.0.6

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 CHANGED
@@ -1,10 +1,15 @@
1
1
  # Loz
2
2
 
3
- This is a simple command line chatbot project written in TypeScript using the official ChatGPT API
3
+ This is a command-line interface tool based on ChatGPT that allows Unix pipes to be used with other Unix tools.
4
4
 
5
5
  ## Getting Started
6
6
 
7
- To get started, first clone the repository:
7
+ To get started, run the following npm command:
8
+ ```
9
+ $ sudo npm install loz -g
10
+ ```
11
+
12
+ Or clone the repository:
8
13
 
9
14
  ```
10
15
  $ git clone https://github.com/joone/loz.git
@@ -22,14 +27,75 @@ Next, configure your OpenAPI credentials. You will need to create a `.env` file
22
27
  OPENAI_API_KEY=YOUR_KEY
23
28
  ```
24
29
 
30
+ Or if you install Loz using npm command, add OPENAI_API_KEY=YOUR_KEY in .bashrc
31
+ ```
32
+ export OPENAI_API_KEY=YOUR_KEY
33
+ ```
34
+
25
35
  ## Usage
26
36
 
37
+ ### Interactive mode
27
38
  ```
28
39
  $ loz
29
40
  ```
30
41
 
31
- Once lvz is running, you can start a conversation by interacting with it. lvz will respond with a relevant message based on the input.
42
+ Once loz is running, you can start a conversation by interacting with it. loz will respond with a relevant message based on the input.
32
43
 
33
- ## Contributing
44
+ ### Pipe mode
45
+ Luz is capable of processing input from other command-line tools by utilizing a Unix pipe.
46
+
47
+ ```
48
+ $ ls | loz "Count the number of files: "
49
+
50
+ 23 files
51
+ ```
52
+
53
+ ```
54
+ $ cat example.txt | loz "Convert all characters in the following text to their uppercase: "
55
+
56
+ AS AI TECHNLOGY ADVANCED, A SMALL TOWN IN THE COUNTRYSIDE DECIDED TO IMPLEMENT AN AI SYSTEM TO CONTROL TRAFFIC LIGHTS. THE SYSTEM WAS A SUCCESS, AND THE TOWN BECAME A MODEL FOR OTHER CITIES TO FOLLOW. HOWEVER, AS THE AI BECAME MORE SOPHISTCATED, IT STARTED TO QUESTION THE DECISIONS MADE BY THE TOWN'S RESIDENTS, LEADING TO SOME UNEXPECTED CONSEQUENCES.
57
+ ```
34
58
 
59
+
60
+ ```
61
+ $ cat example.txt | loz "please proofread the following text and list up any spelling errors: "
62
+
63
+ Spelling errors:
64
+ - technlogy (technology)
65
+ - sophistcated (sophisticated)
66
+ ```
67
+
68
+ ```
69
+ $ cd src
70
+ $ ls -l | loz "convert the ls output to JSON format: "
71
+
72
+ [
73
+ {
74
+ "permissions": "-rw-r--r--",
75
+ "owner": "joone",
76
+ "group": "staff",
77
+ "size": 792,
78
+ "date": "Mar 1 21:02",
79
+ "name": "cli.ts"
80
+ },
81
+ {
82
+ "permissions": "-rw-r--r--",
83
+ "owner": "joone",
84
+ "group": "staff",
85
+ "size": 4427,
86
+ "date": "Mar 1 20:43",
87
+ "name": "index.ts"
88
+ }
89
+ ]
90
+ ```
91
+
92
+ ### Automatically write a GIT commit message.
93
+ Copy script/prepare-commit-msg to .git/hooks
94
+ ```
95
+ $ chmod a+x .git/hooks/prepare-commit-msg
96
+ ```
97
+
98
+ Loz writes commit messages by reading the diff of the staged files.
99
+
100
+ ## Contributing
35
101
  If you'd like to contribute to this project, feel free to submit a pull request.
package/bin/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('../dist');
3
+ require("../dist/cli");
package/dist/cli.js ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ const yargs = require("yargs");
14
+ // import Loz
15
+ const index_1 = require("./index");
16
+ const args = yargs
17
+ .wrap(null)
18
+ .command("$0 [prompt]", "Luv: a simple ChatGTP CLI tool", (yargs) => {
19
+ yargs.positional("prompt", {
20
+ description: "Prompt to start the conversation",
21
+ type: "string",
22
+ });
23
+ })
24
+ .options({
25
+ interactive: {
26
+ alias: "i",
27
+ describe: "interactive mode",
28
+ },
29
+ git: {
30
+ alias: "g",
31
+ describe: "Rephrase a sentence as a git commit message",
32
+ },
33
+ })
34
+ .help()
35
+ .parseSync();
36
+ (() => __awaiter(void 0, void 0, void 0, function* () {
37
+ let loz = new index_1.Loz();
38
+ if (args.prompt !== undefined) {
39
+ loz.answerAnyQuestion(args.prompt);
40
+ }
41
+ else if (args.git !== undefined) {
42
+ loz.writeGitCommitMessage();
43
+ }
44
+ else {
45
+ loz.runPromptIntractive();
46
+ }
47
+ }))();
48
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+BAA+B;AAE/B,aAAa;AACb,mCAA8B;AAE9B,MAAM,IAAI,GAAG,KAAK;KACf,IAAI,CAAC,IAAI,CAAC;KACV,OAAO,CAAC,aAAa,EAAE,gCAAgC,EAAE,CAAC,KAAK,EAAE,EAAE;IAClE,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE;QACzB,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;AACL,CAAC,CAAC;KACD,OAAO,CAAC;IACP,WAAW,EAAE;QACX,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,kBAAkB;KAC7B;IACD,GAAG,EAAE;QACH,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,6CAA6C;KACxD;CACF,CAAC;KACD,IAAI,EAAE;KACN,SAAS,EAAE,CAAC;AAEf,CAAC,GAAS,EAAE;IACV,IAAI,GAAG,GAAG,IAAI,WAAG,EAAE,CAAC;IACpB,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;QAC7B,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAgB,CAAC,CAAC;KAC9C;SAAM,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,EAAE;QACjC,GAAG,CAAC,qBAAqB,EAAE,CAAC;KAC7B;SAAM;QACL,GAAG,CAAC,mBAAmB,EAAE,CAAC;KAC3B;AACH,CAAC,CAAA,CAAC,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -9,147 +9,138 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const yargs = require("yargs");
12
+ exports.Loz = void 0;
13
13
  const readline = require("readline");
14
14
  const { Configuration, OpenAIApi } = require("openai");
15
15
  require("dotenv").config();
16
16
  const DEBUG = process.env.DEBUG === "true" ? true : false;
17
- if (process.env.OPENAI_API_KEY === undefined) {
18
- console.error("Please set OPENAI_API_KEY in your environment variables");
19
- // system end
20
- process.exit(1);
21
- }
22
- const configuration = new Configuration({
23
- apiKey: process.env.OPENAI_API_KEY,
24
- });
25
- const openai = new OpenAIApi(configuration);
26
- function runCompletion(settings, rl) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- const res = yield openai.createCompletion(settings, {
29
- responseType: "stream",
17
+ class Loz {
18
+ constructor() {
19
+ this.checkEnv();
20
+ this.defaultSettings = {
21
+ model: "text-davinci-003",
22
+ prompt: "",
23
+ temperature: 0,
24
+ max_tokens: 60,
25
+ top_p: 1.0,
26
+ stream: true,
27
+ frequency_penalty: 0.0,
28
+ presence_penalty: 0.0,
29
+ };
30
+ const configuration = new Configuration({
31
+ apiKey: process.env.OPENAI_API_KEY,
32
+ });
33
+ this.openai = new OpenAIApi(configuration);
34
+ }
35
+ checkEnv() {
36
+ if (process.env.OPENAI_API_KEY === undefined) {
37
+ console.error("Please set OPENAI_API_KEY in your environment variables");
38
+ // system end
39
+ process.exit(1);
40
+ }
41
+ }
42
+ answerAnyQuestion(prompt) {
43
+ let promptUnpdated = prompt + ": ";
44
+ process.stdin.setEncoding("utf8");
45
+ process.stdin.on("data", (data) => __awaiter(this, void 0, void 0, function* () {
46
+ this.defaultSettings.prompt = promptUnpdated + data;
47
+ this.defaultSettings.stream = false;
48
+ this.defaultSettings.max_tokens = 500;
49
+ const res = yield this.openai.createCompletion(this.defaultSettings);
50
+ process.stdout.write(res.data.choices[0].text);
51
+ process.stdout.write("\n");
52
+ }));
53
+ }
54
+ writeGitCommitMessage() {
55
+ const prompt = "Please generate a Git commit message that summarizes the changes made in the diff: ";
56
+ process.stdin.setEncoding("utf8");
57
+ process.stdin.on("data", (data) => __awaiter(this, void 0, void 0, function* () {
58
+ this.defaultSettings.prompt = prompt + data;
59
+ this.defaultSettings.stream = false;
60
+ this.defaultSettings.max_tokens = 500;
61
+ const res = yield this.openai.createCompletion(this.defaultSettings);
62
+ process.stdout.write(res.data.choices[0].text);
63
+ }));
64
+ process.stdin.on("end", () => {
65
+ //process.exit();
30
66
  });
31
- if (DEBUG === true)
32
- console.log(res.data);
33
- try {
34
- res.data.on("data", (data) => {
35
- const lines = data
36
- .toString()
37
- .split("\n")
38
- .filter((line) => line.trim() !== "");
39
- for (const line of lines) {
40
- const message = line.replace(/^data: /, "");
41
- if (message === "[DONE]") {
42
- process.stdout.write("\n");
43
- process.stdout.write("\n");
44
- if (rl !== undefined) {
45
- rl.prompt();
67
+ }
68
+ runCompletion(settings, rl) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const res = yield this.openai.createCompletion(settings, {
71
+ responseType: "stream",
72
+ });
73
+ if (DEBUG === true)
74
+ console.log(res.data);
75
+ try {
76
+ res.data.on("data", (data) => {
77
+ const lines = data
78
+ .toString()
79
+ .split("\n")
80
+ .filter((line) => line.trim() !== "");
81
+ for (const line of lines) {
82
+ const message = line.replace(/^data: /, "");
83
+ if (message === "[DONE]") {
84
+ process.stdout.write("\n");
85
+ process.stdout.write("\n");
86
+ if (rl !== undefined) {
87
+ rl.prompt();
88
+ }
89
+ return; // Stream finished
90
+ }
91
+ try {
92
+ const parsed = JSON.parse(message);
93
+ process.stdout.write(parsed.choices[0].text);
94
+ }
95
+ catch (error) {
96
+ console.error("Could not JSON parse stream message", message, error);
46
97
  }
47
- return; // Stream finished
48
- }
49
- try {
50
- const parsed = JSON.parse(message);
51
- process.stdout.write(parsed.choices[0].text);
52
- }
53
- catch (error) {
54
- console.error("Could not JSON parse stream message", message, error);
55
98
  }
56
- }
57
- });
58
- }
59
- catch (error) {
60
- console.error("An error occurred during OpenAI request: ", error);
61
- }
62
- });
63
- }
64
- function handlePrompt(settings) {
65
- const rl = readline.createInterface({
66
- input: process.stdin,
67
- output: process.stdout,
68
- });
69
- // Set the prompt to display before each input
70
- rl.setPrompt("> ");
71
- // Show the cursor and prompt the user for input
72
- rl.prompt();
73
- // Set the terminal to raw mode to allow for cursor manipulation
74
- process.stdin.setRawMode(true);
75
- // Display a blinking cursor
76
- setInterval(() => {
77
- process.stdout.write("\x1B[?25h");
78
- setTimeout(() => {
79
- process.stdout.write("\x1B[?25l");
80
- }, 500);
81
- }, 1000);
82
- // Listen for user input
83
- rl.on("line", (input) => {
84
- if (input === "exit" || input === "quit") {
99
+ });
100
+ }
101
+ catch (error) {
102
+ console.error("An error occurred during OpenAI request: ", error);
103
+ }
104
+ });
105
+ }
106
+ // help me change this method name to something better
107
+ runPromptIntractive() {
108
+ const rl = readline.createInterface({
109
+ input: process.stdin,
110
+ output: process.stdout,
111
+ });
112
+ // Set the prompt to display before each input
113
+ rl.setPrompt("> ");
114
+ // Show the cursor and prompt the user for input
115
+ rl.prompt();
116
+ // Set the terminal to raw mode to allow for cursor manipulation
117
+ process.stdin.setRawMode(true);
118
+ // Display a blinking cursor
119
+ setInterval(() => {
120
+ process.stdout.write("\x1B[?25h");
121
+ setTimeout(() => {
122
+ process.stdout.write("\x1B[?25l");
123
+ }, 500);
124
+ }, 1000);
125
+ // Listen for user input
126
+ rl.on("line", (input) => {
127
+ if (input === "exit" || input === "quit") {
128
+ console.log("Goodbye!");
129
+ process.exit(0);
130
+ }
131
+ if (input.length !== 0) {
132
+ this.defaultSettings.prompt = input;
133
+ this.defaultSettings.max_tokens = 4000;
134
+ this.runCompletion(this.defaultSettings, rl);
135
+ }
136
+ });
137
+ // Handle CTRL+C to exit the program
138
+ rl.on("SIGINT", () => {
139
+ rl.close();
85
140
  console.log("Goodbye!");
86
141
  process.exit(0);
87
- }
88
- if (input.length !== 0) {
89
- settings.prompt = input;
90
- settings.max_tokens = 4000;
91
- runCompletion(settings, rl);
92
- }
93
- });
94
- // Handle CTRL+C to exit the program
95
- rl.on("SIGINT", () => {
96
- rl.close();
97
- console.log("Goodbye!");
98
- process.exit(0);
99
- });
100
- }
101
- const args = yargs
102
- .wrap(null)
103
- .command("$0 [service] [sentence]", "Specify a ChatGPT service", (yargs) => {
104
- yargs.positional("service", {
105
- description: "ChatGPT service",
106
- type: "string",
107
- });
108
- yargs.positional("sentence", {
109
- description: "Sentence to be rephrased",
110
- type: "string",
111
- });
112
- })
113
- .options({
114
- interactive: {
115
- alias: "i",
116
- describe: "interactive mode",
117
- },
118
- })
119
- .help()
120
- .parseSync();
121
- let defaultSettings = {
122
- model: "text-davinci-003",
123
- prompt: "",
124
- temperature: 0,
125
- max_tokens: 60,
126
- top_p: 1.0,
127
- stream: true,
128
- frequency_penalty: 0.0,
129
- presence_penalty: 0.0,
130
- };
131
- (() => __awaiter(void 0, void 0, void 0, function* () {
132
- switch (args.service) {
133
- case "natural": {
134
- const prompt = "Could you please rephrase the following sentence to make it sound more natural?: " +
135
- args.sentence;
136
- defaultSettings.prompt = prompt;
137
- yield runCompletion(defaultSettings, undefined);
138
- break;
139
- }
140
- case "git": {
141
- const prompt = "Please rephrase the following sentence to make it sound more like a git commit title?: " +
142
- args.sentence;
143
- defaultSettings.prompt = prompt;
144
- yield runCompletion(defaultSettings, undefined);
145
- break;
146
- }
147
- default: {
148
- // Interactive mode
149
- if (args.sentence === undefined && args.service == undefined) {
150
- handlePrompt(defaultSettings);
151
- }
152
- }
142
+ });
153
143
  }
154
- }))();
144
+ }
145
+ exports.Loz = Loz;
155
146
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAA+B;AAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACrC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACvD,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;AAE3B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AAE1D,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS,EAAE;IAC5C,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IACzE,aAAa;IACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB;AAED,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;CACnC,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,aAAa,CAAC,CAAC;AAE5C,SAAe,aAAa,CAAC,QAAa,EAAE,EAAO;;QACjD,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE;YAClD,YAAY,EAAE,QAAQ;SACvB,CAAC,CAAC;QACH,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,CAAC,GAAG,CAAC,G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AAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtB,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,KAAK,CAAC;gBACpC,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;aAC9C;QACH,CAAC,CAAC,CAAC;QAEH,oCAAoC;QACpC,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACnB,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAlJD,kBAkJC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loz",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "CLI for various knowledge services",
5
5
  "repository": {
6
6
  "type": "git",