grepper-dev 0.2.0 → 0.2.2
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 +4 -4
- package/dist/index.js +6 -44
- package/package.json +3 -10
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
#
|
|
1
|
+
# grepper-dev
|
|
2
2
|
|
|
3
3
|
Local code review powered by AI. Review your code changes before pushing, right from your terminal.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm
|
|
8
|
+
npm i -g grepper-dev
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Or use directly with npx:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npx
|
|
14
|
+
npx grepper-dev review
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Setup
|
|
@@ -78,7 +78,7 @@ Use in CI pipelines to catch issues before merge:
|
|
|
78
78
|
|
|
79
79
|
```yaml
|
|
80
80
|
- name: Review code
|
|
81
|
-
run: npx
|
|
81
|
+
run: npx grepper-dev review --base main --format json --fail-on-critical
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
## Configuration
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { Command, Option } from "commander";
|
|
|
5
5
|
import updateNotifier from "update-notifier";
|
|
6
6
|
|
|
7
7
|
// src/commands/login.ts
|
|
8
|
+
import password from "@inquirer/password";
|
|
8
9
|
import chalk from "chalk";
|
|
9
10
|
|
|
10
11
|
// src/lib/auth.ts
|
|
@@ -13,7 +14,7 @@ import { homedir } from "os";
|
|
|
13
14
|
import { join } from "path";
|
|
14
15
|
var CONFIG_DIR = join(homedir(), ".grepper");
|
|
15
16
|
var CONFIG_FILE = join(CONFIG_DIR, "config.json");
|
|
16
|
-
var DEFAULT_API_URL = "https://
|
|
17
|
+
var DEFAULT_API_URL = "https://flippant-crocodile-3.convex.site";
|
|
17
18
|
function ensureConfigDir() {
|
|
18
19
|
if (!existsSync(CONFIG_DIR)) {
|
|
19
20
|
mkdirSync(CONFIG_DIR, { recursive: true, mode: 448 });
|
|
@@ -117,50 +118,11 @@ async function runReview(options) {
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
// src/commands/login.ts
|
|
120
|
-
function promptApiKey() {
|
|
121
|
-
return new Promise((resolve) => {
|
|
122
|
-
const { stdin, stdout } = process;
|
|
123
|
-
stdout.write("Enter your API key: ");
|
|
124
|
-
const wasRaw = stdin.isRaw;
|
|
125
|
-
if (stdin.isTTY) {
|
|
126
|
-
stdin.setRawMode(true);
|
|
127
|
-
}
|
|
128
|
-
stdin.resume();
|
|
129
|
-
stdin.setEncoding("utf-8");
|
|
130
|
-
let input = "";
|
|
131
|
-
const onData = (char) => {
|
|
132
|
-
if (char === "\n" || char === "\r" || char === "") {
|
|
133
|
-
stdout.write("\n");
|
|
134
|
-
stdin.removeListener("data", onData);
|
|
135
|
-
stdin.pause();
|
|
136
|
-
if (stdin.isTTY && wasRaw !== void 0) {
|
|
137
|
-
stdin.setRawMode(wasRaw);
|
|
138
|
-
}
|
|
139
|
-
resolve(input.trim());
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (char === "\x7F" || char === "\b") {
|
|
143
|
-
if (input.length > 0) {
|
|
144
|
-
input = input.slice(0, -1);
|
|
145
|
-
stdout.write("\b \b");
|
|
146
|
-
}
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (char === "") {
|
|
150
|
-
stdout.write("\n");
|
|
151
|
-
process.exit(130);
|
|
152
|
-
}
|
|
153
|
-
input += char;
|
|
154
|
-
stdout.write("*");
|
|
155
|
-
};
|
|
156
|
-
stdin.on("data", onData);
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
121
|
async function loginCommand() {
|
|
160
122
|
console.log(chalk.bold("\n\u{1F511} Grepper Login\n"));
|
|
161
123
|
console.log("Get your API key from the Grepper dashboard:");
|
|
162
|
-
console.log(chalk.dim("https://grepper.
|
|
163
|
-
const apiKey = await
|
|
124
|
+
console.log(chalk.dim("https://grepper-web.vercel.app/dashboard/settings\n"));
|
|
125
|
+
const apiKey = await password({ message: "Enter your API key:", mask: "*" });
|
|
164
126
|
if (!apiKey) {
|
|
165
127
|
console.error(chalk.red("No API key provided."));
|
|
166
128
|
process.exit(1);
|
|
@@ -694,10 +656,10 @@ async function whoamiCommand() {
|
|
|
694
656
|
|
|
695
657
|
// src/index.ts
|
|
696
658
|
updateNotifier({
|
|
697
|
-
pkg: { name: "grepper-dev", version: "0.2.
|
|
659
|
+
pkg: { name: "grepper-dev", version: "0.2.2" }
|
|
698
660
|
}).notify();
|
|
699
661
|
var program = new Command();
|
|
700
|
-
program.name("grepper").description("Local code review powered by AI").version("0.2.
|
|
662
|
+
program.name("grepper").description("Local code review powered by AI").version("0.2.2");
|
|
701
663
|
program.command("login").description("Log in with your Grepper API key").action(async () => {
|
|
702
664
|
await loginCommand();
|
|
703
665
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grepper-dev",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Grepper CLI - Local code review powered by AI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,15 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
|
-
"
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "https://github.com/avr00/grepper.git",
|
|
16
|
-
"directory": "packages/cli"
|
|
17
|
-
},
|
|
18
|
-
"homepage": "https://grepper.dev",
|
|
19
|
-
"bugs": {
|
|
20
|
-
"url": "https://github.com/avr00/grepper/issues"
|
|
21
|
-
},
|
|
13
|
+
"homepage": "https://grepper-web.vercel.app/",
|
|
22
14
|
"keywords": [
|
|
23
15
|
"code-review",
|
|
24
16
|
"ai",
|
|
@@ -31,6 +23,7 @@
|
|
|
31
23
|
"node": ">=18"
|
|
32
24
|
},
|
|
33
25
|
"dependencies": {
|
|
26
|
+
"@inquirer/password": "^5.0.4",
|
|
34
27
|
"chalk": "^5.4.1",
|
|
35
28
|
"commander": "^14.0.0",
|
|
36
29
|
"ora": "^9.3.0",
|