agents-cli-automation 1.0.0 → 1.0.4

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/bin/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
- import init from "../src/init.js";
3
+ import init from "../src/commands/init.js";
4
+
4
5
 
5
6
  const program = new Command();
6
7
 
package/package.json CHANGED
@@ -1,17 +1,23 @@
1
1
  {
2
2
  "name": "agents-cli-automation",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
4
  "description": "Agents CLI",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "agents": "./bin/index.js"
8
8
  },
9
- "files": ["bin", "src"],
10
- "keywords": ["cli", "agents"],
9
+ "files": [
10
+ "bin",
11
+ "src"
12
+ ],
13
+ "keywords": [
14
+ "cli",
15
+ "agents"
16
+ ],
11
17
  "license": "ISC",
12
18
  "dependencies": {
13
19
  "commander": "^14.0.3",
14
20
  "fs-extra": "^11.3.3",
15
- "inquirer": "^13.2.5"
21
+ "inquirer": "^9.3.8"
16
22
  }
17
23
  }
@@ -0,0 +1,45 @@
1
+ import inquirer from "inquirer";
2
+ import fs from "fs-extra";
3
+ import path from "path";
4
+ import { fileURLToPath } from "url";
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
8
+
9
+ export default async function initCommand() {
10
+ console.log("\nšŸš€ Agents CLI setup\n");
11
+
12
+ const { setup } = await inquirer.prompt([
13
+ {
14
+ type: "list",
15
+ name: "setup",
16
+ message: "Select setup",
17
+ choices: ["Add Playwright Agent"]
18
+ }
19
+ ]);
20
+
21
+ if (setup === "Add Playwright Agent") {
22
+ // Template inside your CLI package
23
+ const templatePath = path.resolve(
24
+ __dirname,
25
+ "../templates/playwright-agent.md"
26
+ );
27
+
28
+ // Target folder **inside the user's project**
29
+ const userProjectRoot = process.cwd();
30
+ const agentsDir = path.join(userProjectRoot, ".github", "agents");
31
+
32
+ // Ensure folder exists
33
+ await fs.ensureDir(agentsDir);
34
+
35
+ // Save file with .agent extension
36
+ const destFile = path.join(agentsDir, "playwrightsetup-agent.md");
37
+
38
+ // Copy template content
39
+ await fs.copyFile(templatePath, destFile);
40
+
41
+ console.log(`\nāœ… Playwright agent created at ${destFile}\n`);
42
+ }
43
+
44
+ console.log("Setup complete šŸŽ‰\n");
45
+ }
@@ -0,0 +1,16 @@
1
+ name: creat playwright frmework
2
+ description: Describe what this custom agent does and when to use it.
3
+ argument-hint: The inputs this agent expects, e.g., "framework requirements"
4
+
5
+ ---
6
+
7
+ This agent creates a production-ready Playwright automation framework.
8
+
9
+ Capabilities:
10
+ - Playwright setup (JS / TS)
11
+ - API, DB, UI structure
12
+ - Fixtures
13
+ - Sample tests
14
+ - Scalable folder structure
15
+
16
+ Use this agent when starting a new automation project.
package/src/init.js DELETED
@@ -1,37 +0,0 @@
1
- import fs from "fs-extra";
2
- import inquirer from "inquirer";
3
- import path from "path";
4
-
5
- export default async function init() {
6
- console.log("\nšŸš€ Agents CLI setup\n");
7
-
8
- const { setupType } = await inquirer.prompt([
9
- {
10
- type: "rawlist",
11
- name: "setupType",
12
- message: "Select setup",
13
- choices: [
14
- { name: "Add agents.md", value: "agents" },
15
- { name: "Setup Playwright project", value: "playwright" },
16
- { name: "Setup workflow", value: "workflow" }
17
- ]
18
- }
19
- ]);
20
-
21
- console.log("šŸ‘‰ Selected:", setupType); // debug line
22
-
23
- if (setupType === "agents") {
24
- const filePath = path.join(process.cwd(), "agents.md");
25
-
26
- const content = `# Agents Configuration
27
-
28
- ## Purpose
29
- Define automation agents for this project.
30
- `;
31
-
32
- await fs.writeFile(filePath, content);
33
- console.log("agents.md created āœ…");
34
- }
35
-
36
- console.log("\nSetup complete šŸŽ‰\n");
37
- }