@aigne/cli 1.58.0-beta → 1.58.0-beta.2

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.58.0-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.58.0-beta.1...cli-v1.58.0-beta.2) (2025-12-08)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * The following workspace dependencies were updated
9
+ * dependencies
10
+ * @aigne/agent-library bumped to 1.23.0-beta.2
11
+ * @aigne/aigne-hub bumped to 0.10.15-beta.2
12
+
13
+ ## [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)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * 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))
19
+
20
+
21
+ ### Dependencies
22
+
23
+ * The following workspace dependencies were updated
24
+ * dependencies
25
+ * @aigne/afs-local-fs bumped to 1.3.0-beta.1
26
+ * @aigne/agent-library bumped to 1.23.0-beta.1
27
+ * @aigne/agentic-memory bumped to 1.1.5-beta.1
28
+ * @aigne/aigne-hub bumped to 0.10.15-beta.1
29
+ * @aigne/core bumped to 1.71.0-beta.1
30
+ * @aigne/default-memory bumped to 1.3.5-beta.1
31
+ * @aigne/openai bumped to 0.16.15-beta.1
32
+ * @aigne/secrets bumped to 0.1.5-beta.1
33
+ * devDependencies
34
+ * @aigne/test-utils bumped to 0.5.68-beta.1
35
+
3
36
  ## [1.58.0-beta](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.57.3...cli-v1.58.0-beta) (2025-12-07)
4
37
 
5
38
 
@@ -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
  }
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.58.0-beta",
3
+ "version": "1.58.0-beta.2",
4
4
  "description": "Your command center for agent development",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -90,16 +90,16 @@
90
90
  "zod": "^3.25.67",
91
91
  "zod-to-json-schema": "^3.24.6",
92
92
  "@aigne/afs": "^1.3.0-beta",
93
- "@aigne/agent-library": "^1.23.0-beta",
94
- "@aigne/agentic-memory": "^1.1.5-beta",
95
- "@aigne/afs-local-fs": "^1.3.0-beta",
93
+ "@aigne/afs-local-fs": "^1.3.0-beta.1",
94
+ "@aigne/agent-library": "^1.23.0-beta.2",
96
95
  "@aigne/afs-history": "^1.1.3-beta",
97
- "@aigne/core": "^1.71.0-beta",
98
- "@aigne/aigne-hub": "^0.10.15-beta",
99
- "@aigne/default-memory": "^1.3.5-beta",
96
+ "@aigne/agentic-memory": "^1.1.5-beta.1",
97
+ "@aigne/aigne-hub": "^0.10.15-beta.2",
98
+ "@aigne/core": "^1.71.0-beta.1",
99
+ "@aigne/default-memory": "^1.3.5-beta.1",
100
100
  "@aigne/observability-api": "^0.11.12",
101
- "@aigne/openai": "^0.16.15-beta",
102
- "@aigne/secrets": "^0.1.5-beta"
101
+ "@aigne/openai": "^0.16.15-beta.1",
102
+ "@aigne/secrets": "^0.1.5-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.68-beta"
119
+ "@aigne/test-utils": "^0.5.68-beta.1"
120
120
  },
121
121
  "scripts": {
122
122
  "lint": "tsc --noEmit",