@ranger-testing/ranger-cli 1.0.0 → 1.0.1
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/build/cli.js +20 -4
- package/package.json +1 -1
package/build/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { readdir, mkdir, copyFile, writeFile } from 'fs/promises';
|
|
|
3
3
|
import { join, resolve, dirname } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { existsSync } from 'fs';
|
|
6
|
+
import { execSync } from 'child_process';
|
|
6
7
|
import yargs from 'yargs/yargs';
|
|
7
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
9
|
const __dirname = dirname(__filename);
|
|
@@ -55,7 +56,7 @@ async function initAgents(targetDir, token, serverUrl) {
|
|
|
55
56
|
const sourcePath = join(sourceAgentsDir, file);
|
|
56
57
|
const targetPath = join(claudeAgentsDir, file);
|
|
57
58
|
await copyFile(sourcePath, targetPath);
|
|
58
|
-
console.log(`✓
|
|
59
|
+
console.log(`✓ Created agent: ${file}`);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
catch (error) {
|
|
@@ -81,10 +82,25 @@ async function initAgents(targetDir, token, serverUrl) {
|
|
|
81
82
|
const mcpConfigPath = join(resolvedDir, '.mcp.json');
|
|
82
83
|
await writeFile(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
|
|
83
84
|
console.log(`✓ Created .mcp.json configuration`);
|
|
85
|
+
// Check that @ranger-testing/playwright is installed globally
|
|
86
|
+
try {
|
|
87
|
+
execSync('npm list -g @ranger-testing/playwright', {
|
|
88
|
+
stdio: 'pipe',
|
|
89
|
+
});
|
|
90
|
+
console.log('✓ @ranger-testing/playwright is installed globally');
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
console.error('\n┌─────────────────────────────────────────────────────┐');
|
|
94
|
+
console.error('│ ❌ Missing required dependency │');
|
|
95
|
+
console.error('├─────────────────────────────────────────────────────┤');
|
|
96
|
+
console.error('│ @ranger-testing/playwright is not installed. │');
|
|
97
|
+
console.error('│ │');
|
|
98
|
+
console.error('│ Please install it globally first: │');
|
|
99
|
+
console.error('│ npm install -g @ranger-testing/playwright │');
|
|
100
|
+
console.error('└─────────────────────────────────────────────────────┘\n');
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
84
103
|
console.log('\n✅ Claude Code agents initialized successfully!');
|
|
85
|
-
console.log('\nNext steps:');
|
|
86
|
-
console.log('1. MCP server configured at', mcpServerUrl);
|
|
87
|
-
console.log('2. Your Claude Code subagents are now available in .claude/agents/');
|
|
88
104
|
}
|
|
89
105
|
// Setup yargs CLI
|
|
90
106
|
yargs(process.argv.slice(2))
|