@aigne/cli 1.30.1 → 1.30.3

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,38 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.30.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.30.2...cli-v1.30.3) (2025-08-05)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **cli:** improve CLI prompts and output handling ([#318](https://github.com/AIGNE-io/aigne-framework/issues/318)) ([681ee79](https://github.com/AIGNE-io/aigne-framework/commit/681ee79e9b18aed5a977a0a418c2d9df20a7297c))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/agent-library bumped to 1.21.12
16
+ * @aigne/agentic-memory bumped to 1.0.12
17
+ * @aigne/aigne-hub bumped to 0.4.3
18
+ * @aigne/openai bumped to 0.10.12
19
+ * @aigne/core bumped to 1.44.0
20
+ * @aigne/default-memory bumped to 1.0.12
21
+
22
+ ## [1.30.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.30.1...cli-v1.30.2) (2025-08-05)
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @aigne/agent-library bumped to 1.21.11
30
+ * @aigne/agentic-memory bumped to 1.0.11
31
+ * @aigne/aigne-hub bumped to 0.4.2
32
+ * @aigne/openai bumped to 0.10.11
33
+ * @aigne/core bumped to 1.43.1
34
+ * @aigne/default-memory bumped to 1.0.11
35
+
3
36
  ## [1.30.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.30.0...cli-v1.30.1) (2025-08-04)
4
37
 
5
38
 
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @aigne/cli
2
2
 
3
+ <p align="center">
4
+ <picture>
5
+ <source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/packages/cli/logo-dark.svg" media="(prefers-color-scheme: dark)">
6
+ <source srcset="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/packages/cli/logo.svg" media="(prefers-color-scheme: light)">
7
+ <img src="https://raw.githubusercontent.com/AIGNE-io/aigne-framework/main/packages/cli/logo.svg" alt="AIGNE Logo" width="400" />
8
+ </picture>
9
+ </p>
10
+
3
11
  [![GitHub star chart](https://img.shields.io/github/stars/AIGNE-io/aigne-framework?style=flat-square)](https://star-history.com/#AIGNE-io/aigne-framework)
4
12
  [![Open Issues](https://img.shields.io/github/issues-raw/AIGNE-io/aigne-framework?style=flat-square)](https://github.com/AIGNE-io/aigne-framework/issues)
5
13
  [![codecov](https://codecov.io/gh/AIGNE-io/aigne-framework/graph/badge.svg?token=DO07834RQL)](https://codecov.io/gh/AIGNE-io/aigne-framework)
package/dist/cli.js CHANGED
@@ -17,6 +17,7 @@ function getAIGNEFilePath() {
17
17
  }
18
18
  const aigneFilePath = getAIGNEFilePath();
19
19
  export default createAIGNECommand({ aigneFilePath })
20
+ .fail(() => { })
20
21
  .parseAsync(hideBin([...process.argv.slice(0, 2), ...process.argv.slice(aigneFilePath ? 3 : 2)]))
21
22
  .catch((error) => {
22
23
  console.log(""); // Add an empty line for better readability
@@ -23,9 +23,7 @@ export function createAIGNECommand(options) {
23
23
  .command(createObservabilityCommand())
24
24
  .command(createConnectCommand())
25
25
  .command(createAppCommands())
26
- .help()
27
26
  .alias("help", "h")
28
27
  .alias("version", "v")
29
- .showHelpOnFail(true)
30
28
  .strict();
31
29
  }
@@ -7,10 +7,9 @@ import { flat, omit } from "@aigne/core/utils/type-utils.js";
7
7
  import { figures } from "@aigne/listr2";
8
8
  import { markedTerminal } from "@aigne/marked-terminal";
9
9
  import * as prompts from "@inquirer/prompts";
10
- import { ListrInquirerPromptAdapter } from "@listr2/prompt-adapter-inquirer";
11
10
  import chalk from "chalk";
12
11
  import { Marked } from "marked";
13
- import { AIGNEListr } from "../utils/listr.js";
12
+ import { AIGNEListr, AIGNEListrRenderer } from "../utils/listr.js";
14
13
  import { parseDuration } from "../utils/time.js";
15
14
  export class TerminalTracer {
16
15
  context;
@@ -66,15 +65,17 @@ export class TerminalTracer {
66
65
  get: (_target, prop) => {
67
66
  // biome-ignore lint/performance/noDynamicNamespaceImportAccess: we need to access prompts dynamically
68
67
  const method = prompts[prop];
69
- if (!method)
68
+ if (typeof method !== "function")
70
69
  return undefined;
71
70
  return async (config) => {
72
- const { taskWrapper } = await task.listr.promise;
73
- const result = await taskWrapper
74
- .prompt(ListrInquirerPromptAdapter)
75
- .run(method, config);
76
- console.log(`${chalk.blue("✔")} ${chalk.bold(config.message)} ${result}`);
77
- return result;
71
+ const renderer = listr["renderer"] instanceof AIGNEListrRenderer ? listr["renderer"] : undefined;
72
+ await renderer?.pause();
73
+ try {
74
+ return await method({ ...config });
75
+ }
76
+ finally {
77
+ await renderer?.resume();
78
+ }
78
79
  };
79
80
  },
80
81
  }),
@@ -37,6 +37,12 @@ export declare class AIGNEListrRenderer extends DefaultRenderer {
37
37
  get _options(): AIGNEListrRendererOptions;
38
38
  get _spinner(): Spinner;
39
39
  update(): void;
40
+ private paused;
41
+ private ended;
42
+ end(): void;
43
+ pause(): Promise<void>;
44
+ resume(): Promise<void>;
45
+ log(message: string): void;
40
46
  private isPreviousPrompt;
41
47
  create({ running, ...options }: Parameters<DefaultRenderer["create"]>[0] & {
42
48
  running?: boolean;
@@ -58,7 +58,11 @@ export class AIGNEListr extends Listr {
58
58
  }
59
59
  logger.logMessage = (...args) => this.logs.push(format(...args));
60
60
  for (const method of ["debug", "log", "info", "warn", "error"]) {
61
- console[method] = (...args) => this.logs.push(format(...args));
61
+ console[method] = (...args) => {
62
+ const renderer = this["renderer"] instanceof AIGNEListrRenderer ? this["renderer"] : undefined;
63
+ const msg = format(...args);
64
+ renderer ? renderer.log(msg) : this.logs.push(msg);
65
+ };
62
66
  }
63
67
  const _stream = await stream();
64
68
  this.add({ task: () => this.extractStream(_stream) });
@@ -95,8 +99,32 @@ export class AIGNEListrRenderer extends DefaultRenderer {
95
99
  return this["spinner"];
96
100
  }
97
101
  update() {
102
+ if (this.paused || this.ended) {
103
+ return;
104
+ }
98
105
  this._updater(this.create({ running: true }));
99
106
  }
107
+ paused = false;
108
+ ended = false;
109
+ end() {
110
+ this.ended = true;
111
+ super.end();
112
+ }
113
+ async pause() {
114
+ this.paused = true;
115
+ this._updater?.clear();
116
+ this._updater?.done();
117
+ await new Promise((resolve) => setTimeout(resolve, 100));
118
+ this._logger.process.release();
119
+ }
120
+ async resume() {
121
+ this._logger.process.hijack();
122
+ this.paused = false;
123
+ }
124
+ log(message) {
125
+ this._updater?.clear();
126
+ this._logger.toStdout(message);
127
+ }
100
128
  isPreviousPrompt = false;
101
129
  create({ running = false, ...options }) {
102
130
  const logs = this._options.aigne?.getStdoutLogs?.();
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.30.1",
4
- "description": "cli for AIGNE framework",
3
+ "version": "1.30.3",
4
+ "description": "Command-line interface for AIGNE Framework - A functional AI application development framework for building scalable AI-powered applications with workflow patterns, MCP protocol integration, and multi-model support",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
9
- "homepage": "https://github.com/AIGNE-io/aigne-framework",
9
+ "homepage": "https://www.aigne.io/cli",
10
10
  "license": "Elastic-2.0",
11
11
  "repository": {
12
12
  "type": "git",
13
13
  "url": "git+https://github.com/AIGNE-io/aigne-framework"
14
14
  },
15
+ "bugs": {
16
+ "url": "https://github.com/AIGNE-io/aigne-framework/issues"
17
+ },
15
18
  "files": [
16
19
  "dist",
17
20
  "LICENSE",
@@ -70,13 +73,13 @@
70
73
  "yaml": "^2.8.0",
71
74
  "yargs": "^18.0.0",
72
75
  "zod": "^3.25.67",
73
- "@aigne/aigne-hub": "^0.4.1",
74
- "@aigne/agent-library": "^1.21.10",
75
- "@aigne/openai": "^0.10.10",
76
- "@aigne/default-memory": "^1.0.10",
77
- "@aigne/agentic-memory": "^1.0.10",
76
+ "@aigne/agent-library": "^1.21.12",
77
+ "@aigne/aigne-hub": "^0.4.3",
78
+ "@aigne/core": "^1.44.0",
79
+ "@aigne/default-memory": "^1.0.12",
78
80
  "@aigne/observability-api": "^0.9.0",
79
- "@aigne/core": "^1.43.0"
81
+ "@aigne/agentic-memory": "^1.0.12",
82
+ "@aigne/openai": "^0.10.12"
80
83
  },
81
84
  "devDependencies": {
82
85
  "@types/archiver": "^6.0.3",