jokalala-cli 0.2.0

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 ADDED
@@ -0,0 +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.
package/README.md ADDED
@@ -0,0 +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.
package/bin/jokalala ADDED
@@ -0,0 +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();
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "jokalala-cli",
3
+ "version": "0.2.0",
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
+ "optionalDependencies": {
44
+ "@jokalala-cli/cli-win32-x64": "0.2.0",
45
+ "@jokalala-cli/cli-darwin-x64": "0.2.0",
46
+ "@jokalala-cli/cli-darwin-arm64": "0.2.0",
47
+ "@jokalala-cli/cli-linux-x64": "0.2.0",
48
+ "@jokalala-cli/cli-linux-arm64": "0.2.0"
49
+ }
50
+ }
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-install script to verify the platform binary is available.
5
+ */
6
+
7
+ const fs = require('fs')
8
+ const path = require('path')
9
+
10
+ const PLATFORMS = {
11
+ 'win32-x64': '@jokalala-cli/cli-win32-x64',
12
+ 'darwin-x64': '@jokalala-cli/cli-darwin-x64',
13
+ 'darwin-arm64': '@jokalala-cli/cli-darwin-arm64',
14
+ 'linux-x64': '@jokalala-cli/cli-linux-x64',
15
+ 'linux-arm64': '@jokalala-cli/cli-linux-arm64',
16
+ }
17
+
18
+ function checkInstallation() {
19
+ const platformKey = `${process.platform}-${process.arch}`
20
+ const packageName = PLATFORMS[platformKey]
21
+
22
+ if (!packageName) {
23
+ console.warn(`\nJokalala CLI: Unsupported platform ${platformKey}`)
24
+ console.warn(` Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`)
25
+ console.warn(
26
+ ' You may need to build from source: cargo install --path cli-rust\n'
27
+ )
28
+ return
29
+ }
30
+
31
+ try {
32
+ const packagePath = require.resolve(`${packageName}/package.json`)
33
+ const packageDir = path.dirname(packagePath)
34
+ const binaryName =
35
+ process.platform === 'win32' ? 'jokalala.exe' : 'jokalala'
36
+ const binaryPath = path.join(packageDir, 'bin', binaryName)
37
+
38
+ if (fs.existsSync(binaryPath)) {
39
+ if (process.platform !== 'win32') {
40
+ try {
41
+ fs.chmodSync(binaryPath, 0o755)
42
+ } catch {
43
+ // Ignore chmod errors on read-only installs
44
+ }
45
+ }
46
+ console.log(`Jokalala CLI installed successfully for ${platformKey}`)
47
+ } else {
48
+ console.warn(`\nJokalala CLI: Binary not found at ${binaryPath}`)
49
+ console.warn(' Try reinstalling: npm install -g jokalala-cli\n')
50
+ }
51
+ } catch {
52
+ console.warn(`\nJokalala CLI: Platform package ${packageName} not found`)
53
+ console.warn(" This can happen with npm's optional dependency handling.")
54
+ console.warn(' Try: npm install -g jokalala-cli --force\n')
55
+ }
56
+ }
57
+
58
+ checkInstallation()