ai-agent-test 0.3.0 → 0.3.2
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/ai +36 -0
- package/package.json +1 -1
package/bin/ai
CHANGED
|
@@ -3,6 +3,42 @@
|
|
|
3
3
|
// Pass command-line arguments to the main module
|
|
4
4
|
import { argv } from 'process';
|
|
5
5
|
|
|
6
|
+
// Handle --version command
|
|
7
|
+
if (argv[2] === '--version') {
|
|
8
|
+
import('fs').then(({ readFileSync }) => {
|
|
9
|
+
const packageJson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
|
|
10
|
+
console.log(packageJson.version);
|
|
11
|
+
process.exit(0);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Handle --help command
|
|
16
|
+
if (argv[2] === '--help') {
|
|
17
|
+
import('fs').then(({ readFileSync }) => {
|
|
18
|
+
const packageJson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
|
|
19
|
+
console.log(`ai-agent-test v${packageJson.version}
|
|
20
|
+
|
|
21
|
+
Usage: ai [options] [model-index]
|
|
22
|
+
|
|
23
|
+
Commands:
|
|
24
|
+
update Update the ai-agent-test package to the latest version
|
|
25
|
+
--version Show version number
|
|
26
|
+
--help Show help message
|
|
27
|
+
|
|
28
|
+
Arguments:
|
|
29
|
+
model-index Index of the model to use (from ~/.ai/models.json)
|
|
30
|
+
|
|
31
|
+
Examples:
|
|
32
|
+
ai # Run with default model
|
|
33
|
+
ai 1 # Run with second model in config
|
|
34
|
+
ai update # Update to latest version
|
|
35
|
+
ai --version # Show version
|
|
36
|
+
ai --help # Show help
|
|
37
|
+
`);
|
|
38
|
+
process.exit(0);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
6
42
|
// Handle update command
|
|
7
43
|
if (argv[2] === 'update') {
|
|
8
44
|
import('child_process').then(({ execSync }) => {
|