@kandiforge/kandi-cli 9.3.4 → 10.0.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/bin/.gitkeep +0 -0
- package/package.json +11 -12
- package/scripts/CLAUDE.md +7 -0
- package/scripts/install.js +83 -36
- package/README.md +0 -29
- package/bin/kandi +0 -25
package/bin/.gitkeep
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kandiforge/kandi-cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"author": "
|
|
6
|
-
"license": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
|
+
"description": "Kandi CLI - AI-powered code generation and development tool",
|
|
5
|
+
"author": "Abstract Class Consulting Inc.",
|
|
6
|
+
"license": "PROPRIETARY",
|
|
7
7
|
"homepage": "https://github.com/KandiForge/apps",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/KandiForge/apps.git",
|
|
11
|
-
"directory": "
|
|
11
|
+
"directory": "spectacle/crates/forge"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/KandiForge/apps/issues"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
|
-
"ai",
|
|
18
|
-
"cli",
|
|
19
|
-
"development",
|
|
20
|
-
"assistant",
|
|
21
17
|
"kandi",
|
|
22
|
-
"
|
|
18
|
+
"cli",
|
|
19
|
+
"ai",
|
|
23
20
|
"code-generation",
|
|
24
|
-
"
|
|
21
|
+
"kandiforge",
|
|
22
|
+
"development"
|
|
25
23
|
],
|
|
26
24
|
"bin": {
|
|
27
|
-
"kandi": "
|
|
25
|
+
"kandi-forge": "bin/kandi-forge",
|
|
26
|
+
"kandi-supersmall": "bin/kandi-supersmall"
|
|
28
27
|
},
|
|
29
28
|
"scripts": {
|
|
30
29
|
"postinstall": "node scripts/install.js",
|
package/scripts/install.js
CHANGED
|
@@ -6,7 +6,7 @@ const https = require('https');
|
|
|
6
6
|
const { execSync } = require('child_process');
|
|
7
7
|
|
|
8
8
|
// This version MUST match package.json
|
|
9
|
-
const RELEASE_VERSION = '
|
|
9
|
+
const RELEASE_VERSION = '0.45.7';
|
|
10
10
|
const GITHUB_REPO = 'KandiForge/distribution';
|
|
11
11
|
|
|
12
12
|
function downloadFile(url, destPath) {
|
|
@@ -42,30 +42,45 @@ function downloadFile(url, destPath) {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Extract ZIP file using PowerShell on Windows
|
|
47
|
+
*/
|
|
48
|
+
function extractZip(zipPath, destDir) {
|
|
49
|
+
try {
|
|
50
|
+
const psCommand = `powershell -Command "Expand-Archive -Path '${zipPath}' -DestinationPath '${destDir}' -Force"`;
|
|
51
|
+
execSync(psCommand, { stdio: 'inherit' });
|
|
52
|
+
} catch (error) {
|
|
53
|
+
throw new Error(`Failed to extract ZIP file: ${error.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
45
57
|
async function install() {
|
|
46
58
|
try {
|
|
47
59
|
const platform = process.platform;
|
|
48
|
-
const arch = process.arch;
|
|
49
60
|
|
|
50
|
-
// Determine
|
|
51
|
-
let fileName,
|
|
61
|
+
// Determine archive name and binary extension based on platform
|
|
62
|
+
let fileName, isZip, ext;
|
|
63
|
+
|
|
52
64
|
if (platform === 'darwin') {
|
|
53
|
-
fileName = `kandi-cli-v${RELEASE_VERSION}-macos-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
fileName = `kandi-cli-v${RELEASE_VERSION}-macos-arm64.tar.gz`;
|
|
66
|
+
isZip = false;
|
|
67
|
+
ext = '';
|
|
56
68
|
} else if (platform === 'linux') {
|
|
57
69
|
fileName = `kandi-cli-v${RELEASE_VERSION}-linux-x64.tar.gz`;
|
|
58
|
-
|
|
59
|
-
|
|
70
|
+
isZip = false;
|
|
71
|
+
ext = '';
|
|
60
72
|
} else if (platform === 'win32') {
|
|
61
73
|
fileName = `kandi-cli-v${RELEASE_VERSION}-windows-x64.zip`;
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
isZip = true;
|
|
75
|
+
ext = '.exe';
|
|
64
76
|
} else {
|
|
65
77
|
throw new Error(`Platform ${platform} is not supported. Supported: macOS, Linux, Windows`);
|
|
66
78
|
}
|
|
67
79
|
|
|
68
|
-
//
|
|
80
|
+
// Binary names included in kandi-cli package
|
|
81
|
+
const binaryNames = ['kandi-forge', 'kandi-supersmall'];
|
|
82
|
+
|
|
83
|
+
// Download URL from GitHub release assets
|
|
69
84
|
const downloadUrl = `https://github.com/${GITHUB_REPO}/releases/download/kandi-cli-v${RELEASE_VERSION}/${fileName}`;
|
|
70
85
|
|
|
71
86
|
const binDir = path.join(__dirname, '..', 'bin');
|
|
@@ -76,44 +91,76 @@ async function install() {
|
|
|
76
91
|
fs.mkdirSync(binDir, { recursive: true });
|
|
77
92
|
}
|
|
78
93
|
|
|
94
|
+
// Clean bin directory - remove any existing binaries to avoid mixing platforms
|
|
95
|
+
console.log('Cleaning bin directory...');
|
|
96
|
+
const existingFiles = fs.readdirSync(binDir);
|
|
97
|
+
for (const file of existingFiles) {
|
|
98
|
+
// Skip .gitkeep or other dotfiles
|
|
99
|
+
if (file.startsWith('.')) continue;
|
|
100
|
+
const filePath = path.join(binDir, file);
|
|
101
|
+
try {
|
|
102
|
+
fs.unlinkSync(filePath);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
console.warn(`Warning: Could not remove ${file}: ${e.message}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
79
108
|
// Download the release archive
|
|
80
|
-
console.log(`Installing
|
|
109
|
+
console.log(`Installing kandi-cli v${RELEASE_VERSION} for ${platform}...`);
|
|
81
110
|
await downloadFile(downloadUrl, tempFile);
|
|
82
111
|
|
|
83
|
-
// Extract the
|
|
84
|
-
console.log('Extracting
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
112
|
+
// Extract the archive
|
|
113
|
+
console.log('Extracting binaries...');
|
|
114
|
+
if (isZip) {
|
|
115
|
+
extractZip(tempFile, binDir);
|
|
116
|
+
} else {
|
|
117
|
+
execSync(`tar -xzf "${tempFile}" -C "${binDir}"`, { stdio: 'inherit' });
|
|
118
|
+
}
|
|
88
119
|
|
|
89
120
|
// Clean up archive
|
|
90
121
|
fs.unlinkSync(tempFile);
|
|
91
122
|
|
|
92
|
-
// The archive extracts to kandi-cli-v{version}/
|
|
123
|
+
// The archive extracts to kandi-cli-v{version}/
|
|
93
124
|
const extractedDir = path.join(binDir, `kandi-cli-v${RELEASE_VERSION}`);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
125
|
+
|
|
126
|
+
// Move binaries to bin directory
|
|
127
|
+
const installedBinaries = [];
|
|
128
|
+
for (const baseName of binaryNames) {
|
|
129
|
+
const binaryName = `${baseName}${ext}`;
|
|
130
|
+
const extractedPath = path.join(extractedDir, binaryName);
|
|
131
|
+
const destPath = path.join(binDir, binaryName);
|
|
132
|
+
|
|
133
|
+
if (fs.existsSync(extractedPath)) {
|
|
134
|
+
fs.renameSync(extractedPath, destPath);
|
|
135
|
+
|
|
136
|
+
// Make binary executable (Unix only)
|
|
137
|
+
if (platform !== 'win32') {
|
|
138
|
+
fs.chmodSync(destPath, 0o755);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
installedBinaries.push(binaryName);
|
|
142
|
+
} else {
|
|
143
|
+
console.warn(`Warning: ${binaryName} not found in archive`);
|
|
144
|
+
}
|
|
104
145
|
}
|
|
105
146
|
|
|
106
|
-
//
|
|
107
|
-
if (
|
|
108
|
-
fs.
|
|
147
|
+
// Clean up the extracted directory
|
|
148
|
+
if (fs.existsSync(extractedDir)) {
|
|
149
|
+
fs.rmSync(extractedDir, { recursive: true });
|
|
109
150
|
}
|
|
110
151
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
152
|
+
if (installedBinaries.length === 0) {
|
|
153
|
+
throw new Error('No binaries were found in the archive');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
console.log('kandi-cli installed successfully!');
|
|
157
|
+
console.log(`Installed ${installedBinaries.length} binaries:`);
|
|
158
|
+
for (const binary of installedBinaries) {
|
|
159
|
+
console.log(` - ${binary}`);
|
|
160
|
+
}
|
|
114
161
|
|
|
115
162
|
} catch (error) {
|
|
116
|
-
console.error('
|
|
163
|
+
console.error('Installation failed:', error.message);
|
|
117
164
|
console.error('\nPlease report this issue at: https://github.com/KandiForge/apps/issues');
|
|
118
165
|
process.exit(1);
|
|
119
166
|
}
|
package/README.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Kandi CLI
|
|
2
|
-
|
|
3
|
-
AI-assisted software development CLI with interactive chat and 26 built-in tools.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g @kandiforge/kandi-cli
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
kandi --help
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Platform Support
|
|
18
|
-
|
|
19
|
-
- macOS (Universal: x86_64 + arm64)
|
|
20
|
-
- Linux (x86_64)
|
|
21
|
-
- Windows (x86_64)
|
|
22
|
-
|
|
23
|
-
## Issues
|
|
24
|
-
|
|
25
|
-
Report issues at: https://github.com/KandiForge/apps/issues
|
|
26
|
-
|
|
27
|
-
## License
|
|
28
|
-
|
|
29
|
-
Proprietary - © Abstract Class Consulting Inc.
|
package/bin/kandi
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
// Determine binary name based on platform
|
|
7
|
-
const binaryName = process.platform === 'win32' ? 'kandi-bin.exe' : 'kandi-bin';
|
|
8
|
-
const binaryPath = path.join(__dirname, binaryName);
|
|
9
|
-
|
|
10
|
-
// Spawn the binary with all arguments
|
|
11
|
-
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
12
|
-
stdio: 'inherit',
|
|
13
|
-
env: process.env
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
// Forward exit code
|
|
17
|
-
child.on('exit', (code) => {
|
|
18
|
-
process.exit(code || 0);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// Handle errors
|
|
22
|
-
child.on('error', (err) => {
|
|
23
|
-
console.error('Failed to start kandi binary:', err.message);
|
|
24
|
-
process.exit(1);
|
|
25
|
-
});
|