ai-agent-test 0.5.2 → 0.5.4
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/README.md +1 -1
- package/bin/ai +11 -10
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/ai
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
//
|
|
3
|
+
// Pass command-line arguments to the main module first
|
|
4
|
+
import { argv } from "process"
|
|
5
|
+
|
|
6
|
+
// Set AI_MODEL_INDEX environment variable if provided via 'models' command
|
|
7
|
+
if (argv[2] === "models" && argv[3]) {
|
|
8
|
+
process.env.AI_MODEL_INDEX = argv[3]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Load config after setting model index
|
|
4
12
|
import { loadConfig } from "../dist/config.js"
|
|
5
13
|
const config = loadConfig()
|
|
6
14
|
process.env.AI_MODEL_APITYPE = config.modelApiType
|
|
@@ -8,9 +16,6 @@ process.env.AI_MODEL_NAME = config.modelName
|
|
|
8
16
|
process.env.AI_API_BASE_URL = config.apiBaseUrl
|
|
9
17
|
process.env.AI_API_KEY = config.apiKey
|
|
10
18
|
|
|
11
|
-
// Pass command-line arguments to the main module
|
|
12
|
-
import { argv } from "process"
|
|
13
|
-
|
|
14
19
|
// Handle --version command
|
|
15
20
|
if (argv[2] === "--version") {
|
|
16
21
|
import("fs").then(({ readFileSync }) => {
|
|
@@ -33,6 +38,7 @@ if (argv[2] === "--help") {
|
|
|
33
38
|
Usage: ai [options] [model-index]
|
|
34
39
|
|
|
35
40
|
Commands:
|
|
41
|
+
models <idx> Run with model at index <idx> from config
|
|
36
42
|
sessions ls List last 20 sessions
|
|
37
43
|
sessions <idx> Load and restart from session <idx>
|
|
38
44
|
update Update the ai-agent-test package to the latest version
|
|
@@ -44,7 +50,7 @@ Arguments:
|
|
|
44
50
|
|
|
45
51
|
Examples:
|
|
46
52
|
ai # Run with default model
|
|
47
|
-
ai 1
|
|
53
|
+
ai models 1 # Run with second model in config
|
|
48
54
|
ai sessions ls # List last 20 sessions
|
|
49
55
|
ai sessions 2 # Load and restart from session 2
|
|
50
56
|
ai update # Update to latest version
|
|
@@ -116,9 +122,4 @@ if (argv[2] === "sessions") {
|
|
|
116
122
|
)
|
|
117
123
|
}
|
|
118
124
|
|
|
119
|
-
// Set AI_MODEL_INDEX environment variable if provided as first argument
|
|
120
|
-
if (argv[2]) {
|
|
121
|
-
process.env.AI_MODEL_INDEX = argv[2]
|
|
122
|
-
}
|
|
123
|
-
|
|
124
125
|
import("../dist/index.js")
|