@aigne/cli 1.30.2 → 1.30.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/CHANGELOG.md +39 -0
- package/dist/cli.js +7 -0
- package/dist/commands/aigne.js +2 -3
- package/dist/commands/app.js +2 -2
- package/dist/tracer/terminal.js +10 -9
- package/dist/utils/listr.d.ts +6 -0
- package/dist/utils/listr.js +29 -1
- package/dist/utils/load-aigne.d.ts +3 -1
- package/dist/utils/load-aigne.js +3 -3
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.30.4](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.30.3...cli-v1.30.4) (2025-08-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **cli:** improve help display and command handling ([#319](https://github.com/AIGNE-io/aigne-framework/issues/319)) ([306ca5f](https://github.com/AIGNE-io/aigne-framework/commit/306ca5f251d6de356131b11909293be3904d0675))
|
|
9
|
+
* create connect add app info ([#321](https://github.com/AIGNE-io/aigne-framework/issues/321)) ([f0094a3](https://github.com/AIGNE-io/aigne-framework/commit/f0094a3f891617a9822df90918445639cd8c1a90))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @aigne/agent-library bumped to 1.21.13
|
|
17
|
+
* @aigne/agentic-memory bumped to 1.0.13
|
|
18
|
+
* @aigne/aigne-hub bumped to 0.4.4
|
|
19
|
+
* @aigne/openai bumped to 0.10.13
|
|
20
|
+
* @aigne/core bumped to 1.45.0
|
|
21
|
+
* @aigne/default-memory bumped to 1.0.13
|
|
22
|
+
|
|
23
|
+
## [1.30.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.30.2...cli-v1.30.3) (2025-08-05)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **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))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Dependencies
|
|
32
|
+
|
|
33
|
+
* The following workspace dependencies were updated
|
|
34
|
+
* dependencies
|
|
35
|
+
* @aigne/agent-library bumped to 1.21.12
|
|
36
|
+
* @aigne/agentic-memory bumped to 1.0.12
|
|
37
|
+
* @aigne/aigne-hub bumped to 0.4.3
|
|
38
|
+
* @aigne/openai bumped to 0.10.12
|
|
39
|
+
* @aigne/core bumped to 1.44.0
|
|
40
|
+
* @aigne/default-memory bumped to 1.0.12
|
|
41
|
+
|
|
3
42
|
## [1.30.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.30.1...cli-v1.30.2) (2025-08-05)
|
|
4
43
|
|
|
5
44
|
|
package/dist/cli.js
CHANGED
|
@@ -17,6 +17,13 @@ function getAIGNEFilePath() {
|
|
|
17
17
|
}
|
|
18
18
|
const aigneFilePath = getAIGNEFilePath();
|
|
19
19
|
export default createAIGNECommand({ aigneFilePath })
|
|
20
|
+
.fail((message, error, yargs) => {
|
|
21
|
+
// We catch all errors below, here just print the help message non-error case like demandCommand
|
|
22
|
+
if (!error) {
|
|
23
|
+
yargs.showHelp();
|
|
24
|
+
console.error(`\n${message}`);
|
|
25
|
+
}
|
|
26
|
+
})
|
|
20
27
|
.parseAsync(hideBin([...process.argv.slice(0, 2), ...process.argv.slice(aigneFilePath ? 3 : 2)]))
|
|
21
28
|
.catch((error) => {
|
|
22
29
|
console.log(""); // Add an empty line for better readability
|
package/dist/commands/aigne.js
CHANGED
|
@@ -11,7 +11,7 @@ import { createServeMCPCommand } from "./serve-mcp.js";
|
|
|
11
11
|
import { createTestCommand } from "./test.js";
|
|
12
12
|
export function createAIGNECommand(options) {
|
|
13
13
|
console.log(asciiLogo);
|
|
14
|
-
console.log(`${chalk.grey("TIPS:")}
|
|
14
|
+
console.log(`${chalk.grey("TIPS:")} run ${chalk.blue("aigne observe")} to start the observability server.\n`);
|
|
15
15
|
return yargs()
|
|
16
16
|
.scriptName("aigne")
|
|
17
17
|
.usage("CLI for AIGNE framework")
|
|
@@ -23,9 +23,8 @@ export function createAIGNECommand(options) {
|
|
|
23
23
|
.command(createObservabilityCommand())
|
|
24
24
|
.command(createConnectCommand())
|
|
25
25
|
.command(createAppCommands())
|
|
26
|
-
.
|
|
26
|
+
.demandCommand()
|
|
27
27
|
.alias("help", "h")
|
|
28
28
|
.alias("version", "v")
|
|
29
|
-
.showHelpOnFail(true)
|
|
30
29
|
.strict();
|
|
31
30
|
}
|
package/dist/commands/app.js
CHANGED
|
@@ -40,7 +40,7 @@ export function createAppCommands() {
|
|
|
40
40
|
for (const agent of aigne.cli?.agents ?? []) {
|
|
41
41
|
yargs.command(agentCommandModule({ dir, agent }));
|
|
42
42
|
}
|
|
43
|
-
yargs.version(`${app.name} v${version}`);
|
|
43
|
+
yargs.version(`${app.name} v${version}`).alias("version", "v");
|
|
44
44
|
return yargs.demandCommand();
|
|
45
45
|
},
|
|
46
46
|
handler: () => { },
|
|
@@ -77,7 +77,7 @@ const upgradeCommandModule = ({ name, dir, isLatest, version, }) => ({
|
|
|
77
77
|
if (!isLatest) {
|
|
78
78
|
const result = await loadApplication({ name, dir, forceUpgrade: true });
|
|
79
79
|
if (version !== result.version) {
|
|
80
|
-
console.log(`\n✅ Upgraded ${name} to version ${version}`);
|
|
80
|
+
console.log(`\n✅ Upgraded ${name} to version ${result.version}`);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
}
|
package/dist/tracer/terminal.js
CHANGED
|
@@ -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 (
|
|
68
|
+
if (typeof method !== "function")
|
|
70
69
|
return undefined;
|
|
71
70
|
return async (config) => {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
}),
|
package/dist/utils/listr.d.ts
CHANGED
|
@@ -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;
|
package/dist/utils/listr.js
CHANGED
|
@@ -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) =>
|
|
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?.();
|
|
@@ -30,6 +30,8 @@ interface CreateConnectOptions {
|
|
|
30
30
|
retry?: number;
|
|
31
31
|
source?: string;
|
|
32
32
|
connectAction?: string;
|
|
33
|
+
appName?: string;
|
|
34
|
+
appLogo?: string;
|
|
33
35
|
wrapSpinner?: typeof baseWrapSpinner;
|
|
34
36
|
prettyUrl?: (url: string) => string;
|
|
35
37
|
closeOnSuccess?: boolean;
|
|
@@ -39,7 +41,7 @@ interface CreateConnectOptions {
|
|
|
39
41
|
fetchTimeout: number;
|
|
40
42
|
}) => Promise<FetchResult>;
|
|
41
43
|
}
|
|
42
|
-
export declare function createConnect({ connectUrl, openPage, fetchInterval, retry, source, connectAction, wrapSpinner, closeOnSuccess, intervalFetchConfig, }: CreateConnectOptions): Promise<FetchResult>;
|
|
44
|
+
export declare function createConnect({ connectUrl, openPage, fetchInterval, retry, source, connectAction, wrapSpinner, closeOnSuccess, intervalFetchConfig, appName, appLogo, }: CreateConnectOptions): Promise<FetchResult>;
|
|
43
45
|
export declare const formatModelName: (models: ReturnType<typeof availableModels>, model: string, inquirerPrompt: typeof inquirer.prompt) => Promise<string>;
|
|
44
46
|
export declare function connectToAIGNEHub(url: string): Promise<{
|
|
45
47
|
accessKey: string;
|
package/dist/utils/load-aigne.js
CHANGED
|
@@ -60,7 +60,7 @@ export const fetchConfigs = async ({ connectUrl, sessionId, fetchInterval, fetch
|
|
|
60
60
|
function baseWrapSpinner(_, waiting) {
|
|
61
61
|
return Promise.resolve(waiting());
|
|
62
62
|
}
|
|
63
|
-
export async function createConnect({ connectUrl, openPage, fetchInterval = 3 * 1000, retry = 1500, source = "Blocklet CLI", connectAction = "connect-cli", wrapSpinner = baseWrapSpinner, closeOnSuccess, intervalFetchConfig, }) {
|
|
63
|
+
export async function createConnect({ connectUrl, openPage, fetchInterval = 3 * 1000, retry = 1500, source = "Blocklet CLI", connectAction = "connect-cli", wrapSpinner = baseWrapSpinner, closeOnSuccess, intervalFetchConfig, appName = "AIGNE CLI", appLogo = "https://www.aigne.io/favicon.ico?imageFilter=resize&w=32", }) {
|
|
64
64
|
try {
|
|
65
65
|
const startSessionURL = joinURL(connectUrl, ACCESS_KEY_SESSION_API);
|
|
66
66
|
const { data: session } = await request({ url: startSessionURL, method: "POST" });
|
|
@@ -70,8 +70,8 @@ export async function createConnect({ connectUrl, openPage, fetchInterval = 3 *
|
|
|
70
70
|
source,
|
|
71
71
|
closeOnSuccess,
|
|
72
72
|
cli: true,
|
|
73
|
-
appName:
|
|
74
|
-
appLogo
|
|
73
|
+
appName: ` ${appName}`,
|
|
74
|
+
appLogo,
|
|
75
75
|
});
|
|
76
76
|
openPage?.(pageUrl);
|
|
77
77
|
return await wrapSpinner(`Waiting for connection: ${connectUrl}`, async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.4",
|
|
4
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"
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"yaml": "^2.8.0",
|
|
74
74
|
"yargs": "^18.0.0",
|
|
75
75
|
"zod": "^3.25.67",
|
|
76
|
-
"@aigne/agent-library": "^1.21.
|
|
77
|
-
"@aigne/
|
|
78
|
-
"@aigne/
|
|
79
|
-
"@aigne/openai": "^0.10.
|
|
80
|
-
"@aigne/
|
|
81
|
-
"@aigne/
|
|
76
|
+
"@aigne/agent-library": "^1.21.13",
|
|
77
|
+
"@aigne/aigne-hub": "^0.4.4",
|
|
78
|
+
"@aigne/agentic-memory": "^1.0.13",
|
|
79
|
+
"@aigne/openai": "^0.10.13",
|
|
80
|
+
"@aigne/core": "^1.45.0",
|
|
81
|
+
"@aigne/default-memory": "^1.0.13",
|
|
82
82
|
"@aigne/observability-api": "^0.9.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|