@airweave/cli 0.1.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/bin/airweave.js +21 -0
- package/install.js +16 -0
- package/package.json +22 -0
package/bin/airweave.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("child_process");
|
|
4
|
+
|
|
5
|
+
const result = spawnSync("airweave", process.argv.slice(2), {
|
|
6
|
+
stdio: "inherit",
|
|
7
|
+
shell: process.platform === "win32",
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
if (result.error) {
|
|
11
|
+
if (result.error.code === "ENOENT") {
|
|
12
|
+
console.error(
|
|
13
|
+
"Error: 'airweave' command not found. Run: pip install airweave-cli"
|
|
14
|
+
);
|
|
15
|
+
} else {
|
|
16
|
+
console.error("Error:", result.error.message);
|
|
17
|
+
}
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
process.exit(result.status ?? 1);
|
package/install.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const { execSync } = require("child_process");
|
|
2
|
+
const { version } = require("./package.json");
|
|
3
|
+
|
|
4
|
+
const pip = process.platform === "win32" ? "pip" : "pip3";
|
|
5
|
+
const pkg = `airweave-cli==${version}`;
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
execSync(`${pip} install ${pkg}`, { stdio: "inherit" });
|
|
9
|
+
} catch {
|
|
10
|
+
console.error(
|
|
11
|
+
`\nFailed to install ${pkg}.\n` +
|
|
12
|
+
"Make sure Python 3.9+ and pip are installed, then run:\n" +
|
|
13
|
+
` ${pip} install ${pkg}\n`
|
|
14
|
+
);
|
|
15
|
+
// Don't fail the npm install — the user can install the Python package manually
|
|
16
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@airweave/cli",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Airweave CLI for developers and AI agents. Search across your connected sources from any terminal.",
|
|
5
|
+
"keywords": ["airweave", "cli", "search", "ai", "agents"],
|
|
6
|
+
"homepage": "https://github.com/airweave-ai/cli",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/airweave-ai/cli.git"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"bin": {
|
|
13
|
+
"airweave": "./bin/airweave.js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"postinstall": "node install.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"bin/",
|
|
20
|
+
"install.js"
|
|
21
|
+
]
|
|
22
|
+
}
|