@aigne/cli 1.0.0-14 → 1.0.0-15

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.
@@ -7,15 +7,15 @@ export function createCreateCommand() {
7
7
  return new Command("create")
8
8
  .description("Create a new aigne project with agent config files")
9
9
  .argument("[path]", "Path to create the project directory", ".")
10
- .action(async (path) => {
11
- let projectPath = path;
12
- if (projectPath === ".") {
10
+ .action(async (_path) => {
11
+ let path = _path;
12
+ if (path === ".") {
13
13
  const answers = await inquirer.prompt([
14
14
  {
15
15
  type: "input",
16
16
  name: "projectName",
17
17
  message: "Project name:",
18
- default: path !== "." ? path : "my-aigne-project",
18
+ default: _path !== "." ? _path : "my-aigne-project",
19
19
  validate: (input) => {
20
20
  if (input.trim() === "")
21
21
  return "Project name cannot be empty.";
@@ -23,16 +23,16 @@ export function createCreateCommand() {
23
23
  },
24
24
  },
25
25
  ]);
26
- projectPath = answers.projectName;
26
+ path = answers.projectName;
27
27
  }
28
- const absolutePath = isAbsolute(path) ? path : resolve(process.cwd(), path);
29
- const isPathNotEmpty = existsSync(absolutePath) && readdirSync(absolutePath).length > 0;
28
+ path = isAbsolute(path) ? path : resolve(process.cwd(), path);
29
+ const isPathNotEmpty = existsSync(path) && readdirSync(path).length > 0;
30
30
  if (isPathNotEmpty) {
31
31
  const answers = await inquirer.prompt([
32
32
  {
33
33
  type: "confirm",
34
34
  name: "overwrite",
35
- message: `The directory "${absolutePath}" is not empty. Do you want to remove its contents?`,
35
+ message: `The directory "${path}" is not empty. Do you want to remove its contents?`,
36
36
  default: false,
37
37
  },
38
38
  ]);
@@ -51,18 +51,18 @@ export function createCreateCommand() {
51
51
  default: "default",
52
52
  },
53
53
  ]);
54
- mkdirSync(absolutePath, { recursive: true });
54
+ mkdirSync(path, { recursive: true });
55
55
  const templatePath = join(import.meta.dirname, "../../templates", template);
56
56
  if (!existsSync(templatePath))
57
57
  throw new Error(`Template "${template}" not found.`);
58
58
  const files = readdirSync(templatePath);
59
59
  for (const file of files) {
60
60
  const source = join(templatePath, file);
61
- const destination = join(absolutePath, file);
61
+ const destination = join(path, file);
62
62
  await cp(source, destination, { recursive: true, force: true });
63
63
  }
64
64
  console.log("\n✅ Aigne project created successfully!");
65
- console.log(`\nTo use your new agent, run:\n cd ${path} && npx -y aigne run`);
65
+ console.log(`\nTo use your new agent, run:\n cd ${_path} && npx -y aigne run`);
66
66
  })
67
67
  .showHelpAfterError(true)
68
68
  .showSuggestionAfterError(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.0.0-14",
3
+ "version": "1.0.0-15",
4
4
  "description": "cli for AIGNE framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -27,7 +27,7 @@
27
27
  "commander": "^13.1.0",
28
28
  "inquirer": "^12.5.0",
29
29
  "openai": "^4.91.1",
30
- "@aigne/core": "^1.5.1-2"
30
+ "@aigne/core": "^1.5.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/bun": "^1.2.8",