@aigne/cli 1.59.0-beta.11 → 1.59.0-beta.12
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 +29 -0
- package/dist/commands/aigne.js +2 -0
- package/dist/commands/app/agent.js +1 -1
- package/dist/commands/run-skill.d.ts +6 -0
- package/dist/commands/run-skill.js +84 -0
- package/dist/commands/run.d.ts +1 -1
- package/dist/commands/run.js +4 -3
- package/dist/utils/run-with-aigne.js +2 -2
- package/dist/utils/yargs.d.ts +2 -2
- package/dist/utils/yargs.js +3 -2
- package/package.json +10 -10
- package/templates/default/README.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.59.0-beta.12](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.11...cli-v1.59.0-beta.12) (2026-01-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **cli:** add run-skill command ([#868](https://github.com/AIGNE-io/aigne-framework/issues/868)) ([f62ffe2](https://github.com/AIGNE-io/aigne-framework/commit/f62ffe21acc49ec1a68349fbb35a13d0fadd239a))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **cli:** add chat aliases for interactive option ([#867](https://github.com/AIGNE-io/aigne-framework/issues/867)) ([91f27fd](https://github.com/AIGNE-io/aigne-framework/commit/91f27fd874b8c4b2ded2d7cd46e2821f70943c69))
|
|
14
|
+
* **cli:** rename cmd option --chat to --interactive ([#865](https://github.com/AIGNE-io/aigne-framework/issues/865)) ([480eca4](https://github.com/AIGNE-io/aigne-framework/commit/480eca49a7381a330024f1f0026bbc5f89b57bbb))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Dependencies
|
|
18
|
+
|
|
19
|
+
* The following workspace dependencies were updated
|
|
20
|
+
* dependencies
|
|
21
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.9
|
|
22
|
+
* @aigne/agent-library bumped to 1.24.0-beta.11
|
|
23
|
+
* @aigne/agentic-memory bumped to 1.1.6-beta.9
|
|
24
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.13
|
|
25
|
+
* @aigne/core bumped to 1.72.0-beta.9
|
|
26
|
+
* @aigne/default-memory bumped to 1.4.0-beta.8
|
|
27
|
+
* @aigne/openai bumped to 0.16.16-beta.9
|
|
28
|
+
* @aigne/secrets bumped to 0.1.6-beta.9
|
|
29
|
+
* devDependencies
|
|
30
|
+
* @aigne/test-utils bumped to 0.5.69-beta.9
|
|
31
|
+
|
|
3
32
|
## [1.59.0-beta.11](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.10...cli-v1.59.0-beta.11) (2025-12-31)
|
|
4
33
|
|
|
5
34
|
|
package/dist/commands/aigne.js
CHANGED
|
@@ -8,6 +8,7 @@ import { createEvalCommand } from "./eval.js";
|
|
|
8
8
|
import { createHubCommand } from "./hub.js";
|
|
9
9
|
import { createObservabilityCommand } from "./observe.js";
|
|
10
10
|
import { createRunCommand } from "./run.js";
|
|
11
|
+
import { createRunSkillCommand } from "./run-skill.js";
|
|
11
12
|
import { createServeMCPCommand } from "./serve-mcp.js";
|
|
12
13
|
import { createTestCommand } from "./test.js";
|
|
13
14
|
export function createAIGNECommand(options) {
|
|
@@ -17,6 +18,7 @@ export function createAIGNECommand(options) {
|
|
|
17
18
|
.version(AIGNE_CLI_VERSION)
|
|
18
19
|
// default command: when user runs `aigne` without subcommand, behave like `aigne run`
|
|
19
20
|
.command(createRunCommand(options))
|
|
21
|
+
.command(createRunSkillCommand())
|
|
20
22
|
.command(createEvalCommand(options))
|
|
21
23
|
.command(createTestCommand(options))
|
|
22
24
|
.command(createCreateCommand())
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
2
|
+
import { AFSHistory } from "@aigne/afs-history";
|
|
3
|
+
import { LocalFS } from "@aigne/afs-local-fs";
|
|
4
|
+
import AgentSkillManager from "@aigne/agent-library/agent-skill-manager";
|
|
5
|
+
import BashAgent from "@aigne/agent-library/bash";
|
|
6
|
+
import { AIGNE, FunctionAgent } from "@aigne/core";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { loadChatModel } from "../utils/aigne-hub/model.js";
|
|
9
|
+
import { withAgentInputSchema } from "../utils/yargs.js";
|
|
10
|
+
import { invokeAgent } from "./app/agent.js";
|
|
11
|
+
export function createRunSkillCommand() {
|
|
12
|
+
return {
|
|
13
|
+
command: ["run-skill"],
|
|
14
|
+
describe: "Run Agent Skill for the specified path",
|
|
15
|
+
builder: async (yargs) => {
|
|
16
|
+
return withAgentInputSchema(yargs
|
|
17
|
+
.option("skill", {
|
|
18
|
+
array: true,
|
|
19
|
+
type: "string",
|
|
20
|
+
describe: "Path to the Agent Skill directory",
|
|
21
|
+
})
|
|
22
|
+
.option("interactive", {
|
|
23
|
+
describe: "Run in interactive chat mode",
|
|
24
|
+
type: "boolean",
|
|
25
|
+
default: false,
|
|
26
|
+
alias: ["chat"],
|
|
27
|
+
})
|
|
28
|
+
.demandOption("skill"), {
|
|
29
|
+
inputSchema: z.object({
|
|
30
|
+
message: z.string(),
|
|
31
|
+
}),
|
|
32
|
+
optionalInputs: ["message"],
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
handler: async (options) => {
|
|
36
|
+
if (!Array.isArray(options.skill) || options.skill.length === 0) {
|
|
37
|
+
throw new Error("At least one skill path must be provided.");
|
|
38
|
+
}
|
|
39
|
+
const model = await loadChatModel({
|
|
40
|
+
model: options.model || "aignehub/anthropic/claude-sonnet-4-5",
|
|
41
|
+
});
|
|
42
|
+
const aigne = new AIGNE({ model });
|
|
43
|
+
const agent = new AgentSkillManager({
|
|
44
|
+
inputKey: "message",
|
|
45
|
+
taskRenderMode: "collapse",
|
|
46
|
+
skills: [
|
|
47
|
+
new BashAgent({
|
|
48
|
+
sandbox: false,
|
|
49
|
+
permissions: {
|
|
50
|
+
defaultMode: "ask",
|
|
51
|
+
guard: FunctionAgent.from(async (input, options) => {
|
|
52
|
+
const confirm = options.prompts?.confirm;
|
|
53
|
+
if (!confirm)
|
|
54
|
+
throw new Error("No confirm prompt available for permission guard.");
|
|
55
|
+
const approved = await confirm({ message: `Run command ${input.script}?` });
|
|
56
|
+
return {
|
|
57
|
+
approved,
|
|
58
|
+
};
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
],
|
|
63
|
+
afs: {
|
|
64
|
+
modules: [
|
|
65
|
+
new AFSHistory({}),
|
|
66
|
+
...options.skill.map((path) => new LocalFS({
|
|
67
|
+
name: basename(path),
|
|
68
|
+
localPath: path,
|
|
69
|
+
description: `Agent Skill from local path ${path}`,
|
|
70
|
+
agentSkills: true,
|
|
71
|
+
})),
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
await invokeAgent({
|
|
76
|
+
aigne,
|
|
77
|
+
agent,
|
|
78
|
+
input: {
|
|
79
|
+
...options,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
package/dist/commands/run.d.ts
CHANGED
package/dist/commands/run.js
CHANGED
|
@@ -38,10 +38,11 @@ export function createRunCommand({ aigneFilePath, } = {}) {
|
|
|
38
38
|
alias: "v",
|
|
39
39
|
describe: "Show version number",
|
|
40
40
|
})
|
|
41
|
-
.option("
|
|
42
|
-
describe: "Run
|
|
41
|
+
.option("interactive", {
|
|
42
|
+
describe: "Run in interactive chat mode",
|
|
43
43
|
type: "boolean",
|
|
44
44
|
default: false,
|
|
45
|
+
alias: ["chat"],
|
|
45
46
|
})
|
|
46
47
|
.help(false)
|
|
47
48
|
.version(false)
|
|
@@ -89,7 +90,7 @@ export function createRunCommand({ aigneFilePath, } = {}) {
|
|
|
89
90
|
// Allow user to run all of agents in the AIGNE instances
|
|
90
91
|
const allAgents = flat(aigne.agents, aigne.skills, aigne.cli.chat, aigne.mcpServer.agents);
|
|
91
92
|
for (const agent of allAgents) {
|
|
92
|
-
subYargs.command(agentCommandModule({ aigne, agent, chat: options.
|
|
93
|
+
subYargs.command(agentCommandModule({ aigne, agent, chat: options.interactive }));
|
|
93
94
|
}
|
|
94
95
|
for (const cliAgent of aigne.cli.agents ?? []) {
|
|
95
96
|
subYargs.command(cliAgentCommandModule({
|
|
@@ -102,9 +102,9 @@ export async function runAgentWithAIGNE(aigne, agent, { sessionId, outputKey, ou
|
|
|
102
102
|
}
|
|
103
103
|
await writeFile(outputPath, "", "utf8");
|
|
104
104
|
}
|
|
105
|
-
if (options.
|
|
105
|
+
if (options.interactive) {
|
|
106
106
|
if (!isatty(process.stdout.fd)) {
|
|
107
|
-
throw new Error("--
|
|
107
|
+
throw new Error("--interactive mode requires a TTY terminal");
|
|
108
108
|
}
|
|
109
109
|
const userAgent = agent instanceof UserAgent ? agent : aigne.invoke(agent);
|
|
110
110
|
await runChatLoopInTerminal(userAgent, {
|
package/dist/utils/yargs.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Argv } from "yargs";
|
|
|
4
4
|
import { ZodType } from "zod";
|
|
5
5
|
export type InferArgv<T> = T extends Argv<infer U> ? U : never;
|
|
6
6
|
export declare const withRunAgentCommonOptions: (yargs: Argv) => Argv<{
|
|
7
|
-
|
|
7
|
+
interactive: boolean;
|
|
8
8
|
} & {
|
|
9
9
|
"session-id": string | undefined;
|
|
10
10
|
} & {
|
|
@@ -57,7 +57,7 @@ export declare function inferZodType(type: ZodType, opts?: {
|
|
|
57
57
|
export declare function withAgentInputSchema(yargs: Argv, options: Pick<Agent, "inputSchema"> & {
|
|
58
58
|
optionalInputs?: string[];
|
|
59
59
|
}): Argv<{
|
|
60
|
-
|
|
60
|
+
interactive: boolean;
|
|
61
61
|
} & {
|
|
62
62
|
"session-id": string | undefined;
|
|
63
63
|
} & {
|
package/dist/utils/yargs.js
CHANGED
|
@@ -11,10 +11,11 @@ import { parse } from "yaml";
|
|
|
11
11
|
import z, { ZodAny, ZodArray, ZodBoolean, ZodError, ZodNumber, ZodObject, ZodString, ZodType, ZodUnknown, } from "zod";
|
|
12
12
|
const MODEL_OPTIONS_GROUP_NAME = "Model Options";
|
|
13
13
|
export const withRunAgentCommonOptions = (yargs) => yargs
|
|
14
|
-
.option("
|
|
15
|
-
describe: "Run
|
|
14
|
+
.option("interactive", {
|
|
15
|
+
describe: "Run in interactive chat mode",
|
|
16
16
|
type: "boolean",
|
|
17
17
|
default: false,
|
|
18
|
+
alias: ["chat"],
|
|
18
19
|
})
|
|
19
20
|
.option("session-id", {
|
|
20
21
|
describe: "Session ID for chat-based agents to maintain context across interactions",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.59.0-beta.
|
|
3
|
+
"version": "1.59.0-beta.12",
|
|
4
4
|
"description": "Your command center for agent development",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -90,17 +90,17 @@
|
|
|
90
90
|
"yoctocolors-cjs": "^2.1.3",
|
|
91
91
|
"zod": "^3.25.67",
|
|
92
92
|
"zod-to-json-schema": "^3.24.6",
|
|
93
|
+
"@aigne/afs-local-fs": "^1.4.0-beta.9",
|
|
93
94
|
"@aigne/afs": "^1.4.0-beta.5",
|
|
94
|
-
"@aigne/
|
|
95
|
+
"@aigne/agent-library": "^1.24.0-beta.11",
|
|
96
|
+
"@aigne/agentic-memory": "^1.1.6-beta.9",
|
|
95
97
|
"@aigne/afs-history": "^1.2.0-beta.5",
|
|
96
|
-
"@aigne/
|
|
97
|
-
"@aigne/
|
|
98
|
-
"@aigne/aigne-hub": "^0.10.16-beta.12",
|
|
99
|
-
"@aigne/default-memory": "^1.4.0-beta.7",
|
|
98
|
+
"@aigne/aigne-hub": "^0.10.16-beta.13",
|
|
99
|
+
"@aigne/core": "^1.72.0-beta.9",
|
|
100
100
|
"@aigne/observability-api": "^0.11.14-beta.1",
|
|
101
|
-
"@aigne/
|
|
102
|
-
"@aigne/
|
|
103
|
-
"@aigne/secrets": "^0.1.6-beta.
|
|
101
|
+
"@aigne/openai": "^0.16.16-beta.9",
|
|
102
|
+
"@aigne/default-memory": "^1.4.0-beta.8",
|
|
103
|
+
"@aigne/secrets": "^0.1.6-beta.9"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@inquirer/testing": "^2.1.50",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"rimraf": "^6.0.1",
|
|
118
118
|
"typescript": "^5.9.2",
|
|
119
119
|
"ufo": "^1.6.1",
|
|
120
|
-
"@aigne/test-utils": "^0.5.69-beta.
|
|
120
|
+
"@aigne/test-utils": "^0.5.69-beta.9"
|
|
121
121
|
},
|
|
122
122
|
"scripts": {
|
|
123
123
|
"lint": "tsc --noEmit",
|