@aigne/cli 1.18.1 → 1.19.0

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,34 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.19.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.18.1...cli-v1.19.0) (2025-07-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * rename command serve to serve-mcp ([#206](https://github.com/AIGNE-io/aigne-framework/issues/206)) ([f3dfc93](https://github.com/AIGNE-io/aigne-framework/commit/f3dfc932b4eeb8ff956bf2d4b1b71b36bd05056e))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fix: compatible with node 20.0 & polish example defintions ([#209](https://github.com/AIGNE-io/aigne-framework/issues/209)) ([9752b96](https://github.com/AIGNE-io/aigne-framework/commit/9752b96dc54a44c6f710f056fe9205c0f2b0a73e))
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * The following workspace dependencies were updated
19
+ * dependencies
20
+ * @aigne/agent-library bumped to 1.17.7
21
+ * @aigne/anthropic bumped to 0.5.2
22
+ * @aigne/bedrock bumped to 0.5.2
23
+ * @aigne/core bumped to 1.28.2
24
+ * @aigne/deepseek bumped to 0.4.2
25
+ * @aigne/gemini bumped to 0.4.2
26
+ * @aigne/observability-api bumped to 0.3.2
27
+ * @aigne/ollama bumped to 0.4.2
28
+ * @aigne/open-router bumped to 0.4.2
29
+ * @aigne/openai bumped to 0.6.2
30
+ * @aigne/xai bumped to 0.4.2
31
+
3
32
  ## [1.18.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.18.0...cli-v1.18.1) (2025-07-01)
4
33
 
5
34
 
package/README.md CHANGED
@@ -61,7 +61,7 @@ aigne run --path xxx
61
61
  aigne test --path xxx
62
62
 
63
63
  # Start MCP server
64
- aigne serve --path xxx --mcp
64
+ aigne serve-mcp --path xxx
65
65
 
66
66
  # Start observability server
67
67
  aigne observe [option]
@@ -121,19 +121,19 @@ aigne test
121
121
  aigne test path/to/agents
122
122
  ```
123
123
 
124
- ## Serve Command
124
+ ## Serve MCP Command
125
125
 
126
126
  Serve the agents in the specified directory as a MCP server.
127
127
 
128
128
  ```bash
129
129
  # Start MCP server on default port 3000
130
- aigne serve --mcp
130
+ aigne serve-mcp
131
131
 
132
132
  # Start MCP server on specified port
133
- aigne serve --mcp --port 3001
133
+ aigne serve-mcp --port 3001
134
134
 
135
135
  # Start MCP server for agents at specified path
136
- aigne serve --path path/to/agents --mcp
136
+ aigne serve-mcp --path path/to/agents
137
137
  ```
138
138
 
139
139
  ## Serve Command (observability)
package/README.zh.md CHANGED
@@ -61,7 +61,7 @@ aigne run --path xxx
61
61
  aigne test --path xxx
62
62
 
63
63
  # 启动 MCP 服务器
64
- aigne serve --path xxx --mcp
64
+ aigne serve-mcp --path xxx
65
65
 
66
66
  # 启动 observability 服务器
67
67
  aigne observe [option]
@@ -121,19 +121,19 @@ aigne test
121
121
  aigne test path/to/agents
122
122
  ```
123
123
 
124
- ## 服务命令 (serve)
124
+ ## 服务命令 (serve-mcp)
125
125
 
126
126
  将指定目录中的代理作为 MCP 服务器提供服务。
127
127
 
128
128
  ```bash
129
129
  # 在默认端口 3000 启动 MCP 服务器
130
- aigne serve --mcp
130
+ aigne serve-mcp
131
131
 
132
132
  # 在指定端口启动 MCP 服务器
133
- aigne serve --mcp --port 3001
133
+ aigne serve-mcp --port 3001
134
134
 
135
135
  # 为指定路径的代理启动 MCP 服务器
136
- aigne serve -- path path/to/agents --mcp
136
+ aigne serve-mcp --path path/to/agents
137
137
  ```
138
138
 
139
139
  ## 服务命令 (observability)
@@ -4,7 +4,7 @@ import { asciiLogo } from "../utils/ascii-logo.js";
4
4
  import { createCreateCommand } from "./create.js";
5
5
  import { createObservabilityCommand } from "./observe.js";
6
6
  import { createRunCommand } from "./run.js";
7
- import { createServeCommand } from "./serve.js";
7
+ import { createServeMCPCommand } from "./serve-mcp.js";
8
8
  import { createTestCommand } from "./test.js";
9
9
  export function createAIGNECommand() {
10
10
  console.log(asciiLogo);
@@ -15,7 +15,7 @@ export function createAIGNECommand() {
15
15
  .addCommand(createRunCommand())
16
16
  .addCommand(createTestCommand())
17
17
  .addCommand(createCreateCommand())
18
- .addCommand(createServeCommand())
18
+ .addCommand(createServeMCPCommand())
19
19
  .addCommand(createObservabilityCommand())
20
20
  .showHelpAfterError(true)
21
21
  .showSuggestionAfterError(true);
@@ -1,6 +1,7 @@
1
1
  import { tryOrThrow } from "@aigne/core/utils/type-utils.js";
2
2
  import { startObservabilityCLIServer } from "@aigne/observability-api/cli";
3
3
  import getObservabilityDbPath from "@aigne/observability-api/db-path";
4
+ import chalk from "chalk";
4
5
  import { Command } from "commander";
5
6
  import detectPort from "detect-port";
6
7
  const DEFAULT_PORT = () => tryOrThrow(() => {
@@ -20,7 +21,7 @@ export function createObservabilityCommand() {
20
21
  .action(async (options) => {
21
22
  const port = await detectPort(options.port || DEFAULT_PORT());
22
23
  const dbUrl = getObservabilityDbPath();
23
- console.log("Observability database path:", dbUrl);
24
+ console.log("Observability database path:", chalk.greenBright(dbUrl));
24
25
  await startObservabilityCLIServer({ port, dbUrl });
25
26
  })
26
27
  .showHelpAfterError(true)
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function createServeMCPCommand(): Command;
@@ -13,11 +13,10 @@ const DEFAULT_PORT = () => tryOrThrow(() => {
13
13
  throw new Error(`Invalid PORT: ${PORT}`);
14
14
  return port;
15
15
  }, (error) => new Error(`parse PORT error ${error.message}`));
16
- export function createServeCommand() {
17
- return new Command("serve")
18
- .description("Serve the agents in the specified directory as a MCP server")
16
+ export function createServeMCPCommand() {
17
+ return new Command("serve-mcp")
18
+ .description("Serve the agents in the specified directory as a MCP server (streamable http)")
19
19
  .option("--url, --path <path_or_url>", "Path to the agents directory or URL to aigne project", ".")
20
- .option("--mcp", "Serve the agents as a MCP server")
21
20
  .option("--host <host>", "Host to run the MCP server on, use 0.0.0.0 to publicly expose the server", "localhost")
22
21
  .option("--port <port>", "Port to run the MCP server on", (s) => Number.parseInt(s))
23
22
  .option("--pathname <pathname>", "Pathname to the service", "/mcp")
@@ -29,15 +28,12 @@ export function createServeCommand() {
29
28
  models: availableModels(),
30
29
  memories: availableMemories,
31
30
  });
32
- if (options.mcp)
33
- await serveMCPServer({
34
- aigne,
35
- host: options.host,
36
- port,
37
- pathname: options.pathname,
38
- });
39
- else
40
- throw new Error("Default server is not supported yet. Please use --mcp option");
31
+ await serveMCPServer({
32
+ aigne,
33
+ host: options.host,
34
+ port,
35
+ pathname: options.pathname,
36
+ });
41
37
  console.log(`MCP server is running on http://${options.host}:${port}${options.pathname}`);
42
38
  })
43
39
  .showHelpAfterError(true)
@@ -1,5 +1,5 @@
1
1
  import { DefaultMemory } from "@aigne/agent-library/default-memory/index.js";
2
2
  import type { LoadableModel } from "@aigne/core/loader/index.js";
3
- export declare const AIGNE_CLI_VERSION: string;
3
+ export declare const AIGNE_CLI_VERSION: any;
4
4
  export declare function availableModels(): LoadableModel[];
5
5
  export declare const availableMemories: (typeof DefaultMemory)[];
package/dist/constants.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { createRequire } from "node:module";
1
2
  import { DefaultMemory } from "@aigne/agent-library/default-memory/index.js";
2
3
  import { AnthropicChatModel } from "@aigne/anthropic";
3
4
  import { BedrockChatModel } from "@aigne/bedrock";
@@ -9,8 +10,8 @@ import { OpenAIChatModel } from "@aigne/openai";
9
10
  import { XAIChatModel } from "@aigne/xai";
10
11
  import { NodeHttpHandler, streamCollector } from "@smithy/node-http-handler";
11
12
  import { HttpsProxyAgent } from "https-proxy-agent";
12
- import pkg from "../package.json" with { type: "json" };
13
- export const AIGNE_CLI_VERSION = pkg.version;
13
+ const require = createRequire(import.meta.url);
14
+ export const AIGNE_CLI_VERSION = require("../package.json").version;
14
15
  export function availableModels() {
15
16
  const proxy = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy"]
16
17
  .map((i) => process.env[i])
@@ -1,6 +1,6 @@
1
1
  import chalk from "chalk";
2
2
  import gradient from "gradient-string";
3
- import pkg from "../../package.json" with { type: "json" };
3
+ import { AIGNE_CLI_VERSION } from "../constants.js";
4
4
  const modernGradient = gradient(["#4facfe", "#7367f0", "#f86aad"]);
5
5
  const logo = `
6
6
  _ ___ ____ _ _ _____
@@ -9,7 +9,7 @@ const logo = `
9
9
  / ___ \\ | | |_| | |\\ | |___
10
10
  /_/ \\_\\___\\____|_| \\_|_____|
11
11
  `;
12
- const frameworkInfo = `v${pkg.version}`;
12
+ const frameworkInfo = `v${AIGNE_CLI_VERSION}`;
13
13
  const logoLines = logo.split("\n");
14
14
  const maxLength = Math.max(...logoLines.filter((line) => line.trim()).map((line) => line.length));
15
15
  const versionText = frameworkInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.18.1",
3
+ "version": "1.19.0",
4
4
  "description": "cli for AIGNE framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -55,17 +55,17 @@
55
55
  "wrap-ansi": "^9.0.0",
56
56
  "yaml": "^2.7.1",
57
57
  "zod": "^3.24.4",
58
- "@aigne/agent-library": "^1.17.6",
59
- "@aigne/anthropic": "^0.5.1",
60
- "@aigne/bedrock": "^0.5.1",
61
- "@aigne/core": "^1.28.1",
62
- "@aigne/gemini": "^0.4.1",
63
- "@aigne/deepseek": "^0.4.1",
64
- "@aigne/ollama": "^0.4.1",
65
- "@aigne/observability-api": "^0.3.1",
66
- "@aigne/open-router": "^0.4.1",
67
- "@aigne/openai": "^0.6.1",
68
- "@aigne/xai": "^0.4.1"
58
+ "@aigne/anthropic": "^0.5.2",
59
+ "@aigne/bedrock": "^0.5.2",
60
+ "@aigne/core": "^1.28.2",
61
+ "@aigne/deepseek": "^0.4.2",
62
+ "@aigne/agent-library": "^1.17.7",
63
+ "@aigne/gemini": "^0.4.2",
64
+ "@aigne/observability-api": "^0.3.2",
65
+ "@aigne/ollama": "^0.4.2",
66
+ "@aigne/open-router": "^0.4.2",
67
+ "@aigne/openai": "^0.6.2",
68
+ "@aigne/xai": "^0.4.2"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/archiver": "^6.0.3",
@@ -1,2 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function createServeCommand(): Command;