jokalala-cli 0.2.22 → 0.2.24
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/LICENSE +21 -21
- package/README.md +12 -12
- package/bin/jokalala +70 -70
- package/package.json +53 -50
- package/scripts/postinstall.js +84 -58
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Jokalala Technologies
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jokalala Technologies
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# jokalala-cli
|
|
2
|
-
|
|
3
|
-
Enterprise-oriented static security scanner (Rust binary via npm optional deps).
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npx jokalala-cli@latest scan --help
|
|
7
|
-
npx jokalala-cli@latest scan src/ --no-llm --fail-on high
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
Docs: [Quickstart](https://github.com/jkalala/jokalala/blob/main/docs/cli/QUICKSTART.md)
|
|
11
|
-
|
|
12
|
-
Requires Node 18+. Set `JOKALALA_API_KEY` for cloud analyze, or let the CLI auto-start `@jokalala/analyzer-engine` / local service.
|
|
1
|
+
# jokalala-cli
|
|
2
|
+
|
|
3
|
+
Enterprise-oriented static security scanner (Rust binary via npm optional deps).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx jokalala-cli@latest scan --help
|
|
7
|
+
npx jokalala-cli@latest scan src/ --no-llm --fail-on high
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Docs: [Quickstart](https://github.com/jkalala/jokalala/blob/main/docs/cli/QUICKSTART.md)
|
|
11
|
+
|
|
12
|
+
Requires Node 18+. Set `JOKALALA_API_KEY` for cloud analyze, or let the CLI auto-start `@jokalala/analyzer-engine` / local service.
|
package/bin/jokalala
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { execFileSync } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const fs = require('fs');
|
|
6
|
-
|
|
7
|
-
// Platform detection
|
|
8
|
-
const PLATFORMS = {
|
|
9
|
-
'win32-x64': '@jokalala-cli/cli-win32-x64',
|
|
10
|
-
'darwin-x64': '@jokalala-cli/cli-darwin-x64',
|
|
11
|
-
'darwin-arm64': '@jokalala-cli/cli-darwin-arm64',
|
|
12
|
-
'linux-x64': '@jokalala-cli/cli-linux-x64',
|
|
13
|
-
'linux-arm64': '@jokalala-cli/cli-linux-arm64',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
function getBinaryPath() {
|
|
17
|
-
const platformKey = `${process.platform}-${process.arch}`;
|
|
18
|
-
const packageName = PLATFORMS[platformKey];
|
|
19
|
-
|
|
20
|
-
if (!packageName) {
|
|
21
|
-
console.error(`Unsupported platform: ${platformKey}`);
|
|
22
|
-
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`);
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Try to find the binary in the platform-specific package
|
|
27
|
-
try {
|
|
28
|
-
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
29
|
-
const packageDir = path.dirname(packagePath);
|
|
30
|
-
const binaryName = process.platform === 'win32' ? 'jokalala.exe' : 'jokalala';
|
|
31
|
-
const binaryPath = path.join(packageDir, 'bin', binaryName);
|
|
32
|
-
|
|
33
|
-
if (fs.existsSync(binaryPath)) {
|
|
34
|
-
return binaryPath;
|
|
35
|
-
}
|
|
36
|
-
} catch (e) {
|
|
37
|
-
// Package not found
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Fallback: check if binary is in the current package (for local development)
|
|
41
|
-
const localBinary = path.join(__dirname, '..', 'lib',
|
|
42
|
-
process.platform === 'win32' ? 'jokalala.exe' : 'jokalala');
|
|
43
|
-
|
|
44
|
-
if (fs.existsSync(localBinary)) {
|
|
45
|
-
return localBinary;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
console.error(`Binary not found for platform: ${platformKey}`);
|
|
49
|
-
console.error('Please reinstall the package: npm install -g jokalala-cli');
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function main() {
|
|
54
|
-
const binaryPath = getBinaryPath();
|
|
55
|
-
const args = process.argv.slice(2);
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
execFileSync(binaryPath, args, {
|
|
59
|
-
stdio: 'inherit',
|
|
60
|
-
env: process.env,
|
|
61
|
-
});
|
|
62
|
-
} catch (error) {
|
|
63
|
-
if (error.status !== undefined) {
|
|
64
|
-
process.exit(error.status);
|
|
65
|
-
}
|
|
66
|
-
throw error;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
main();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
// Platform detection
|
|
8
|
+
const PLATFORMS = {
|
|
9
|
+
'win32-x64': '@jokalala-cli/cli-win32-x64',
|
|
10
|
+
'darwin-x64': '@jokalala-cli/cli-darwin-x64',
|
|
11
|
+
'darwin-arm64': '@jokalala-cli/cli-darwin-arm64',
|
|
12
|
+
'linux-x64': '@jokalala-cli/cli-linux-x64',
|
|
13
|
+
'linux-arm64': '@jokalala-cli/cli-linux-arm64',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function getBinaryPath() {
|
|
17
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
18
|
+
const packageName = PLATFORMS[platformKey];
|
|
19
|
+
|
|
20
|
+
if (!packageName) {
|
|
21
|
+
console.error(`Unsupported platform: ${platformKey}`);
|
|
22
|
+
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Try to find the binary in the platform-specific package
|
|
27
|
+
try {
|
|
28
|
+
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
29
|
+
const packageDir = path.dirname(packagePath);
|
|
30
|
+
const binaryName = process.platform === 'win32' ? 'jokalala.exe' : 'jokalala';
|
|
31
|
+
const binaryPath = path.join(packageDir, 'bin', binaryName);
|
|
32
|
+
|
|
33
|
+
if (fs.existsSync(binaryPath)) {
|
|
34
|
+
return binaryPath;
|
|
35
|
+
}
|
|
36
|
+
} catch (e) {
|
|
37
|
+
// Package not found
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Fallback: check if binary is in the current package (for local development)
|
|
41
|
+
const localBinary = path.join(__dirname, '..', 'lib',
|
|
42
|
+
process.platform === 'win32' ? 'jokalala.exe' : 'jokalala');
|
|
43
|
+
|
|
44
|
+
if (fs.existsSync(localBinary)) {
|
|
45
|
+
return localBinary;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
console.error(`Binary not found for platform: ${platformKey}`);
|
|
49
|
+
console.error('Please reinstall the package: npm install -g jokalala-cli');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function main() {
|
|
54
|
+
const binaryPath = getBinaryPath();
|
|
55
|
+
const args = process.argv.slice(2);
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
execFileSync(binaryPath, args, {
|
|
59
|
+
stdio: 'inherit',
|
|
60
|
+
env: process.env,
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (error.status !== undefined) {
|
|
64
|
+
process.exit(error.status);
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "jokalala-cli",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Jokalala Static Code Analyzer - Enterprise-grade security scanning CLI",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"security",
|
|
7
|
-
"static-analysis",
|
|
8
|
-
"vulnerability",
|
|
9
|
-
"scanner",
|
|
10
|
-
"cli",
|
|
11
|
-
"sast",
|
|
12
|
-
"code-analysis"
|
|
13
|
-
],
|
|
14
|
-
"author": "Jokalala Tecnologias",
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "https://github.com/jkalala/jokalala.git",
|
|
19
|
-
"directory": "cli-rust"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://jokalala.com",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/jkalala/jokalala/issues"
|
|
24
|
-
},
|
|
25
|
-
"bin": {
|
|
26
|
-
"jokalala": "bin/jokalala"
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"bin",
|
|
30
|
-
"scripts",
|
|
31
|
-
"README.md",
|
|
32
|
-
"LICENSE"
|
|
33
|
-
],
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=18"
|
|
36
|
-
},
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"postinstall": "node scripts/postinstall.js"
|
|
42
|
-
},
|
|
43
|
-
"
|
|
44
|
-
"@jokalala
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"@jokalala-cli/cli-
|
|
48
|
-
"@jokalala-cli/cli-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "jokalala-cli",
|
|
3
|
+
"version": "0.2.24",
|
|
4
|
+
"description": "Jokalala Static Code Analyzer - Enterprise-grade security scanning CLI",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"security",
|
|
7
|
+
"static-analysis",
|
|
8
|
+
"vulnerability",
|
|
9
|
+
"scanner",
|
|
10
|
+
"cli",
|
|
11
|
+
"sast",
|
|
12
|
+
"code-analysis"
|
|
13
|
+
],
|
|
14
|
+
"author": "Jokalala Tecnologias",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/jkalala/jokalala.git",
|
|
19
|
+
"directory": "cli-rust"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://jokalala.com",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/jkalala/jokalala/issues"
|
|
24
|
+
},
|
|
25
|
+
"bin": {
|
|
26
|
+
"jokalala": "bin/jokalala"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"bin",
|
|
30
|
+
"scripts",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"postinstall": "node scripts/postinstall.js"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@jokalala/analyzer-engine": "0.1.10"
|
|
45
|
+
},
|
|
46
|
+
"optionalDependencies": {
|
|
47
|
+
"@jokalala-cli/cli-win32-x64": "0.2.24",
|
|
48
|
+
"@jokalala-cli/cli-darwin-x64": "0.2.24",
|
|
49
|
+
"@jokalala-cli/cli-darwin-arm64": "0.2.24",
|
|
50
|
+
"@jokalala-cli/cli-linux-x64": "0.2.24",
|
|
51
|
+
"@jokalala-cli/cli-linux-arm64": "0.2.24"
|
|
52
|
+
}
|
|
53
|
+
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,58 +1,84 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Post-install script
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-install script. File existence is not enough: a binary linked
|
|
5
|
+
* against a newer glibc exists on disk and still cannot run.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execFileSync } = require('child_process')
|
|
9
|
+
const fs = require('fs')
|
|
10
|
+
const path = require('path')
|
|
11
|
+
|
|
12
|
+
const PLATFORMS = {
|
|
13
|
+
'win32-x64': '@jokalala-cli/cli-win32-x64',
|
|
14
|
+
'darwin-x64': '@jokalala-cli/cli-darwin-x64',
|
|
15
|
+
'darwin-arm64': '@jokalala-cli/cli-darwin-arm64',
|
|
16
|
+
'linux-x64': '@jokalala-cli/cli-linux-x64',
|
|
17
|
+
'linux-arm64': '@jokalala-cli/cli-linux-arm64',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function fail(message) {
|
|
21
|
+
console.error(`\nJokalala CLI: ${message}`)
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function checkInstallation() {
|
|
26
|
+
const platformKey = `${process.platform}-${process.arch}`
|
|
27
|
+
const packageName = PLATFORMS[platformKey]
|
|
28
|
+
|
|
29
|
+
if (!packageName) {
|
|
30
|
+
console.warn(`\nJokalala CLI: Unsupported platform ${platformKey}`)
|
|
31
|
+
console.warn(` Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`)
|
|
32
|
+
console.warn(
|
|
33
|
+
' You may need to build from source: cargo install --path cli-rust\n'
|
|
34
|
+
)
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let packageDir
|
|
39
|
+
try {
|
|
40
|
+
const packagePath = require.resolve(`${packageName}/package.json`)
|
|
41
|
+
packageDir = path.dirname(packagePath)
|
|
42
|
+
} catch {
|
|
43
|
+
fail(
|
|
44
|
+
`Platform package ${packageName} not found. Try: npm install -g jokalala-cli --force`
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const binaryName = process.platform === 'win32' ? 'jokalala.exe' : 'jokalala'
|
|
49
|
+
const binaryPath = path.join(packageDir, 'bin', binaryName)
|
|
50
|
+
if (!fs.existsSync(binaryPath)) {
|
|
51
|
+
fail(`Binary not found at ${binaryPath}. Try: npm install -g jokalala-cli --force`)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (process.platform !== 'win32') {
|
|
55
|
+
try {
|
|
56
|
+
fs.chmodSync(binaryPath, 0o755)
|
|
57
|
+
} catch {
|
|
58
|
+
// Ignore chmod errors on read-only installs
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
let output = ''
|
|
63
|
+
try {
|
|
64
|
+
output = execFileSync(binaryPath, ['--version'], {
|
|
65
|
+
encoding: 'utf8',
|
|
66
|
+
timeout: 15000,
|
|
67
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
68
|
+
})
|
|
69
|
+
} catch (err) {
|
|
70
|
+
const detail = (err && (err.stderr || err.message)) || 'unknown error'
|
|
71
|
+
fail(
|
|
72
|
+
`${binaryPath} failed to execute (--version).\n${detail}\n` +
|
|
73
|
+
'On Linux this usually means the binary needs a newer glibc than this system provides.'
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!/\d+\.\d+\.\d+/.test(String(output))) {
|
|
78
|
+
fail(`--version did not print a semver.\n${output}`)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
console.log(`Jokalala CLI installed successfully for ${platformKey}`)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
checkInstallation()
|