@ossiq/cli 0.1.12
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 +48 -0
- package/bin/ossiq.js +86 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @ossiq/cli
|
|
2
|
+
|
|
3
|
+
Make better dependency decisions — before and after installation.
|
|
4
|
+
|
|
5
|
+
[OSS IQ](https://github.com/ossiq/ossiq) analyses your `package.json`, `pyproject.toml`
|
|
6
|
+
or `requirements.txt` and answers: should I add it, update it, or refactor it out?
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
No install required:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx @ossiq/cli status
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or install it:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @ossiq/cli
|
|
20
|
+
ossiq status
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This package ships a self-contained binary — **no Python installation is required**.
|
|
24
|
+
The correct binary for your platform is selected automatically through npm's
|
|
25
|
+
optional dependencies.
|
|
26
|
+
|
|
27
|
+
## Supported platforms
|
|
28
|
+
|
|
29
|
+
| OS | Architecture |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| macOS | arm64, x64 |
|
|
32
|
+
| Linux (glibc) | arm64, x64 |
|
|
33
|
+
| Windows | x64 |
|
|
34
|
+
|
|
35
|
+
musl-based Linux (Alpine) and Windows on ARM are not covered by the prebuilt
|
|
36
|
+
binaries. On those platforms install from PyPI instead:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
uv tool install ossiq # or: pipx install ossiq
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
<https://ossiq.dev>
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
AGPL-3.0-only
|
package/bin/ossiq.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Thin launcher for the platform-specific `ossiq` binary.
|
|
5
|
+
//
|
|
6
|
+
// The real executables ship in optional, platform-gated packages (the model used
|
|
7
|
+
// by esbuild and friends), so npm installs exactly one of them for the current
|
|
8
|
+
// host. There is deliberately no postinstall script: nothing here needs to run at
|
|
9
|
+
// install time, so `npm ci --ignore-scripts` and pnpm's default settings work.
|
|
10
|
+
|
|
11
|
+
const { spawnSync } = require("child_process");
|
|
12
|
+
const path = require("path");
|
|
13
|
+
|
|
14
|
+
const PLATFORM_PACKAGES = {
|
|
15
|
+
"darwin arm64": "@ossiq/cli-darwin-arm64",
|
|
16
|
+
"darwin x64": "@ossiq/cli-darwin-x64",
|
|
17
|
+
"linux arm64": "@ossiq/cli-linux-arm64",
|
|
18
|
+
"linux x64": "@ossiq/cli-linux-x64",
|
|
19
|
+
"win32 x64": "@ossiq/cli-win32-x64",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const FALLBACK_HINT = [
|
|
23
|
+
"",
|
|
24
|
+
"OSS IQ is also published to PyPI and can be installed without Node:",
|
|
25
|
+
"",
|
|
26
|
+
" uv tool install ossiq # or: pipx install ossiq",
|
|
27
|
+
" ossiq status",
|
|
28
|
+
"",
|
|
29
|
+
"See https://github.com/ossiq/ossiq for details.",
|
|
30
|
+
].join("\n");
|
|
31
|
+
|
|
32
|
+
function resolveBinary() {
|
|
33
|
+
const key = `${process.platform} ${process.arch}`;
|
|
34
|
+
const packageName = PLATFORM_PACKAGES[key];
|
|
35
|
+
|
|
36
|
+
if (!packageName) {
|
|
37
|
+
return {
|
|
38
|
+
error:
|
|
39
|
+
`ossiq does not ship a prebuilt binary for ${key}.` +
|
|
40
|
+
`\nSupported: ${Object.keys(PLATFORM_PACKAGES).join(", ")}.`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let packageJsonPath;
|
|
45
|
+
try {
|
|
46
|
+
packageJsonPath = require.resolve(`${packageName}/package.json`);
|
|
47
|
+
} catch (err) {
|
|
48
|
+
return {
|
|
49
|
+
error:
|
|
50
|
+
`The platform package ${packageName} is not installed.` +
|
|
51
|
+
"\n\nThis usually means npm skipped optional dependencies (--no-optional / --omit=optional)," +
|
|
52
|
+
"\nor the platform is unsupported (musl-based Linux such as Alpine is not covered by the" +
|
|
53
|
+
"\nprebuilt binaries, which are linked against glibc).",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const executable = process.platform === "win32" ? "ossiq.exe" : "ossiq";
|
|
58
|
+
return { binary: path.join(path.dirname(packageJsonPath), "bin", "ossiq", executable) };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function main() {
|
|
62
|
+
const { binary, error } = resolveBinary();
|
|
63
|
+
|
|
64
|
+
if (error) {
|
|
65
|
+
process.stderr.write(`${error}\n${FALLBACK_HINT}\n`);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
70
|
+
|
|
71
|
+
if (result.error) {
|
|
72
|
+
process.stderr.write(`Failed to run ${binary}: ${result.error.message}\n${FALLBACK_HINT}\n`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Propagate a fatal signal as the conventional 128+n exit code so callers and
|
|
77
|
+
// CI see the real cause instead of a bare success.
|
|
78
|
+
if (result.signal) {
|
|
79
|
+
process.stderr.write(`ossiq terminated by signal ${result.signal}\n`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ossiq/cli",
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "Make better dependency decisions - before and after installation.",
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"homepage": "https://ossiq.dev",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/ossiq/ossiq.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ossiq/ossiq/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"dependencies",
|
|
16
|
+
"security",
|
|
17
|
+
"cve",
|
|
18
|
+
"supply-chain",
|
|
19
|
+
"npm",
|
|
20
|
+
"pypi"
|
|
21
|
+
],
|
|
22
|
+
"bin": {
|
|
23
|
+
"ossiq": "bin/ossiq.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"optionalDependencies": {
|
|
33
|
+
"@ossiq/cli-darwin-arm64": "0.1.12",
|
|
34
|
+
"@ossiq/cli-darwin-x64": "0.1.12",
|
|
35
|
+
"@ossiq/cli-linux-arm64": "0.1.12",
|
|
36
|
+
"@ossiq/cli-linux-x64": "0.1.12",
|
|
37
|
+
"@ossiq/cli-win32-x64": "0.1.12"
|
|
38
|
+
}
|
|
39
|
+
}
|