@aigne/cli 1.59.0-beta.11 → 1.59.0-beta.13

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,63 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.59.0-beta.13](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.12...cli-v1.59.0-beta.13) (2026-01-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * **core:** add cross session user memory support ([#873](https://github.com/AIGNE-io/aigne-framework/issues/873)) ([f377aa1](https://github.com/AIGNE-io/aigne-framework/commit/f377aa17f2cf8004fd3225ade4a37fd90af1292f))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **cli:** add askUserQuestion for run-skill command ([9c621e7](https://github.com/AIGNE-io/aigne-framework/commit/9c621e7c55501d129e71966da79514717a4579ab))
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * The following workspace dependencies were updated
19
+ * dependencies
20
+ * @aigne/afs-history bumped to 1.2.0-beta.6
21
+ * @aigne/afs-local-fs bumped to 1.4.0-beta.10
22
+ * @aigne/agent-library bumped to 1.24.0-beta.12
23
+ * @aigne/agentic-memory bumped to 1.1.6-beta.10
24
+ * @aigne/aigne-hub bumped to 0.10.16-beta.14
25
+ * @aigne/core bumped to 1.72.0-beta.10
26
+ * @aigne/default-memory bumped to 1.4.0-beta.9
27
+ * @aigne/openai bumped to 0.16.16-beta.10
28
+ * @aigne/secrets bumped to 0.1.6-beta.10
29
+ * devDependencies
30
+ * @aigne/test-utils bumped to 0.5.69-beta.10
31
+
32
+ ## [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)
33
+
34
+
35
+ ### Features
36
+
37
+ * **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))
38
+
39
+
40
+ ### Bug Fixes
41
+
42
+ * **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))
43
+ * **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))
44
+
45
+
46
+ ### Dependencies
47
+
48
+ * The following workspace dependencies were updated
49
+ * dependencies
50
+ * @aigne/afs-local-fs bumped to 1.4.0-beta.9
51
+ * @aigne/agent-library bumped to 1.24.0-beta.11
52
+ * @aigne/agentic-memory bumped to 1.1.6-beta.9
53
+ * @aigne/aigne-hub bumped to 0.10.16-beta.13
54
+ * @aigne/core bumped to 1.72.0-beta.9
55
+ * @aigne/default-memory bumped to 1.4.0-beta.8
56
+ * @aigne/openai bumped to 0.16.16-beta.9
57
+ * @aigne/secrets bumped to 0.1.6-beta.9
58
+ * devDependencies
59
+ * @aigne/test-utils bumped to 0.5.69-beta.9
60
+
3
61
  ## [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
62
 
5
63
 
@@ -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())
@@ -1,4 +1,5 @@
1
1
  import assert from "node:assert";
2
+ import { DEFAULT_USER_ID } from "@aigne/cli/constants.js";
2
3
  import { logger } from "@aigne/core/utils/logger.js";
3
4
  import { v7 } from "@aigne/uuid";
4
5
  import { runAgentWithAIGNE } from "../../utils/run-with-aigne.js";
@@ -97,8 +98,9 @@ export async function invokeAgent(options) {
97
98
  await runAgentWithAIGNE(aigne, agent, {
98
99
  ...options.input,
99
100
  input,
100
- chat: options.input.chat,
101
+ interactive: options.input.interactive,
101
102
  sessionId: options.input.sessionId || v7(),
103
+ userId: DEFAULT_USER_ID,
102
104
  });
103
105
  }
