@aigne/cli 1.19.0 → 1.20.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 +23 -0
- package/dist/cli.js +14 -2
- package/dist/commands/aigne.d.ts +3 -1
- package/dist/commands/aigne.js +4 -4
- package/dist/commands/run.d.ts +3 -1
- package/dist/commands/run.js +2 -2
- package/dist/commands/serve-mcp.d.ts +3 -1
- package/dist/commands/serve-mcp.js +2 -2
- package/dist/commands/test.d.ts +3 -1
- package/dist/commands/test.js +2 -2
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.20.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.19.0...cli-v1.20.0) (2025-07-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **cli:** support executing aigne.yaml via shebang (#!/usr/bin/env aigne) ([#211](https://github.com/AIGNE-io/aigne-framework/issues/211)) ([2a82c27](https://github.com/AIGNE-io/aigne-framework/commit/2a82c2754b5eab5c3d6e45a5cbe7f0c76d927967))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/agent-library bumped to 1.17.8
|
|
16
|
+
* @aigne/anthropic bumped to 0.5.3
|
|
17
|
+
* @aigne/bedrock bumped to 0.5.3
|
|
18
|
+
* @aigne/core bumped to 1.29.0
|
|
19
|
+
* @aigne/deepseek bumped to 0.4.3
|
|
20
|
+
* @aigne/gemini bumped to 0.4.3
|
|
21
|
+
* @aigne/ollama bumped to 0.4.3
|
|
22
|
+
* @aigne/open-router bumped to 0.4.3
|
|
23
|
+
* @aigne/openai bumped to 0.6.3
|
|
24
|
+
* @aigne/xai bumped to 0.4.3
|
|
25
|
+
|
|
3
26
|
## [1.19.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.18.1...cli-v1.19.0) (2025-07-01)
|
|
4
27
|
|
|
5
28
|
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
2
3
|
import { config } from "dotenv-flow";
|
|
3
4
|
import PrettyError from "pretty-error";
|
|
4
5
|
import { createAIGNECommand } from "./commands/aigne.js";
|
|
5
6
|
config({ silent: true });
|
|
6
|
-
|
|
7
|
-
.
|
|
7
|
+
function getAIGNEFilePath() {
|
|
8
|
+
let file = process.argv[2];
|
|
9
|
+
if (file) {
|
|
10
|
+
if (!existsSync(file))
|
|
11
|
+
return;
|
|
12
|
+
file = realpathSync(file);
|
|
13
|
+
if (statSync(file).isFile())
|
|
14
|
+
return file;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const aigneFilePath = getAIGNEFilePath();
|
|
18
|
+
createAIGNECommand({ aigneFilePath })
|
|
19
|
+
.parseAsync(["", "", ...process.argv.slice(aigneFilePath ? 3 : 2)])
|
|
8
20
|
.catch((error) => {
|
|
9
21
|
console.error(new PrettyError().render(error));
|
|
10
22
|
process.exit(1);
|
package/dist/commands/aigne.d.ts
CHANGED
package/dist/commands/aigne.js
CHANGED
|
@@ -6,16 +6,16 @@ import { createObservabilityCommand } from "./observe.js";
|
|
|
6
6
|
import { createRunCommand } from "./run.js";
|
|
7
7
|
import { createServeMCPCommand } from "./serve-mcp.js";
|
|
8
8
|
import { createTestCommand } from "./test.js";
|
|
9
|
-
export function createAIGNECommand() {
|
|
9
|
+
export function createAIGNECommand(options) {
|
|
10
10
|
console.log(asciiLogo);
|
|
11
11
|
return new Command()
|
|
12
12
|
.name("aigne")
|
|
13
13
|
.description("CLI for AIGNE framework")
|
|
14
14
|
.version(AIGNE_CLI_VERSION)
|
|
15
|
-
.addCommand(createRunCommand())
|
|
16
|
-
.addCommand(createTestCommand())
|
|
15
|
+
.addCommand(createRunCommand(options))
|
|
16
|
+
.addCommand(createTestCommand(options))
|
|
17
17
|
.addCommand(createCreateCommand())
|
|
18
|
-
.addCommand(createServeMCPCommand())
|
|
18
|
+
.addCommand(createServeMCPCommand(options))
|
|
19
19
|
.addCommand(createObservabilityCommand())
|
|
20
20
|
.showHelpAfterError(true)
|
|
21
21
|
.showSuggestionAfterError(true);
|
package/dist/commands/run.d.ts
CHANGED
package/dist/commands/run.js
CHANGED
|
@@ -12,14 +12,14 @@ import { availableMemories, availableModels } from "../constants.js";
|
|
|
12
12
|
import { isV1Package, toAIGNEPackage } from "../utils/agent-v1.js";
|
|
13
13
|
import { downloadAndExtract } from "../utils/download.js";
|
|
14
14
|
import { createRunAIGNECommand, parseAgentInputByCommander, parseModelOption, runAgentWithAIGNE, } from "../utils/run-with-aigne.js";
|
|
15
|
-
export function createRunCommand() {
|
|
15
|
+
export function createRunCommand({ aigneFilePath } = {}) {
|
|
16
16
|
return createRunAIGNECommand()
|
|
17
17
|
.description("Run AIGNE from the specified agent")
|
|
18
18
|
.option("--url, --path <path_or_url>", "Path to the agents directory or URL to aigne project", ".")
|
|
19
19
|
.option("--entry-agent <entry-agent>", "Name of the agent to run (defaults to the first agent found)")
|
|
20
20
|
.option("--cache-dir <dir>", "Directory to download the package to (defaults to the ~/.aigne/xxx)")
|
|
21
21
|
.action(async (options) => {
|
|
22
|
-
const
|
|
22
|
+
const path = aigneFilePath || options.path;
|
|
23
23
|
if (options.logLevel)
|
|
24
24
|
logger.level = options.logLevel;
|
|
25
25
|
const { cacheDir, dir } = prepareDirs(path, options);
|
|
@@ -13,7 +13,7 @@ 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 createServeMCPCommand() {
|
|
16
|
+
export function createServeMCPCommand({ aigneFilePath } = {}) {
|
|
17
17
|
return new Command("serve-mcp")
|
|
18
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", ".")
|
|
@@ -21,7 +21,7 @@ export function createServeMCPCommand() {
|
|
|
21
21
|
.option("--port <port>", "Port to run the MCP server on", (s) => Number.parseInt(s))
|
|
22
22
|
.option("--pathname <pathname>", "Pathname to the service", "/mcp")
|
|
23
23
|
.action(async (options) => {
|
|
24
|
-
const
|
|
24
|
+
const path = aigneFilePath || options.path;
|
|
25
25
|
const absolutePath = isAbsolute(path) ? path : resolve(process.cwd(), path);
|
|
26
26
|
const port = options.port || DEFAULT_PORT();
|
|
27
27
|
const aigne = await AIGNE.load(absolutePath, {
|
package/dist/commands/test.d.ts
CHANGED
package/dist/commands/test.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { isAbsolute, resolve } from "node:path";
|
|
3
3
|
import { Command } from "commander";
|
|
4
|
-
export function createTestCommand() {
|
|
4
|
+
export function createTestCommand({ aigneFilePath } = {}) {
|
|
5
5
|
return new Command("test")
|
|
6
6
|
.description("Run tests in the specified agents directory")
|
|
7
7
|
.option("--url, --path <path_or_url>", "Path to the agents directory or URL to aigne project", ".")
|
|
8
8
|
.action(async (options) => {
|
|
9
|
-
const
|
|
9
|
+
const path = aigneFilePath || options.path;
|
|
10
10
|
const absolutePath = isAbsolute(path) ? path : resolve(process.cwd(), path);
|
|
11
11
|
spawnSync("node", ["--test"], { cwd: absolutePath, stdio: "inherit" });
|
|
12
12
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.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/
|
|
59
|
-
"@aigne/
|
|
60
|
-
"@aigne/
|
|
61
|
-
"@aigne/deepseek": "^0.4.
|
|
62
|
-
"@aigne/
|
|
63
|
-
"@aigne/gemini": "^0.4.
|
|
58
|
+
"@aigne/agent-library": "^1.17.8",
|
|
59
|
+
"@aigne/anthropic": "^0.5.3",
|
|
60
|
+
"@aigne/bedrock": "^0.5.3",
|
|
61
|
+
"@aigne/deepseek": "^0.4.3",
|
|
62
|
+
"@aigne/core": "^1.29.0",
|
|
63
|
+
"@aigne/gemini": "^0.4.3",
|
|
64
64
|
"@aigne/observability-api": "^0.3.2",
|
|
65
|
-
"@aigne/ollama": "^0.4.
|
|
66
|
-
"@aigne/
|
|
67
|
-
"@aigne/openai": "^0.6.
|
|
68
|
-
"@aigne/
|
|
65
|
+
"@aigne/ollama": "^0.4.3",
|
|
66
|
+
"@aigne/xai": "^0.4.3",
|
|
67
|
+
"@aigne/openai": "^0.6.3",
|
|
68
|
+
"@aigne/open-router": "^0.4.3"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/archiver": "^6.0.3",
|