@aigne/cli 1.57.3 → 1.58.0-beta.1

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,53 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.58.0-beta.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.58.0-beta...cli-v1.58.0-beta.1) (2025-12-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * correct run example & doc improvements ([#707](https://github.com/AIGNE-io/aigne-framework/issues/707)) ([f98fc5d](https://github.com/AIGNE-io/aigne-framework/commit/f98fc5df28fd6ce6134128c2f0e5395c1554b740))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/afs-local-fs bumped to 1.3.0-beta.1
16
+ * @aigne/agent-library bumped to 1.23.0-beta.1
17
+ * @aigne/agentic-memory bumped to 1.1.5-beta.1
18
+ * @aigne/aigne-hub bumped to 0.10.15-beta.1
19
+ * @aigne/core bumped to 1.71.0-beta.1
20
+ * @aigne/default-memory bumped to 1.3.5-beta.1
21
+ * @aigne/openai bumped to 0.16.15-beta.1
22
+ * @aigne/secrets bumped to 0.1.5-beta.1
23
+ * devDependencies
24
+ * @aigne/test-utils bumped to 0.5.68-beta.1
25
+
26
+ ## [1.58.0-beta](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.57.3...cli-v1.58.0-beta) (2025-12-07)
27
+
28
+
29
+ ### Features
30
+
31
+ * support define agent by third library & orchestrator agent refactor ([#799](https://github.com/AIGNE-io/aigne-framework/issues/799)) ([7264b11](https://github.com/AIGNE-io/aigne-framework/commit/7264b11ab6eed787e928367f09aa08d254968d40))
32
+
33
+
34
+ ### Dependencies
35
+
36
+ * The following workspace dependencies were updated
37
+ * dependencies
38
+ * @aigne/afs bumped to 1.3.0-beta
39
+ * @aigne/afs-history bumped to 1.1.3-beta
40
+ * @aigne/afs-local-fs bumped to 1.3.0-beta
41
+ * @aigne/agent-library bumped to 1.23.0-beta
42
+ * @aigne/agentic-memory bumped to 1.1.5-beta
43
+ * @aigne/aigne-hub bumped to 0.10.15-beta
44
+ * @aigne/core bumped to 1.71.0-beta
45
+ * @aigne/default-memory bumped to 1.3.5-beta
46
+ * @aigne/openai bumped to 0.16.15-beta
47
+ * @aigne/secrets bumped to 0.1.5-beta
48
+ * devDependencies
49
+ * @aigne/test-utils bumped to 0.5.68-beta
50
+
3
51
  ## [1.57.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.57.3-beta...cli-v1.57.3) (2025-12-06)
4
52
 
5
53
 
@@ -11,10 +11,11 @@ import { createRunCommand } from "./run.js";
11
11
  import { createServeMCPCommand } from "./serve-mcp.js";
12
12
  import { createTestCommand } from "./test.js";
13
13
  export function createAIGNECommand(options) {
14
- return yargs()
14
+ return (yargs()
15
15
  .scriptName("aigne")
16
16
  .usage(`${asciiLogo}\n$0 <command> [options]`)
17
17
  .version(AIGNE_CLI_VERSION)
18
+ // default command: when user runs `aigne` without subcommand, behave like `aigne run`
18
19
  .command(createRunCommand(options))
19
20
  .command(createEvalCommand(options))
20
21
  .command(createTestCommand(options))
@@ -25,8 +26,8 @@ export function createAIGNECommand(options) {
25
26
  .command(createHubCommand())
26
27
  .command(createDeployCommands())
27
28
  .demandCommand()
29
+ .version(false)
28
30
  .alias("help", "h")
29
- .alias("version", "v")
30
31
  .wrap(null)
31
- .strict();
32
+ .strict());
32
33
  }
@@ -278,8 +278,8 @@ async function deleteHub(url) {
278
278
  if (isDefaultHub) {
279
279
  await secretStore.deleteDefault();
280
280
  const remainingHubs = await getHubs();
281
- if (remainingHubs.length > 0) {
282
- const nextHub = remainingHubs[0];
281
+ const nextHub = remainingHubs[0];
282
+ if (nextHub) {
283
283
  await secretStore.setDefault(nextHub?.apiUrl);
284
284
  console.log(chalk.green(`✓ Hub ${getUrlOrigin(url)} removed, switched to ${getUrlOrigin(nextHub?.apiUrl)}`));
285
285
  return;
@@ -2,6 +2,7 @@ import type { CommandModule } from "yargs";
2
2
  export declare function createRunCommand({ aigneFilePath, }?: {
3
3
  aigneFilePath?: string;
4
4
  }): CommandModule<unknown, {
5
+ version?: boolean;
5
6
  path?: string;
6
7
  entryAgent?: string;
7
8
  }>;
@@ -2,23 +2,27 @@ import { cp, mkdir, rm } from "node:fs/promises";
2
2
  import { homedir } from "node:os";
3
3
  import { isAbsolute, join, resolve } from "node:path";
4
4
  import { exists } from "@aigne/agent-library/utils/fs.js";
5
+ import { findAIGNEFile } from "@aigne/core/loader/index.js";
5
6
  import { logger } from "@aigne/core/utils/logger.js";
6
7
  import { flat, isNonNullable, pick } from "@aigne/core/utils/type-utils.js";
7
8
  import { Listr, PRESET_TIMER } from "@aigne/listr2";
8
9
  import { config } from "dotenv-flow";
9
10
  import yargs from "yargs";
10
- import { CHAT_MODEL_OPTIONS } from "../constants.js";
11
+ import { AIGNE_CLI_VERSION, CHAT_MODEL_OPTIONS } from "../constants.js";
11
12
  import { isV1Package, toAIGNEPackage } from "../utils/agent-v1.js";
12
13
  import { downloadAndExtract } from "../utils/download.js";
13
14
  import { loadAIGNE } from "../utils/load-aigne.js";
14
15
  import { isUrl } from "../utils/url.js";
15
16
  import { withRunAgentCommonOptions } from "../utils/yargs.js";
16
17
  import { agentCommandModule, cliAgentCommandModule } from "./app/agent.js";
18
+ let yargsInstance = null;
17
19
  export function createRunCommand({ aigneFilePath, } = {}) {
18
20
  return {
19
- command: "run [path] [entry-agent]",
21
+ // $0 must place after 'run' to make positional args work correctly
22
+ command: ["run [path] [entry-agent]", "$0"],
20
23
  describe: "Run AIGNE for the specified path",
21
24
  builder: async (yargs) => {
25
+ yargsInstance = yargs;
22
26
  return yargs
23
27
  .positional("path", {
24
28
  type: "string",
@@ -28,22 +32,44 @@ export function createRunCommand({ aigneFilePath, } = {}) {
28
32
  .positional("entry-agent", {
29
33
  type: "string",
30
34
  describe: "Name of the agent to run (defaults to the entry agent if not specified)",
35
+ })
36
+ .option("version", {
37
+ type: "boolean",
38
+ alias: "v",
39
+ describe: "Show version number",
31
40
  })
32
41
  .help(false)
33
42
  .version(false)
34
43
  .strict(false);
35
44
  },
36
45
  handler: async (options) => {
46
+ if (options.version) {
47
+ console.log(AIGNE_CLI_VERSION);
48
+ process.exit(0);
49
+ return;
50
+ }
37
51
  if (!options.entryAgent && options.path) {
38
52
  if (!(await exists(options.path)) && !isUrl(options.path)) {
39
53
  options.entryAgent = options.path;
40
54
  options.path = undefined;
41
55
  }
42
56
  }
57
+ const path = aigneFilePath || options.path || ".";
58
+ if (!(await findAIGNEFile(path).catch((error) => {
59
+ if (options._[0] !== "run") {
60
+ yargsInstance?.showHelp();
61
+ }
62
+ else {
63
+ throw error;
64
+ }
65
+ return false;
66
+ }))) {
67
+ return;
68
+ }
43
69
  // Parse model options for loading application
44
70
  const opts = withRunAgentCommonOptions(yargs(process.argv).help(false).version(false).strict(false)).parseSync();
45
71
  logger.level = opts.logLevel;
46
- const { aigne } = await loadApplication(aigneFilePath || options.path || ".", {
72
+ const { aigne } = await loadApplication(path, {
47
73
  modelOptions: pick(opts, CHAT_MODEL_OPTIONS),
48
74
  imageModelOptions: { model: opts.imageModel },
49
75
  });
@@ -175,7 +175,7 @@ export async function loadAIGNEHubCredential(options) {
175
175
  aigneHubUrl = customUrl;
176
176
  }
177
177
  else if (subscribe === "manual") {
178
- console.log("You chose to configure your own LLM API Keys. Exiting...");
178
+ console.log("You chose to configure your own LLM API Keys. Please follow the instructions in the documentation: https://www.arcblock.io/docs/aigne-framework/models-configuration-9dc03e");
179
179
  process.exit(0);
180
180
  }
181
181
  }
@@ -1,3 +1,4 @@
1
+ import { createRequire } from "node:module";
1
2
  import { AIGNE, } from "@aigne/core";
2
3
  import { isNil, omitBy } from "@aigne/core/utils/type-utils.js";
3
4
  import boxen from "boxen";
@@ -25,6 +26,12 @@ export async function loadAIGNE({ path, modelOptions, imageModelOptions, skipMod
25
26
  let aigne;
26
27
  if (path) {
27
28
  aigne = await AIGNE.load(path, {
29
+ require: async (modulePath, options) => {
30
+ if (!options.parent || modulePath.startsWith("@aigne/"))
31
+ return import(modulePath);
32
+ const require = createRequire(options.parent);
33
+ return require(modulePath);
34
+ },
28
35
  memories: availableMemories,
29
36
  model: (options) => {
30
37
  if (skipModelLoading)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.57.3",
3
+ "version": "1.58.0-beta.1",
4
4
  "description": "Your command center for agent development",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -89,17 +89,17 @@
89
89
  "yoctocolors-cjs": "^2.1.3",
90
90
  "zod": "^3.25.67",
91
91
  "zod-to-json-schema": "^3.24.6",
92
- "@aigne/afs": "^1.2.3",
93
- "@aigne/afs-history": "^1.1.2",
94
- "@aigne/agent-library": "^1.22.4",
95
- "@aigne/agentic-memory": "^1.1.4",
96
- "@aigne/afs-local-fs": "^1.2.4",
97
- "@aigne/core": "^1.70.1",
98
- "@aigne/aigne-hub": "^0.10.14",
92
+ "@aigne/afs": "^1.3.0-beta",
93
+ "@aigne/afs-history": "^1.1.3-beta",
94
+ "@aigne/afs-local-fs": "^1.3.0-beta.1",
95
+ "@aigne/agent-library": "^1.23.0-beta.1",
96
+ "@aigne/agentic-memory": "^1.1.5-beta.1",
97
+ "@aigne/aigne-hub": "^0.10.15-beta.1",
98
+ "@aigne/core": "^1.71.0-beta.1",
99
99
  "@aigne/observability-api": "^0.11.12",
100
- "@aigne/openai": "^0.16.14",
101
- "@aigne/default-memory": "^1.3.4",
102
- "@aigne/secrets": "^0.1.4"
100
+ "@aigne/default-memory": "^1.3.5-beta.1",
101
+ "@aigne/secrets": "^0.1.5-beta.1",
102
+ "@aigne/openai": "^0.16.15-beta.1"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@inquirer/testing": "^2.1.50",
@@ -116,7 +116,7 @@
116
116
  "rimraf": "^6.0.1",
117
117
  "typescript": "^5.9.2",
118
118
  "ufo": "^1.6.1",
119
- "@aigne/test-utils": "^0.5.67"
119
+ "@aigne/test-utils": "^0.5.68-beta.1"
120
120
  },
121
121
  "scripts": {
122
122
  "lint": "tsc --noEmit",