@aigne/cli 1.51.0-beta.9 → 1.52.0-beta

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/CHANGELOG.md CHANGED
@@ -1,5 +1,140 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.52.0-beta](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0...cli-v1.52.0-beta) (2025-10-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * **cli:** add metadata traces including CLI version, app name, and version ([#646](https://github.com/AIGNE-io/aigne-framework/issues/646)) ([c64bd76](https://github.com/AIGNE-io/aigne-framework/commit/c64bd761ba4c9f3854be5feee208c711bff7a170))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **cli:** prevent potential crashes when environment configurations are incomplete ([#645](https://github.com/AIGNE-io/aigne-framework/issues/645)) ([8ab3a1e](https://github.com/AIGNE-io/aigne-framework/commit/8ab3a1e208a2774987d5d23c7239971c41edfd25))
14
+ * **observability:** support time line as background ([#642](https://github.com/AIGNE-io/aigne-framework/issues/642)) ([6f47870](https://github.com/AIGNE-io/aigne-framework/commit/6f478702090e8106ddcfe318a4766e1246257503))
15
+
16
+
17
+ ### Dependencies
18
+
19
+ * The following workspace dependencies were updated
20
+ * dependencies
21
+ * @aigne/afs-system-fs bumped to 1.0.2-beta
22
+ * @aigne/agent-library bumped to 1.21.49-beta
23
+ * @aigne/agentic-memory bumped to 1.0.49-beta
24
+ * @aigne/aigne-hub bumped to 0.10.3-beta
25
+ * @aigne/core bumped to 1.64.0-beta
26
+ * @aigne/default-memory bumped to 1.2.12-beta
27
+ * @aigne/observability-api bumped to 0.11.3-beta
28
+ * @aigne/openai bumped to 0.16.3-beta
29
+ * devDependencies
30
+ * @aigne/test-utils bumped to 0.5.56-beta
31
+
32
+ ## [1.51.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.14...cli-v1.51.0) (2025-10-19)
33
+
34
+
35
+ ### Dependencies
36
+
37
+ * The following workspace dependencies were updated
38
+ * dependencies
39
+ * @aigne/afs-system-fs bumped to 1.0.1
40
+ * @aigne/agent-library bumped to 1.21.48
41
+ * @aigne/agentic-memory bumped to 1.0.48
42
+ * @aigne/aigne-hub bumped to 0.10.2
43
+ * @aigne/core bumped to 1.63.0
44
+ * @aigne/default-memory bumped to 1.2.11
45
+ * @aigne/observability-api bumped to 0.11.2
46
+ * @aigne/openai bumped to 0.16.2
47
+ * devDependencies
48
+ * @aigne/test-utils bumped to 0.5.55
49
+
50
+ ## [1.51.0-beta.14](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.13...cli-v1.51.0-beta.14) (2025-10-17)
51
+
52
+
53
+ ### Dependencies
54
+
55
+ * The following workspace dependencies were updated
56
+ * dependencies
57
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.8
58
+ * @aigne/agent-library bumped to 1.21.48-beta.12
59
+ * @aigne/agentic-memory bumped to 1.0.48-beta.12
60
+ * @aigne/aigne-hub bumped to 0.10.2-beta.12
61
+ * @aigne/core bumped to 1.63.0-beta.12
62
+ * @aigne/default-memory bumped to 1.2.11-beta.12
63
+ * @aigne/openai bumped to 0.16.2-beta.12
64
+ * devDependencies
65
+ * @aigne/test-utils bumped to 0.5.55-beta.12
66
+
67
+ ## [1.51.0-beta.13](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.12...cli-v1.51.0-beta.13) (2025-10-17)
68
+
69
+
70
+ ### Dependencies
71
+
72
+ * The following workspace dependencies were updated
73
+ * dependencies
74
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.7
75
+ * @aigne/agent-library bumped to 1.21.48-beta.11
76
+ * @aigne/agentic-memory bumped to 1.0.48-beta.11
77
+ * @aigne/aigne-hub bumped to 0.10.2-beta.11
78
+ * @aigne/core bumped to 1.63.0-beta.11
79
+ * @aigne/default-memory bumped to 1.2.11-beta.11
80
+ * @aigne/openai bumped to 0.16.2-beta.11
81
+ * devDependencies
82
+ * @aigne/test-utils bumped to 0.5.55-beta.11
83
+
84
+ ## [1.51.0-beta.12](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.11...cli-v1.51.0-beta.12) (2025-10-16)
85
+
86
+
87
+ ### Dependencies
88
+
89
+ * The following workspace dependencies were updated
90
+ * dependencies
91
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.6
92
+ * @aigne/agent-library bumped to 1.21.48-beta.10
93
+ * @aigne/agentic-memory bumped to 1.0.48-beta.10
94
+ * @aigne/aigne-hub bumped to 0.10.2-beta.10
95
+ * @aigne/core bumped to 1.63.0-beta.10
96
+ * @aigne/default-memory bumped to 1.2.11-beta.10
97
+ * @aigne/observability-api bumped to 0.11.2-beta.5
98
+ * @aigne/openai bumped to 0.16.2-beta.10
99
+ * devDependencies
100
+ * @aigne/test-utils bumped to 0.5.55-beta.10
101
+
102
+ ## [1.51.0-beta.11](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.10...cli-v1.51.0-beta.11) (2025-10-16)
103
+
104
+
105
+ ### Dependencies
106
+
107
+ * The following workspace dependencies were updated
108
+ * dependencies
109
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.5
110
+ * @aigne/agent-library bumped to 1.21.48-beta.9
111
+ * @aigne/agentic-memory bumped to 1.0.48-beta.9
112
+ * @aigne/aigne-hub bumped to 0.10.2-beta.9
113
+ * @aigne/core bumped to 1.63.0-beta.9
114
+ * @aigne/default-memory bumped to 1.2.11-beta.9
115
+ * @aigne/observability-api bumped to 0.11.2-beta.4
116
+ * @aigne/openai bumped to 0.16.2-beta.9
117
+ * devDependencies
118
+ * @aigne/test-utils bumped to 0.5.55-beta.9
119
+
120
+ ## [1.51.0-beta.10](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.9...cli-v1.51.0-beta.10) (2025-10-16)
121
+
122
+
123
+ ### Dependencies
124
+
125
+ * The following workspace dependencies were updated
126
+ * dependencies
127
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.4
128
+ * @aigne/agent-library bumped to 1.21.48-beta.8
129
+ * @aigne/agentic-memory bumped to 1.0.48-beta.8
130
+ * @aigne/aigne-hub bumped to 0.10.2-beta.8
131
+ * @aigne/core bumped to 1.63.0-beta.8
132
+ * @aigne/default-memory bumped to 1.2.11-beta.8
133
+ * @aigne/observability-api bumped to 0.11.2-beta.3
134
+ * @aigne/openai bumped to 0.16.2-beta.8
135
+ * devDependencies
136
+ * @aigne/test-utils bumped to 0.5.55-beta.8
137
+
3
138
  ## [1.51.0-beta.9](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.8...cli-v1.51.0-beta.9) (2025-10-16)
4
139
 
5
140
 
@@ -4,15 +4,19 @@ import { type AgentRunCommonOptions } from "../utils/yargs.js";
4
4
  export declare function createAppCommands({ argv }?: {
5
5
  argv?: string[];
6
6
  }): CommandModule[];
7
- export declare const agentCommandModule: ({ dir, agent, chat, }: {
7
+ export declare const agentCommandModule: ({ dir, agent, chat, version, packageName, }: {
8
8
  dir: string;
9
9
  agent: AgentInChildProcess;
10
10
  chat?: boolean;
11
+ version?: string;
12
+ packageName?: string;
11
13
  }) => CommandModule<unknown, AgentRunCommonOptions>;
12
- export declare const cliAgentCommandModule: ({ dir, parent, cliAgent, }: {
14
+ export declare const cliAgentCommandModule: ({ dir, parent, cliAgent, version, packageName, }: {
13
15
  dir: string;
14
16
  parent?: string[];
15
17
  cliAgent: CLIAgentInChildProcess;
18
+ version?: string;
19
+ packageName?: string;
16
20
  }) => CommandModule<unknown, AgentRunCommonOptions>;
17
21
  interface LoadApplicationOptions {
18
22
  packageName: string;
@@ -7,6 +7,7 @@ import { logger } from "@aigne/core/utils/logger.js";
7
7
  import { jsonSchemaToZod } from "@aigne/json-schema-to-zod";
8
8
  import { Listr, PRESET_TIMER } from "@aigne/listr2";
9
9
  import { joinURL } from "ufo";
10
+ import { AIGNE_CLI_VERSION } from "../constants.js";
10
11
  import { downloadAndExtract } from "../utils/download.js";
11
12
  import { withSpinner } from "../utils/spinner.js";
12
13
  import { runAIGNEInChildProcess, } from "../utils/workers/run-aigne-in-child-process.js";
@@ -50,17 +51,23 @@ export function createAppCommands({ argv } = {}) {
50
51
  });
51
52
  if (aigne.cli?.chat) {
52
53
  y.command({
53
- ...agentCommandModule({ dir, agent: aigne.cli.chat, chat: true }),
54
+ ...agentCommandModule({
55
+ dir,
56
+ agent: aigne.cli.chat,
57
+ chat: true,
58
+ version,
59
+ packageName: app.name,
60
+ }),
54
61
  command: "$0",
55
62
  });
56
63
  }
57
64
  for (const cliAgent of aigne.cli?.agents ?? []) {
58
- y.command(cliAgentCommandModule({ dir, cliAgent }));
65
+ y.command(cliAgentCommandModule({ dir, cliAgent, version, packageName: app.name }));
59
66
  }
60
67
  y.option("model", {
61
68
  type: "string",
62
69
  description: "Model to use for the application, example: openai:gpt-4.1 or google:gemini-2.5-flash",
63
- }).command(serveMcpCommandModule({ name: app.name, dir }));
70
+ }).command(serveMcpCommandModule({ name: app.name, version, dir }));
64
71
  y.version(`${app.name} v${version}`).alias("version", "v");
65
72
  }
66
73
  return y.demandCommand();
@@ -68,7 +75,7 @@ export function createAppCommands({ argv } = {}) {
68
75
  handler: () => { },
69
76
  }));
70
77
  }
71
- const serveMcpCommandModule = ({ name, dir, }) => ({
78
+ const serveMcpCommandModule = ({ name, dir, version, }) => ({
72
79
  command: "serve-mcp",
73
80
  describe: `Serve ${name} a MCP server (streamable http)`,
74
81
  builder: (yargs) => {
@@ -89,7 +96,14 @@ const serveMcpCommandModule = ({ name, dir, }) => ({
89
96
  });
90
97
  },
91
98
  handler: async (options) => {
92
- await serveMCPServerFromDir({ ...options, dir });
99
+ await serveMCPServerFromDir({
100
+ ...options,
101
+ dir,
102
+ metadata: {
103
+ appName: name,
104
+ appVersion: version,
105
+ },
106
+ });
93
107
  },
94
108
  });
95
109
  function isUpgradeCommand(argv) {
@@ -133,7 +147,7 @@ const upgradeCommandModule = ({ packageName, dir, }) => ({
133
147
  console.log(`\n✅ ${packageName} is already at the latest version (${app.version})`);
134
148
  },
135
149
  });
136
- export const agentCommandModule = ({ dir, agent, chat, }) => {
150
+ export const agentCommandModule = ({ dir, agent, chat, version, packageName, }) => {
137
151
  return {
138
152
  command: agent.name,
139
153
  aliases: agent.alias || [],
@@ -148,12 +162,17 @@ export const agentCommandModule = ({ dir, agent, chat, }) => {
148
162
  dir,
149
163
  agent: agent.name,
150
164
  input: { ...options, chat: chat ?? options.chat },
165
+ metadata: {
166
+ cliVersion: AIGNE_CLI_VERSION,
167
+ appName: packageName,
168
+ appVersion: version,
169
+ },
151
170
  });
152
171
  process.exit(0);
153
172
  },
154
173
  };
155
174
  };
156
- export const cliAgentCommandModule = ({ dir, parent, cliAgent, }) => {
175
+ export const cliAgentCommandModule = ({ dir, parent, cliAgent, version, packageName, }) => {
157
176
  const { agent, agents } = cliAgent;
158
177
  const name = cliAgent.name || agent?.name;
159
178
  assert(name, "CLI agent must have a name");
@@ -167,7 +186,13 @@ export const cliAgentCommandModule = ({ dir, parent, cliAgent, }) => {
167
186
  }
168
187
  if (agents?.length) {
169
188
  for (const cmd of agents) {
170
- yargs.command(cliAgentCommandModule({ dir, parent: (parent ?? []).concat(name), cliAgent: cmd }));
189
+ yargs.command(cliAgentCommandModule({
190
+ dir,
191
+ parent: (parent ?? []).concat(name),
192
+ cliAgent: cmd,
193
+ version,
194
+ packageName,
195
+ }));
171
196
  }
172
197
  }
173
198
  if (!agent)
@@ -184,6 +209,11 @@ export const cliAgentCommandModule = ({ dir, parent, cliAgent, }) => {
184
209
  parent,
185
210
  agent: name,
186
211
  input: options,
212
+ metadata: {
213
+ cliVersion: AIGNE_CLI_VERSION,
214
+ appName: packageName,
215
+ appVersion: version,
216
+ },
187
217
  });
188
218
  process.exit(0);
189
219
  },
@@ -196,6 +226,10 @@ export async function loadApplication(options) {
196
226
  const aigne = await runAIGNEInChildProcess("loadAIGNE", {
197
227
  path: dir,
198
228
  skipModelLoading: true,
229
+ metadata: {
230
+ appName: packageName,
231
+ appVersion: check?.version,
232
+ },
199
233
  }).catch(async (error) => {
200
234
  logger.error(`⚠️ Failed to load ${packageName}, trying to reinstall:`, error.message);
201
235
  await withSpinner("", async () => {
@@ -211,7 +245,14 @@ export async function loadApplication(options) {
211
245
  return null;
212
246
  const result = await installApp({ dir, packageName, beta: check?.version?.includes("beta") });
213
247
  return {
214
- aigne: await runAIGNEInChildProcess("loadAIGNE", { path: dir, skipModelLoading: true }),
248
+ aigne: await runAIGNEInChildProcess("loadAIGNE", {
249
+ path: dir,
250
+ skipModelLoading: true,
251
+ metadata: {
252
+ appName: packageName,
253
+ appVersion: result.version,
254
+ },
255
+ }),
215
256
  version: result.version,
216
257
  };
217
258
  }
@@ -1,3 +1,4 @@
1
+ import type { AIGNEMetadata } from "@aigne/core/aigne/type.js";
1
2
  import type { CommandModule } from "yargs";
2
3
  interface ServeMCPOptions {
3
4
  path: string;
@@ -15,5 +16,6 @@ export declare function serveMCPServerFromDir(options: {
15
16
  port?: number;
16
17
  pathname: string;
17
18
  aigneHubUrl?: string;
19
+ metadata?: AIGNEMetadata;
18
20
  }): Promise<void>;
19
21
  export {};
@@ -54,6 +54,7 @@ export async function serveMCPServerFromDir(options) {
54
54
  const aigne = await loadAIGNE({
55
55
  path: options.dir,
56
56
  modelOptions: { aigneHubUrl: options.aigneHubUrl },
57
+ metadata: options.metadata,
57
58
  });
58
59
  await serveMCPServer({
59
60
  aigne,
@@ -56,7 +56,7 @@ export const formatModelName = async (model, inquirerPrompt) => {
56
56
  console.log(chalk.yellow(`You can use command "export ${requireEnvs[0]}=xxx" to set API Key in your shell. Or you can set environment variables in .env file.`));
57
57
  process.exit(0);
58
58
  }
59
- if (!envs.default?.AIGNE_HUB_API_URL) {
59
+ if (envs && Object.keys(envs).length > 0 && !envs.default?.AIGNE_HUB_API_URL) {
60
60
  const host = new URL(AIGNE_HUB_URL).host;
61
61
  const defaultEnv = envs[host]?.AIGNE_HUB_API_URL
62
62
  ? envs[host]
@@ -18,6 +18,7 @@ export interface Dataset {
18
18
  export interface RunOptions {
19
19
  timeoutMs?: number;
20
20
  concurrency?: number;
21
+ iterations?: number;
21
22
  hooks?: {
22
23
  onBeforeRun?: (item: DatasetItem) => void;
23
24
  onAfterRun?: (result: RunResult) => void;
@@ -1,4 +1,5 @@
1
1
  import { AIGNE, type ChatModelInputOptions, type ImageModelInputOptions } from "@aigne/core";
2
+ import type { AIGNEMetadata } from "@aigne/core/aigne/type.js";
2
3
  import type { LoadCredentialOptions } from "./aigne-hub/type.js";
3
4
  import type { AgentRunCommonOptions } from "./yargs.js";
4
5
  export interface RunOptions extends AgentRunCommonOptions {
@@ -7,10 +8,11 @@ export interface RunOptions extends AgentRunCommonOptions {
7
8
  cacheDir?: string;
8
9
  aigneHubUrl?: string;
9
10
  }
10
- export declare function loadAIGNE({ path, modelOptions, imageModelOptions, printTips, skipModelLoading, }: {
11
+ export declare function loadAIGNE({ path, modelOptions, imageModelOptions, printTips, skipModelLoading, metadata, }: {
11
12
  path?: string;
12
13
  modelOptions?: ChatModelInputOptions & LoadCredentialOptions;
13
14
  imageModelOptions?: ImageModelInputOptions & LoadCredentialOptions;
14
15
  printTips?: boolean;
15
16
  skipModelLoading?: boolean;
17
+ metadata?: AIGNEMetadata;
16
18
  }): Promise<AIGNE<import("@aigne/core").UserContext>>;
@@ -2,7 +2,7 @@ import { AIGNE, } from "@aigne/core";
2
2
  import { isNil, omitBy } from "@aigne/core/utils/type-utils.js";
3
3
  import boxen from "boxen";
4
4
  import chalk from "chalk";
5
- import { availableMemories } from "../constants.js";
5
+ import { AIGNE_CLI_VERSION, availableMemories } from "../constants.js";
6
6
  import { loadChatModel, loadImageModel, maskApiKey } from "./aigne-hub/model.js";
7
7
  import { getUrlOrigin } from "./get-url-origin.js";
8
8
  let printed = false;
@@ -21,7 +21,7 @@ async function printChatModelInfoBox(model) {
21
21
  console.log(boxen(lines.join("\n"), { padding: 1, borderStyle: "classic", borderColor: "cyan" }));
22
22
  console.log("");
23
23
  }
24
- export async function loadAIGNE({ path, modelOptions, imageModelOptions, printTips = false, skipModelLoading = false, }) {
24
+ export async function loadAIGNE({ path, modelOptions, imageModelOptions, printTips = false, skipModelLoading = false, metadata, }) {
25
25
  let aigne;
26
26
  if (path) {
27
27
  aigne = await AIGNE.load(path, {
@@ -52,11 +52,15 @@ export async function loadAIGNE({ path, modelOptions, imageModelOptions, printTi
52
52
  },
53
53
  ],
54
54
  },
55
+ metadata: { ...metadata, cliVersion: AIGNE_CLI_VERSION },
55
56
  });
56
57
  }
57
58
  else {
58
59
  const chatModel = await loadChatModel({ ...modelOptions });
59
- aigne = new AIGNE({ model: chatModel });
60
+ aigne = new AIGNE({
61
+ model: chatModel,
62
+ metadata: { ...metadata, cliVersion: AIGNE_CLI_VERSION },
63
+ });
60
64
  }
61
65
  if (printTips && !printed) {
62
66
  printed = true;
@@ -1,4 +1,5 @@
1
1
  import type { Message } from "@aigne/core";
2
+ import type { AIGNEMetadata } from "@aigne/core/aigne/type.js";
2
3
  import { loadAIGNE } from "../load-aigne.js";
3
4
  import { type AgentRunCommonOptions } from "../yargs.js";
4
5
  import { type AgentInChildProcess, type CLIAgentInChildProcess } from "./run-aigne-in-child-process.js";
@@ -17,4 +18,5 @@ export declare function invokeCLIAgentFromDirInChildProcess(options: {
17
18
  parent?: string[];
18
19
  agent: string;
19
20
  input: Message & AgentRunCommonOptions;
21
+ metadata?: AIGNEMetadata;
20
22
  }): Promise<void>;
@@ -53,9 +53,8 @@ export async function invokeCLIAgentFromDirInChildProcess(options) {
53
53
  path: options.dir,
54
54
  modelOptions: options.input,
55
55
  printTips: true,
56
- imageModelOptions: {
57
- model: options.input.imageModel,
58
- },
56
+ imageModelOptions: { model: options.input.imageModel },
57
+ metadata: options.metadata,
59
58
  });
60
59
  try {
61
60
  const { chat } = aigne.cli;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.51.0-beta.9",
3
+ "version": "1.52.0-beta",
4
4
  "description": "Your command center for agent development",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -89,14 +89,14 @@
89
89
  "yoctocolors-cjs": "^2.1.3",
90
90
  "zod": "^3.25.67",
91
91
  "zod-to-json-schema": "^3.24.6",
92
- "@aigne/agent-library": "^1.21.48-beta.7",
93
- "@aigne/afs-system-fs": "^1.0.1-beta.3",
94
- "@aigne/agentic-memory": "^1.0.48-beta.7",
95
- "@aigne/core": "^1.63.0-beta.7",
96
- "@aigne/aigne-hub": "^0.10.2-beta.7",
97
- "@aigne/observability-api": "^0.11.2-beta.2",
98
- "@aigne/default-memory": "^1.2.11-beta.7",
99
- "@aigne/openai": "^0.16.2-beta.7"
92
+ "@aigne/afs-system-fs": "^1.0.2-beta",
93
+ "@aigne/agentic-memory": "^1.0.49-beta",
94
+ "@aigne/core": "^1.64.0-beta",
95
+ "@aigne/aigne-hub": "^0.10.3-beta",
96
+ "@aigne/agent-library": "^1.21.49-beta",
97
+ "@aigne/default-memory": "^1.2.12-beta",
98
+ "@aigne/observability-api": "^0.11.3-beta",
99
+ "@aigne/openai": "^0.16.3-beta"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@inquirer/testing": "^2.1.50",
@@ -113,7 +113,7 @@
113
113
  "rimraf": "^6.0.1",
114
114
  "typescript": "^5.9.2",
115
115
  "ufo": "^1.6.1",
116
- "@aigne/test-utils": "^0.5.55-beta.7"
116
+ "@aigne/test-utils": "^0.5.56-beta"
117
117
  },
118
118
  "scripts": {
119
119
  "lint": "tsc --noEmit",