-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·44 lines (35 loc) · 1.62 KB
/
Copy pathindex.js
File metadata and controls
executable file
·44 lines (35 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env node
"use strict";
const { execSync } = require("node:child_process");
const fs = require("node:fs");
const path = require("node:path");
const REPO = "https://github.com/mnifzied-create/agentloop";
const PRO = "https://ko-fi.com/s/7306cb3140";
function main() {
const target = process.argv[2] || "my-agent";
const dir = path.resolve(process.cwd(), target);
if (fs.existsSync(dir) && fs.readdirSync(dir).length > 0) {
console.error(`\n✗ Directory "${target}" already exists and is not empty.\n`);
process.exit(1);
}
console.log(`\n🔁 Creating an AgentLoop app in ./${target} ...\n`);
try {
execSync(`git clone --depth 1 ${REPO}.git "${dir}"`, { stdio: "inherit" });
} catch (err) {
console.error("\n✗ git clone failed. Make sure git is installed and you're online.\n");
process.exit(1);
}
// Make it the user's own project: drop the upstream git history.
fs.rmSync(path.join(dir, ".git"), { recursive: true, force: true });
console.log(`\n✓ Done. The whole agent — streaming + tool use — is in ~150 readable lines.\n`);
console.log(`Next:\n`);
console.log(` cd ${target}`);
console.log(` npm install`);
console.log(` cp .env.example .env.local # add your ANTHROPIC_API_KEY`);
console.log(` npm run dev # http://localhost:3000\n`);
console.log(`Shipping to production? AgentLoop Pro adds 8 patterns — parallel tools,`);
console.log(`persistent memory, retries, rate limiting, approval gates, evals, token`);
console.log(`metering, and a multi-provider seam (any model via OpenRouter):`);
console.log(` → ${PRO}\n`);
}
main();