@kandiforge/kandi-cli 9.3.3 → 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 ADDED
File without changes
package/package.json CHANGED
@@ -1,30 +1,29 @@
1
1
  {
2
2
  "name": "@kandiforge/kandi-cli",
3
- "version": "9.3.3",
4
- "description": "AI-assisted software development CLI with interactive chat and 26 built-in tools",
5
- "author": "KandiForge",
6
- "license": "Proprietary",
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": "CLI"
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
- "kandiforge",
18
+ "cli",
19
+ "ai",
23
20
  "code-generation",
24
- "software-development"
21
+ "kandiforge",
22
+ "development"
25
23
  ],
26
24
  "bin": {
27
- "kandi": "./bin/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",
@@ -0,0 +1,7 @@
1
+ <claude-mem-context>
2
+ # Recent Activity
3
+
4
+ <!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
5
+
6
+ *No recent activity*
7
+ </claude-mem-context>
@@ -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.3.3';
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 file name based on platform
51
- let fileName, extractCmd, binaryName;
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-universal.tar.gz`;
54
- extractCmd = `tar -xzf`;
55
- binaryName = 'kandi';
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
- extractCmd = `tar -xzf`;
59
- binaryName = 'kandi';
70
+ isZip = false;
71
+ ext = '';
60
72
  } else if (platform === 'win32') {
61
73
  fileName = `kandi-cli-v${RELEASE_VERSION}-windows-x64.zip`;
62
- extractCmd = `unzip -o`;
63
- binaryName = 'kandi.exe';
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
- // Download URL from GitHub release assets (public even for private repos)
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 Kandi CLI v${RELEASE_VERSION} for ${platform} ${arch}...`);
109
+ console.log(`Installing kandi-cli v${RELEASE_VERSION} for ${platform}...`);
81
110
  await downloadFile(downloadUrl, tempFile);
82
111
 
83
- // Extract the binary
84
- console.log('Extracting binary...');
85
- // Use appropriate flag based on archive type: -C for tar, -d for unzip
86
- const destFlag = platform === 'win32' ? '-d' : '-C';
87
- execSync(`${extractCmd} "${tempFile}" ${destFlag} "${binDir}"`, { stdio: 'inherit' });
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}/kandi[.exe]
123
+ // The archive extracts to kandi-cli-v{version}/
93
124
  const extractedDir = path.join(binDir, `kandi-cli-v${RELEASE_VERSION}`);
94
- const extractedPath = path.join(extractedDir, binaryName);
95
- const binaryPath = path.join(binDir, 'kandi-bin' + (platform === 'win32' ? '.exe' : ''));
96
-
97
- // Move the extracted binary to the correct location
98
- if (fs.existsSync(extractedPath)) {
99
- fs.renameSync(extractedPath, binaryPath);
100
- // Clean up the extracted directory
101
- fs.rmdirSync(extractedDir);
102
- } else {
103
- throw new Error(`Binary not found at expected location: ${extractedPath}`);
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
- // Make binary executable (Unix only)
107
- if (platform !== 'win32') {
108
- fs.chmodSync(binaryPath, 0o755);
147
+ // Clean up the extracted directory
148
+ if (fs.existsSync(extractedDir)) {
149
+ fs.rmSync(extractedDir, { recursive: true });
109
150
  }
110
151
 
111
- console.log('✅ Kandi CLI installed successfully!');
112
- console.log(`Binary location: ${binaryPath}`);
113
- console.log('\nTo get started, run: kandi --help');
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('Installation failed:', error.message);
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
- });