mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
2. Updated test commands from Deno tasks to npm scripts
3. Updated quality metrics to reflect v1.0.66 improvements:
- NPM publishing compatibility
- Full CLI command functionality
- SPARC integration with full prompt loading
- Cross-platform support
- Zero dependency requirements
4. Updated development setup to use npm instead of Deno
5. Updated acknowledgments to reference Node.js instead of Deno
The README now accurately reflects the production-ready v1.0.66 release with all the improvements made to the CLI, including:
- NPM publishing readiness with npx support
- Local wrapper generation
- Fixed all CLI commands (agent info/terminate, memory query/export/import)
- Enhanced SPARC integration with full prompt loading (2000+ chars)
- Working MCP status detection
- Cross-platform compatibility
57 lines
1.7 KiB
JavaScript
Executable File
57 lines
1.7 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
// Node.js entry point for npx compatibility
|
|
// This file allows claude-flow to work with: npx claude-flow@latest <command>
|
|
|
|
import { spawn } from 'child_process';
|
|
import { fileURLToPath } from 'url';
|
|
import { dirname, join } from 'path';
|
|
import { existsSync } from 'fs';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
// Check if we have the compiled version
|
|
const compiledPath = join(__dirname, 'dist', 'cli', 'simple-cli.js');
|
|
const sourcePath = join(__dirname, 'src', 'cli', 'simple-cli.ts');
|
|
|
|
// Check which version exists
|
|
if (existsSync(compiledPath)) {
|
|
// Use the compiled JavaScript version
|
|
const cliProcess = spawn('node', [compiledPath, ...process.argv.slice(2)], {
|
|
stdio: 'inherit'
|
|
});
|
|
|
|
cliProcess.on('error', (error) => {
|
|
console.error('❌ Failed to run claude-flow:', error.message);
|
|
process.exit(1);
|
|
});
|
|
|
|
cliProcess.on('exit', (code) => {
|
|
process.exit(code || 0);
|
|
});
|
|
} else if (existsSync(sourcePath)) {
|
|
// Run TypeScript version with tsx
|
|
console.log('📦 Running TypeScript version...');
|
|
|
|
const tsxProcess = spawn('npx', ['tsx', sourcePath, ...process.argv.slice(2)], {
|
|
stdio: 'inherit',
|
|
shell: true
|
|
});
|
|
|
|
tsxProcess.on('error', (error) => {
|
|
console.error('❌ Failed to run claude-flow:', error.message);
|
|
console.log('\n💡 Try installing globally: npm install -g claude-flow');
|
|
process.exit(1);
|
|
});
|
|
|
|
tsxProcess.on('exit', (code) => {
|
|
process.exit(code || 0);
|
|
});
|
|
} else {
|
|
console.error('❌ Error: Could not find claude-flow implementation files');
|
|
console.error('Expected either:');
|
|
console.error(` - ${compiledPath}`);
|
|
console.error(` - ${sourcePath}`);
|
|
process.exit(1);
|
|
} |