104
106
  finally {
@@ -0,0 +1,6 @@
1
+ import type { CommandModule } from "yargs";
2
+ import { type AgentRunCommonOptions } from "../utils/yargs.js";
3
+ export declare function createRunSkillCommand(): CommandModule<unknown, {
4
+ skill?: string[];
5
+ interactive?: boolean;
6
+ } & AgentRunCommonOptions>;
@@ -0,0 +1,108 @@
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 AskUserQuestion from "@aigne/agent-library/ask-user-question";
6
+ import BashAgent from "@aigne/agent-library/bash";
7
+ import { AIGNE, FunctionAgent } from "@aigne/core";
8
+ import { z } from "zod";
9
+ import { loadChatModel } from "../utils/aigne-hub/model.js";
10
+ import { withAgentInputSchema } from "../utils/yargs.js";
11
+ import { invokeAgent } from "./app/agent.js";
12
+ export function createRunSkillCommand() {
13
+ return {
14
+ command: ["run-skill"],
15
+ describe: "Run Agent Skill for the specified path",
16
+ builder: async (yargs) => {
17
+ return withAgentInputSchema(yargs
18
+ .option("skill", {
19
+ array: true,
20
+ type: "string",
21
+ describe: "Path to the Agent Skill directory",
22
+ })
23
+ .option("interactive", {
24
+ describe: "Run in interactive chat mode",
25
+ type: "boolean",
26
+ default: false,
27
+ alias: ["chat"],
28
+ })
29
+ .demandOption("skill"), {
30
+ inputSchema: z.object({
31
+ message: z.string(),
32
+ }),
33
+ optionalInputs: ["message"],
34
+ });
35
+ },
36
+ handler: async (options) => {
37
+ if (!Array.isArray(options.skill) || options.skill.length === 0) {
38
+ throw new Error("At least one skill path must be provided.");
39
+ }
40
+ const model = await loadChatModel({
41
+ model: options.model || "aignehub/anthropic/claude-sonnet-4-5",
42
+ });
43
+ const aigne = new AIGNE({ model });
44
+ const agent = new AgentSkillManager({
45
+ inputKey: "message",
46
+ taskRenderMode: "collapse",
47
+ skills: [
48
+ new BashAgent({
49
+ description: `\
50
+ Execute bash scripts and return stdout and stderr output.
51
+
52
+ When to use:
53
+ - Running system commands (git, curl, etc.)
54
+ - Executing build tools (npm, pip, make, etc.)
55
+ - Running code scripts (python, node, etc.)
56
+
57
+ Important:
58
+ - Do NOT use bash for file operations. Use AFS tools instead (afs_list, afs_read, afs_write, afs_edit, afs_search).
59
+ - Do NOT use 'cd'. The working directory is already set to workspace. Use relative paths directly.
60
+ - Do NOT use 'npm i -g' or 'pip install --user'. Install dependencies locally in workspace:
61
+ - For Node.js: Use 'npm install <pkg>' (local) or 'npx <pkg>' (one-time run without install).
62
+ - For Python: Use 'pip install <pkg> -t .' or 'python -m venv .venv && source .venv/bin/activate && pip install <pkg>'.
63
+ `,
64
+ sandbox: false,
65
+ permissions: {
66
+ defaultMode: "ask",
67
+ guard: FunctionAgent.from(async (input, options) => {
68
+ const confirm = options.prompts?.confirm;
69
+ if (!confirm)
70
+ throw new Error("No confirm prompt available for permission guard.");
71
+ const approved = await confirm({ message: `Run command ${input.script}?` });
72
+ return {
73
+ approved,
74
+ };
75
+ }),
76
+ },
77
+ }),
78
+ new AskUserQuestion(),
79
+ ],
80
+ afs: {
81
+ modules: [
82
+ new AFSHistory({}),
83
+ new LocalFS({
84
+ name: "workspace",
85
+ localPath: process.cwd(),
86
+ description: `\
87
+ Current working directory. All temporary files should be written here using absolute AFS paths (e.g., /modules/workspace/temp.py).
88
+ Note: Bash is already running in this directory, so do NOT use 'cd /modules/workspace' in scripts. Use relative paths directly (e.g., python temp.py).`,
89
+ }),
90
+ ...options.skill.map((path) => new LocalFS({
91
+ name: basename(path),
92
+ localPath: path,
93
+ description: "Contains Agent Skills. Use 'Skill' tool to invoke skills from this module.",
94
+ agentSkills: true,
95
+ })),
96
+ ],
97
+ },
98
+ });
99
+ await invokeAgent({
100
+ aigne,
101
+ agent,
102
+ input: {
103
+ ...options,
104
+ },
105
+ });
106
+ },
107
+ };
108
+ }
@@ -5,5 +5,5 @@ export declare function createRunCommand({ aigneFilePath, }?: {
5
5
  version?: boolean;
6
6
  path?: string;
7
7
  entryAgent?: string;
8
- chat?: boolean;
8
+ interactive?: boolean;
9
9
  }>;
@@ -38,10 +38,11 @@ export function createRunCommand({ aigneFilePath, } = {}) {
38
38
  alias: "v",
39
39
  describe: "Show version number",
40
40
  })
41
- .option("chat", {
42
- describe: "Run chat loop in terminal",
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.chat }));
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({
@@ -3,3 +3,4 @@ export declare const AIGNE_CLI_VERSION: any;
3
3
  export declare const availableMemories: (typeof DefaultMemory)[];
4
4
  export declare const AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE = "NOT_ENOUGH";
5
5
  export declare const CHAT_MODEL_OPTIONS: string[];
6
+ export declare const DEFAULT_USER_ID = "cli-user";
package/dist/constants.js CHANGED
@@ -17,3 +17,4 @@ export const CHAT_MODEL_OPTIONS = [
17
17
  "preferInputFileType",
18
18
  "reasoningEffort",
19
19
  ];
20
+ export const DEFAULT_USER_ID = "cli-user";
@@ -1,6 +1,7 @@
1
1
  import { type Message, type UserAgent } from "@aigne/core";
2
2
  export declare const DEFAULT_CHAT_INPUT_KEY = "message";
3
3
  export interface ChatLoopOptions {
4
+ userId?: string;
4
5
  sessionId?: string;
5
6
  initialCall?: Message | string;
6
7
  welcome?: string;
@@ -75,7 +75,7 @@ async function callAgent(userAgent, input, options) {
75
75
  const tracer = new TerminalTracer(userAgent.context, options);
76
76
  await tracer.run(userAgent, typeof input === "string"
77
77
  ? { ...options.input, [options.inputKey || DEFAULT_CHAT_INPUT_KEY]: input }
78
- : { ...options.input, ...input }, { userContext: { sessionId: options.sessionId } });
78
+ : { ...options.input, ...input }, { userContext: { sessionId: options.sessionId, userId: options.userId } });
79
79
  }
80
80
  const COMMANDS = {
81
81
  "/exit": () => ({ exit: true }),
@@ -15,7 +15,8 @@ export declare function runWithAIGNE(agentCreator: ((aigne: AIGNE) => PromiseOrV
15
15
  modelOptions?: ChatModelInputOptions;
16
16
  outputKey?: string;
17
17
  }): Promise<void>;
18
- export declare function runAgentWithAIGNE(aigne: AIGNE, agent: Agent, { sessionId, outputKey, outputFileKey, chatLoopOptions, ...options }?: {
18
+ export declare function runAgentWithAIGNE(aigne: AIGNE, agent: Agent, { userId, sessionId, outputKey, outputFileKey, chatLoopOptions, ...options }?: {
19
+ userId?: string;
19
20
  sessionId?: string;
20
21
  outputKey?: string;
21
22
  outputFileKey?: string;
@@ -84,7 +84,7 @@ export async function runWithAIGNE(agentCreator, { aigne, argv = process.argv, c
84
84
  process.exit(1);
85
85
  });
86
86
  }
87
- export async function runAgentWithAIGNE(aigne, agent, { sessionId, outputKey, outputFileKey, chatLoopOptions, ...options } = {}) {
87
+ export async function runAgentWithAIGNE(aigne, agent, { userId, sessionId, outputKey, outputFileKey, chatLoopOptions, ...options } = {}) {
88
88
  if (options.output) {
89
89
  const outputPath = isAbsolute(options.output)
90
90
  ? options.output
@@ -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.chat) {
105
+ if (options.interactive) {
106
106
  if (!isatty(process.stdout.fd)) {
107
- throw new Error("--chat mode requires a TTY terminal");
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, {
@@ -113,6 +113,7 @@ export async function runAgentWithAIGNE(aigne, agent, { sessionId, outputKey, ou
113
113
  inputFileKey: agent instanceof AIAgent ? agent.inputFileKey : undefined,
114
114
  input: options.input,
115
115
  sessionId,
116
+ userId,
116
117
  });
117
118
  return;
118
119
  }
@@ -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
- chat: boolean;
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
- chat: boolean;
60
+ interactive: boolean;
61
61
  } & {
62
62
  "session-id": string | undefined;
63
63
  } & {
@@ -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("chat", {
15
- describe: "Run chat loop in terminal",
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.11",
3
+ "version": "1.59.0-beta.13",
4
4
  "description": "Your command center for agent development",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -91,16 +91,16 @@
91
91
  "zod": "^3.25.67",
92
92
  "zod-to-json-schema": "^3.24.6",
93
93
  "@aigne/afs": "^1.4.0-beta.5",
94
- "@aigne/afs-local-fs": "^1.4.0-beta.8",
95
- "@aigne/afs-history": "^1.2.0-beta.5",
96
- "@aigne/agent-library": "^1.24.0-beta.10",
97
- "@aigne/agentic-memory": "^1.1.6-beta.8",
98
- "@aigne/aigne-hub": "^0.10.16-beta.12",
99
- "@aigne/default-memory": "^1.4.0-beta.7",
94
+ "@aigne/afs-history": "^1.2.0-beta.6",
95
+ "@aigne/agent-library": "^1.24.0-beta.12",
96
+ "@aigne/afs-local-fs": "^1.4.0-beta.10",
97
+ "@aigne/agentic-memory": "^1.1.6-beta.10",
98
+ "@aigne/core": "^1.72.0-beta.10",
100
99
  "@aigne/observability-api": "^0.11.14-beta.1",
101
- "@aigne/core": "^1.72.0-beta.8",
102
- "@aigne/openai": "^0.16.16-beta.8",
103
- "@aigne/secrets": "^0.1.6-beta.8"
100
+ "@aigne/default-memory": "^1.4.0-beta.9",
101
+ "@aigne/openai": "^0.16.16-beta.10",
102
+ "@aigne/secrets": "^0.1.6-beta.10",
103
+ "@aigne/aigne-hub": "^0.10.16-beta.14"
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.8"
120
+ "@aigne/test-utils": "^0.5.69-beta.10"
121
121
  },
122
122
  "scripts": {
123
123
  "lint": "tsc --noEmit",
@@ -42,7 +42,7 @@ echo "Hello, what can you help me with?" | aigne run
42
42
  use the following command to start an interactive chat session:
43
43
 
44
44
  ```bash
45
- aigne run --chat
45
+ aigne run --interactive
46
46
  ```
47
47
 
48
48
  help: