-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.js
More file actions
30 lines (25 loc) · 1014 Bytes
/
test.js
File metadata and controls
30 lines (25 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env node
// Test script to verify CLI functionality
import { Command } from 'commander';
const program = new Command();
program
.name('ai-shell')
.description('Convert natural language to shell commands using OpenAI')
.version('1.0.0')
.argument('[query]', 'Natural language description of the command you want to run')
.option('-e, --explain', 'Explain what the command does')
.option('-d, --dry-run', 'Show the command but don\'t run it')
.option('--history', 'Show command history')
.action((query, options) => {
console.log('✅ CLI structure test passed!');
console.log('Query:', query || 'none');
console.log('Options:', options);
if (!query) {
console.log('\n📋 Available commands:');
console.log(' npx ai-shell "list all files"');
console.log(' npx ai-shell "find python files" --dry-run');
console.log(' npx ai-shell "show disk usage" --explain');
console.log(' npx ai-shell --history');
}
});
program.parse();