@archon-claw/cli 0.3.0 → 0.5.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/dist/cli.js +0 -99
- package/dist/scaffold.d.ts +1 -1
- package/dist/scaffold.js +5 -8
- package/dist/templates/workspace/package.json +5 -3
- package/package.json +3 -5
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,6 @@ import { SessionStore } from "./session.js";
|
|
|
11
11
|
import { startDev } from "./dev.js";
|
|
12
12
|
import { runToolTests, formatResults } from "./test-runner.js";
|
|
13
13
|
import { runEvals } from "./eval/runner.js";
|
|
14
|
-
import { scaffoldAgent, scaffoldWorkspace, updateSkills } from "./scaffold.js";
|
|
15
14
|
const pkg = JSON.parse(readFileSync(path.resolve(__dirname, "../package.json"), "utf-8"));
|
|
16
15
|
const program = new Command();
|
|
17
16
|
program
|
|
@@ -25,12 +24,6 @@ program
|
|
|
25
24
|
: path.resolve(process.cwd(), ".env");
|
|
26
25
|
dotenv.config({ path: envPath });
|
|
27
26
|
});
|
|
28
|
-
program
|
|
29
|
-
.command("chat")
|
|
30
|
-
.description("Start an agent chat session")
|
|
31
|
-
.action(() => {
|
|
32
|
-
console.log("Starting agent...");
|
|
33
|
-
});
|
|
34
27
|
/** Scan a directory for agent subdirectories and load them all */
|
|
35
28
|
async function loadAgentsFromDir(agentsDir) {
|
|
36
29
|
const absDir = path.resolve(agentsDir);
|
|
@@ -157,96 +150,4 @@ program
|
|
|
157
150
|
process.exit(1);
|
|
158
151
|
}
|
|
159
152
|
});
|
|
160
|
-
program
|
|
161
|
-
.command("init")
|
|
162
|
-
.description("Initialise an agent workspace project")
|
|
163
|
-
.argument("[dir]", "Directory to initialise")
|
|
164
|
-
.option("--install", "Automatically install npm dependencies")
|
|
165
|
-
.action(async (dir, opts) => {
|
|
166
|
-
try {
|
|
167
|
-
const { intro, text, confirm, isCancel, outro } = await import("@clack/prompts");
|
|
168
|
-
intro("archon-claw init");
|
|
169
|
-
if (!dir) {
|
|
170
|
-
const name = await text({
|
|
171
|
-
message: "Project name",
|
|
172
|
-
placeholder: "my-ai-agent",
|
|
173
|
-
validate: (v) => {
|
|
174
|
-
if (!v?.trim())
|
|
175
|
-
return "Project name is required";
|
|
176
|
-
if (!/^[a-z0-9._-]+$/i.test(v))
|
|
177
|
-
return "Invalid directory name";
|
|
178
|
-
},
|
|
179
|
-
});
|
|
180
|
-
if (isCancel(name)) {
|
|
181
|
-
outro("Cancelled");
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
dir = name;
|
|
185
|
-
}
|
|
186
|
-
if (opts.install === undefined) {
|
|
187
|
-
const install = await confirm({ message: "Install dependencies?" });
|
|
188
|
-
if (isCancel(install)) {
|
|
189
|
-
outro("Cancelled");
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
opts.install = install;
|
|
193
|
-
}
|
|
194
|
-
await scaffoldWorkspace(dir, { install: opts.install });
|
|
195
|
-
outro("Done!");
|
|
196
|
-
}
|
|
197
|
-
catch (err) {
|
|
198
|
-
console.error(err instanceof Error ? err.message : err);
|
|
199
|
-
process.exit(1);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
program
|
|
203
|
-
.command("create-agent")
|
|
204
|
-
.description("Create a new agent project")
|
|
205
|
-
.argument("[agent-name]", "Name of the agent (used as directory name)")
|
|
206
|
-
.option("-d, --dir <path>", "Parent directory for the agent", "./agents")
|
|
207
|
-
.action(async (agentName, opts) => {
|
|
208
|
-
try {
|
|
209
|
-
if (!agentName) {
|
|
210
|
-
const { intro, text, isCancel, outro } = await import("@clack/prompts");
|
|
211
|
-
intro("archon-claw create");
|
|
212
|
-
const name = await text({
|
|
213
|
-
message: "Agent name",
|
|
214
|
-
placeholder: "my-agent",
|
|
215
|
-
validate: (v) => {
|
|
216
|
-
if (!v?.trim())
|
|
217
|
-
return "Agent name is required";
|
|
218
|
-
if (!/^[a-z0-9._-]+$/i.test(v))
|
|
219
|
-
return "Invalid directory name";
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
if (isCancel(name)) {
|
|
223
|
-
outro("Cancelled");
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
agentName = name;
|
|
227
|
-
await scaffoldAgent(agentName, opts.dir);
|
|
228
|
-
outro("Done!");
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
await scaffoldAgent(agentName, opts.dir);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
catch (err) {
|
|
235
|
-
console.error(err instanceof Error ? err.message : err);
|
|
236
|
-
process.exit(1);
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
program
|
|
240
|
-
.command("update-skills")
|
|
241
|
-
.description("Update skills to the latest version bundled with @archon-claw/cli")
|
|
242
|
-
.argument("[dir]", "Workspace directory", ".")
|
|
243
|
-
.action(async (dir) => {
|
|
244
|
-
try {
|
|
245
|
-
await updateSkills(dir);
|
|
246
|
-
}
|
|
247
|
-
catch (err) {
|
|
248
|
-
console.error(err instanceof Error ? err.message : err);
|
|
249
|
-
process.exit(1);
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
153
|
program.parse();
|
package/dist/scaffold.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export declare function scaffoldAgent(name: string, targetDir: string, opts?: {
|
|
|
4
4
|
export declare function scaffoldWorkspace(targetDir: string, opts?: {
|
|
5
5
|
install?: boolean;
|
|
6
6
|
}): Promise<void>;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function exportSkills(targetDir: string): Promise<void>;
|
package/dist/scaffold.js
CHANGED
|
@@ -89,15 +89,12 @@ export async function scaffoldWorkspace(targetDir, opts = {}) {
|
|
|
89
89
|
}
|
|
90
90
|
console.log(` archon-claw dev agents/my-agent`);
|
|
91
91
|
}
|
|
92
|
-
export async function
|
|
92
|
+
export async function exportSkills(targetDir) {
|
|
93
93
|
const dest = path.resolve(targetDir);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
await fs.
|
|
97
|
-
|
|
98
|
-
await fs.cp(skillsDir, destSkillsDir, { recursive: true });
|
|
99
|
-
const entries = await fs.readdir(destSkillsDir);
|
|
100
|
-
console.log(`\nUpdated ${entries.length} skills in ${destSkillsDir}\n`);
|
|
94
|
+
await fs.mkdir(dest, { recursive: true });
|
|
95
|
+
await fs.cp(skillsDir, dest, { recursive: true });
|
|
96
|
+
const entries = await fs.readdir(dest);
|
|
97
|
+
console.log(`\nExported ${entries.length} skills to ${dest}\n`);
|
|
101
98
|
for (const entry of entries.sort()) {
|
|
102
99
|
console.log(` ${entry}/SKILL.md`);
|
|
103
100
|
}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "archon-claw dev agents
|
|
8
|
-
"start": "archon-claw start agents
|
|
7
|
+
"dev": "archon-claw dev --agents-dir agents",
|
|
8
|
+
"start": "archon-claw start --agents-dir agents -p ${PORT:-5100}",
|
|
9
|
+
"test": "archon-claw test agents/my-agent",
|
|
10
|
+
"eval": "archon-claw eval agents/my-agent",
|
|
9
11
|
"create:agent": "archon-claw create-agent",
|
|
10
|
-
"
|
|
12
|
+
"export:skills": "archon-claw export-skills .claude/skills"
|
|
11
13
|
},
|
|
12
14
|
"keywords": [],
|
|
13
15
|
"license": "ISC",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archon-claw/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "AI Agent CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"@archon-claw/web": "0.1.1"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@clack/prompts": "^1.1.0",
|
|
28
27
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
29
28
|
"chokidar": "^5.0.0",
|
|
30
29
|
"commander": "^14.0.3",
|
|
@@ -34,11 +33,10 @@
|
|
|
34
33
|
"open": "^10.2.0",
|
|
35
34
|
"openai": "^6.25.0",
|
|
36
35
|
"picomatch": "^4.0.3",
|
|
37
|
-
"zod": "^3.25.76"
|
|
38
|
-
"@archon-claw/skills": "0.2.1"
|
|
36
|
+
"zod": "^3.25.76"
|
|
39
37
|
},
|
|
40
38
|
"scripts": {
|
|
41
|
-
"build": "tsc -p tsconfig.build.json &&
|
|
39
|
+
"build": "tsc -p tsconfig.build.json && rm -rf dist/public && cp -r ../web/dist dist/public",
|
|
42
40
|
"dev": "tsx src/cli.ts start examples/my-agent",
|
|
43
41
|
"start": "node dist/cli.js",
|
|
44
42
|
"test": "vitest run --exclude dist --exclude examples",
|