agents-cli-automation 1.0.0 ā 1.0.3
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 +2 -1
- package/package.json +10 -4
- package/src/commands/init.js +45 -0
- package/src/templates/playwright-agent.md +16 -0
- package/src/init.js +0 -37
package/bin/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents-cli-automation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Agents CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"agents": "./bin/index.js"
|
|
8
8
|
},
|
|
9
|
-
"files": [
|
|
10
|
-
|
|
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": "^
|
|
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");
|
|
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
|
-
}
|