@aigne/cli 1.59.0-beta.10 → 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 +54 -0
- package/dist/commands/aigne.js +2 -0
- package/dist/commands/app/agent.js +2 -2
- 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 +14 -12
- package/dist/utils/aigne-hub/store/index.js +2 -2
- package/dist/utils/run-with-aigne.js +2 -2
- package/dist/utils/yargs.d.ts +6 -2
- package/dist/utils/yargs.js +7 -2
- package/package.json +14 -14
- package/templates/default/README.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
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
|
+
|
|
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)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* add session compact support for AIAgent ([#863](https://github.com/AIGNE-io/aigne-framework/issues/863)) ([9010918](https://github.com/AIGNE-io/aigne-framework/commit/9010918cd3f18b02b5c60ddc9ed5c34b568d0b28))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Dependencies
|
|
41
|
+
|
|
42
|
+
* The following workspace dependencies were updated
|
|
43
|
+
* dependencies
|
|
44
|
+
* @aigne/afs bumped to 1.4.0-beta.5
|
|
45
|
+
* @aigne/afs-history bumped to 1.2.0-beta.5
|
|
46
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.8
|
|
47
|
+
* @aigne/agent-library bumped to 1.24.0-beta.10
|
|
48
|
+
* @aigne/agentic-memory bumped to 1.1.6-beta.8
|
|
49
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.12
|
|
50
|
+
* @aigne/core bumped to 1.72.0-beta.8
|
|
51
|
+
* @aigne/default-memory bumped to 1.4.0-beta.7
|
|
52
|
+
* @aigne/openai bumped to 0.16.16-beta.8
|
|
53
|
+
* @aigne/secrets bumped to 0.1.6-beta.8
|
|
54
|
+
* devDependencies
|
|
55
|
+
* @aigne/test-utils bumped to 0.5.69-beta.8
|
|
56
|
+
|
|
3
57
|
## [1.59.0-beta.10](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.9...cli-v1.59.0-beta.10) (2025-12-26)
|
|
4
58
|
|
|
5
59
|
|
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())
|
|
@@ -97,8 +97,8 @@ export async function invokeAgent(options) {
|
|
|
97
97
|
await runAgentWithAIGNE(aigne, agent, {
|
|
98
98
|
...options.input,
|
|
99
99
|
input,
|
|
100
|
-
|
|
101
|
-
sessionId: v7(),
|
|
100
|
+
interactive: options.input.interactive,
|
|
101
|
+
sessionId: options.input.sessionId || v7(),
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
finally {
|
|
@@ -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)
|
|
@@ -60,15 +61,16 @@ export function createRunCommand({ aigneFilePath, } = {}) {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
const path = aigneFilePath || options.path || ".";
|
|
63
|
-
if (!(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
if (!isUrl(path) &&
|
|
65
|
+
!(await findAIGNEFile(path).catch((error) => {
|
|
66
|
+
if (options._[0] !== "run") {
|
|
67
|
+
yargsInstance?.showHelp();
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}))) {
|
|
72
74
|
return;
|
|
73
75
|
}
|
|
74
76
|
// Parse model options for loading application
|
|
@@ -88,7 +90,7 @@ export function createRunCommand({ aigneFilePath, } = {}) {
|
|
|
88
90
|
// Allow user to run all of agents in the AIGNE instances
|
|
89
91
|
const allAgents = flat(aigne.agents, aigne.skills, aigne.cli.chat, aigne.mcpServer.agents);
|
|
90
92
|
for (const agent of allAgents) {
|
|
91
|
-
subYargs.command(agentCommandModule({ aigne, agent, chat: options.
|
|
93
|
+
subYargs.command(agentCommandModule({ aigne, agent, chat: options.interactive }));
|
|
92
94
|
}
|
|
93
95
|
for (const cliAgent of aigne.cli.agents ?? []) {
|
|
94
96
|
subYargs.command(cliAgentCommandModule({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { logger } from "@aigne/core/utils/logger.js";
|
|
2
|
-
import { AIGNE_ENV_FILE } from "../constants.js";
|
|
2
|
+
import { AIGNE_ENV_FILE, isTest } from "../constants.js";
|
|
3
3
|
import FileStore from "./file.js";
|
|
4
4
|
import KeyringStore from "./keytar.js";
|
|
5
5
|
import { migrateFileToKeyring } from "./migrate.js";
|
|
@@ -32,7 +32,7 @@ const getSecretStore = async () => {
|
|
|
32
32
|
cachedSecretStore = await createSecretStore({
|
|
33
33
|
filepath: AIGNE_ENV_FILE,
|
|
34
34
|
serviceName: "aigne-hub",
|
|
35
|
-
|
|
35
|
+
forceKeytarUnavailable: Boolean(isTest),
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
return cachedSecretStore;
|
|
@@ -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,9 @@ 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
|
+
} & {
|
|
9
|
+
"session-id": string | undefined;
|
|
8
10
|
} & {
|
|
9
11
|
model: string | undefined;
|
|
10
12
|
} & {
|
|
@@ -55,7 +57,9 @@ export declare function inferZodType(type: ZodType, opts?: {
|
|
|
55
57
|
export declare function withAgentInputSchema(yargs: Argv, options: Pick<Agent, "inputSchema"> & {
|
|
56
58
|
optionalInputs?: string[];
|
|
57
59
|
}): Argv<{
|
|
58
|
-
|
|
60
|
+
interactive: boolean;
|
|
61
|
+
} & {
|
|
62
|
+
"session-id": string | undefined;
|
|
59
63
|
} & {
|
|
60
64
|
model: string | undefined;
|
|
61
65
|
} & {
|
package/dist/utils/yargs.js
CHANGED
|
@@ -11,10 +11,15 @@ 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"],
|
|
19
|
+
})
|
|
20
|
+
.option("session-id", {
|
|
21
|
+
describe: "Session ID for chat-based agents to maintain context across interactions",
|
|
22
|
+
type: "string",
|
|
18
23
|
})
|
|
19
24
|
.option("model", {
|
|
20
25
|
group: MODEL_OPTIONS_GROUP_NAME,
|
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": "^1.4.0-beta.
|
|
94
|
-
"@aigne/afs
|
|
95
|
-
"@aigne/
|
|
96
|
-
"@aigne/agentic-memory": "^1.1.6-beta.
|
|
97
|
-
"@aigne/
|
|
98
|
-
"@aigne/
|
|
99
|
-
"@aigne/
|
|
100
|
-
"@aigne/aigne-hub": "^0.10.16-beta.11",
|
|
93
|
+
"@aigne/afs-local-fs": "^1.4.0-beta.9",
|
|
94
|
+
"@aigne/afs": "^1.4.0-beta.5",
|
|
95
|
+
"@aigne/agent-library": "^1.24.0-beta.11",
|
|
96
|
+
"@aigne/agentic-memory": "^1.1.6-beta.9",
|
|
97
|
+
"@aigne/afs-history": "^1.2.0-beta.5",
|
|
98
|
+
"@aigne/aigne-hub": "^0.10.16-beta.13",
|
|
99
|
+
"@aigne/core": "^1.72.0-beta.9",
|
|
101
100
|
"@aigne/observability-api": "^0.11.14-beta.1",
|
|
102
|
-
"@aigne/openai": "^0.16.16-beta.
|
|
103
|
-
"@aigne/
|
|
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,14 +117,14 @@
|
|
|
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",
|
|
124
124
|
"build": "tsc --build tsconfig.build.json",
|
|
125
125
|
"clean": "rimraf dist test/coverage templates/coverage",
|
|
126
|
-
"test": "run
|
|
127
|
-
"test:coverage": "run
|
|
126
|
+
"test": "npm run test:src && npm run test:templates",
|
|
127
|
+
"test:coverage": "npm run test:src:coverage && npm run test:templates:coverage",
|
|
128
128
|
"test:src": "bun --cwd test test",
|
|
129
129
|
"test:src:coverage": "bun --cwd test test --coverage --coverage-reporter=lcov --coverage-reporter=text",
|
|
130
130
|
"test:templates": "cd templates && node --test",
|