agents-cli-automation 1.0.0
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 +19 -0
- package/package.json +17 -0
- package/src/init.js +37 -0
package/bin/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import init from "../src/init.js";
|
|
4
|
+
|
|
5
|
+
const program = new Command();
|
|
6
|
+
|
|
7
|
+
program
|
|
8
|
+
.name("agents")
|
|
9
|
+
.description("A CLI tool to manage agents")
|
|
10
|
+
.version("0.1.0");
|
|
11
|
+
|
|
12
|
+
program
|
|
13
|
+
.command("init")
|
|
14
|
+
.description("Initialize project")
|
|
15
|
+
.option("-a, --agents", "Add agents.md")
|
|
16
|
+
.option("-p, --playwright", "Setup Playwright TS")
|
|
17
|
+
.action(init);
|
|
18
|
+
|
|
19
|
+
program.parse();
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agents-cli-automation",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Agents CLI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agents": "./bin/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": ["bin", "src"],
|
|
10
|
+
"keywords": ["cli", "agents"],
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"commander": "^14.0.3",
|
|
14
|
+
"fs-extra": "^11.3.3",
|
|
15
|
+
"inquirer": "^13.2.5"
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/init.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
}
|