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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/bin/ai +11 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -67,7 +67,7 @@ Start CLI with selected model (default is the first model in the array):
67
67
 
68
68
  ```bash
69
69
  # option 1
70
- ai 1 # to select the second model (Google Gemini)
70
+ ai models 1 # to select the second model (Google Gemini)
71
71
 
72
72
  # option 2
73
73
  export AI_MODEL_INDEX=1
package/bin/ai CHANGED
@@ -1,6 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // Load config first (before any imports that use it)
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 # Run with second model in config
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")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agent-test",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "ai": "./bin/ai"