argus-ai 0.1.1

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.
Files changed (4) hide show
  1. package/README.md +45 -0
  2. package/bin/argus +27 -0
  3. package/install.js +131 -0
  4. package/package.json +26 -0
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # argus-ai
2
+
3
+ AI-powered code review tool — multi-provider, self-hosted, open-source.
4
+
5
+ ```bash
6
+ npx argus-ai review --file my.diff
7
+ ```
8
+
9
+ ## What is Argus?
10
+
11
+ Argus is an AI code review tool built in Rust. It parses diffs, scores risk, builds repository context, and sends intelligent review requests to your LLM of choice.
12
+
13
+ - **Multi-provider LLM**: OpenAI, Anthropic, Gemini
14
+ - **Multi-provider embeddings**: Voyage, Gemini, OpenAI
15
+ - **Zero-cost path**: Use Gemini for both LLM and embeddings (free tier, no credit card)
16
+ - **MCP server**: 5 tools for IDE integration
17
+ - **GitHub integration**: Inline PR comments, CI gating
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ # Review a diff
23
+ git diff HEAD~3 | npx argus-ai review --file -
24
+
25
+ # Review with repo context
26
+ npx argus-ai review --file my.diff --repo .
27
+
28
+ # Generate repo map
29
+ npx argus-ai map --path .
30
+
31
+ # Analyze git history
32
+ npx argus-ai history --path . --analysis hotspots
33
+ ```
34
+
35
+ ## Configuration
36
+
37
+ ```bash
38
+ npx argus-ai init # creates .argus.toml
39
+ ```
40
+
41
+ See the [full documentation](https://github.com/Meru143/argus) for provider setup.
42
+
43
+ ## License
44
+
45
+ MIT
package/bin/argus ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFileSync } = require("child_process");
4
+ const path = require("path");
5
+ const fs = require("fs");
6
+
7
+ const binDir = path.join(__dirname, "..", "bin");
8
+ let binary = path.join(binDir, "argus-bin");
9
+
10
+ if (process.platform === "win32") {
11
+ binary = path.join(binDir, "argus-bin.exe");
12
+ }
13
+
14
+ if (!fs.existsSync(binary)) {
15
+ console.error(
16
+ "argus binary not found. Run `npm install` or `npx argus-ai` to download it."
17
+ );
18
+ process.exit(1);
19
+ }
20
+
21
+ try {
22
+ const result = execFileSync(binary, process.argv.slice(2), {
23
+ stdio: "inherit",
24
+ });
25
+ } catch (err) {
26
+ process.exit(err.status || 1);
27
+ }
package/install.js ADDED
@@ -0,0 +1,131 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const https = require("https");
4
+ const { execSync } = require("child_process");
5
+ const os = require("os");
6
+
7
+ const VERSION = require("./package.json").version;
8
+ const REPO = "Meru143/argus";
9
+
10
+ const PLATFORM_MAP = {
11
+ "darwin-x64": "argus-x86_64-apple-darwin.tar.gz",
12
+ "darwin-arm64": "argus-aarch64-apple-darwin.tar.gz",
13
+ "linux-x64": "argus-x86_64-unknown-linux-gnu.tar.gz",
14
+ "linux-arm64": "argus-aarch64-unknown-linux-gnu.tar.gz",
15
+ "win32-x64": "argus-x86_64-pc-windows-msvc.zip",
16
+ };
17
+
18
+ function getPlatformKey() {
19
+ return `${os.platform()}-${os.arch()}`;
20
+ }
21
+
22
+ function getDownloadUrl(asset) {
23
+ return `https://github.com/${REPO}/releases/download/v${VERSION}/${asset}`;
24
+ }
25
+
26
+ function download(url) {
27
+ return new Promise((resolve, reject) => {
28
+ const follow = (url, redirects = 0) => {
29
+ if (redirects > 5) return reject(new Error("Too many redirects"));
30
+
31
+ const mod = url.startsWith("https") ? https : require("http");
32
+ mod
33
+ .get(url, { headers: { "User-Agent": "argus-ai-npm" } }, (res) => {
34
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
35
+ return follow(res.headers.location, redirects + 1);
36
+ }
37
+ if (res.statusCode !== 200) {
38
+ return reject(new Error(`Download failed: HTTP ${res.statusCode}`));
39
+ }
40
+
41
+ const chunks = [];
42
+ res.on("data", (chunk) => chunks.push(chunk));
43
+ res.on("end", () => resolve(Buffer.concat(chunks)));
44
+ res.on("error", reject);
45
+ })
46
+ .on("error", reject);
47
+ };
48
+ follow(url);
49
+ });
50
+ }
51
+
52
+ async function install() {
53
+ const key = getPlatformKey();
54
+ const asset = PLATFORM_MAP[key];
55
+
56
+ if (!asset) {
57
+ console.error(`Unsupported platform: ${key}`);
58
+ console.error(`Supported: ${Object.keys(PLATFORM_MAP).join(", ")}`);
59
+ console.error("You can build from source: cargo install --git https://github.com/Meru143/argus");
60
+ process.exit(1);
61
+ }
62
+
63
+ const url = getDownloadUrl(asset);
64
+ const binDir = path.join(__dirname, "bin");
65
+ const isWindows = os.platform() === "win32";
66
+ const binaryName = isWindows ? "argus-bin.exe" : "argus-bin";
67
+ const binaryPath = path.join(binDir, binaryName);
68
+
69
+ // Skip if already installed
70
+ if (fs.existsSync(binaryPath)) {
71
+ return;
72
+ }
73
+
74
+ console.log(`Downloading argus v${VERSION} for ${key}...`);
75
+
76
+ try {
77
+ const data = await download(url);
78
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "argus-"));
79
+ const archivePath = path.join(tmpDir, asset);
80
+
81
+ fs.writeFileSync(archivePath, data);
82
+ fs.mkdirSync(binDir, { recursive: true });
83
+
84
+ if (asset.endsWith(".zip")) {
85
+ // Windows: use PowerShell to extract
86
+ execSync(
87
+ `powershell -command "Expand-Archive -Path '${archivePath}' -DestinationPath '${tmpDir}'"`,
88
+ { stdio: "pipe" }
89
+ );
90
+ } else {
91
+ // Unix: use tar
92
+ execSync(`tar xzf "${archivePath}" -C "${tmpDir}"`, { stdio: "pipe" });
93
+ }
94
+
95
+ // Find the binary in extracted files
96
+ const extracted = findBinary(tmpDir, isWindows ? "argus.exe" : "argus");
97
+ if (!extracted) {
98
+ throw new Error("Could not find argus binary in archive");
99
+ }
100
+
101
+ fs.copyFileSync(extracted, binaryPath);
102
+ if (!isWindows) {
103
+ fs.chmodSync(binaryPath, 0o755);
104
+ }
105
+
106
+ // Cleanup
107
+ fs.rmSync(tmpDir, { recursive: true, force: true });
108
+
109
+ console.log(`Installed argus v${VERSION} to ${binaryPath}`);
110
+ } catch (err) {
111
+ console.error(`Failed to install argus: ${err.message}`);
112
+ console.error("You can build from source: cargo install --git https://github.com/Meru143/argus");
113
+ process.exit(1);
114
+ }
115
+ }
116
+
117
+ function findBinary(dir, name) {
118
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
119
+ for (const entry of entries) {
120
+ const full = path.join(dir, entry.name);
121
+ if (entry.isDirectory()) {
122
+ const found = findBinary(full, name);
123
+ if (found) return found;
124
+ } else if (entry.name === name) {
125
+ return full;
126
+ }
127
+ }
128
+ return null;
129
+ }
130
+
131
+ install();
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "argus-ai",
3
+ "version": "0.1.1",
4
+ "description": "AI-powered code review tool — multi-provider, self-hosted, open-source",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Meru143/argus"
9
+ },
10
+ "homepage": "https://github.com/Meru143/argus",
11
+ "keywords": ["code-review", "ai", "llm", "rust", "anthropic", "openai", "gemini", "mcp"],
12
+ "bin": {
13
+ "argus": "bin/argus"
14
+ },
15
+ "scripts": {
16
+ "postinstall": "node install.js"
17
+ },
18
+ "files": [
19
+ "bin/argus",
20
+ "install.js",
21
+ "README.md"
22
+ ],
23
+ "engines": {
24
+ "node": ">=16"
25
+ }
26
+ }