@agentforge-ai/cli 0.1.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/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @agentforge-ai/cli
2
+
3
+ Command-line interface for creating, running, and managing AgentForge projects.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @agentforge-ai/cli
9
+ ```
10
+
11
+ ## Commands
12
+
13
+ ### `agentforge create <project-name>`
14
+
15
+ Creates a new AgentForge project with all the necessary boilerplate.
16
+
17
+ ```bash
18
+ agentforge create my-agent-project
19
+ ```
20
+
21
+ ### `agentforge run`
22
+
23
+ Starts the local development environment (Convex dev server).
24
+
25
+ ```bash
26
+ cd my-agent-project
27
+ agentforge run
28
+ ```
29
+
30
+ ### `agentforge deploy`
31
+
32
+ Deploy your project (coming soon).
33
+
34
+ ## License
35
+
36
+ Apache-2.0
@@ -0,0 +1,8 @@
1
+ # OpenAI API Key (required for default model)
2
+ OPENAI_API_KEY=sk-your-key-here
3
+
4
+ # E2B API Key (required for sandbox execution)
5
+ E2B_API_KEY=e2b_your-key-here
6
+
7
+ # Convex deployment URL (set automatically by `npx convex dev`)
8
+ # CONVEX_URL=https://your-deployment.convex.cloud
@@ -0,0 +1,30 @@
1
+ # My AgentForge Project
2
+
3
+ Built with [AgentForge](https://github.com/Agentic-Engineering-Agency/agentforge) - The Minimalist Framework for Collaborative AI Agents.
4
+
5
+ ## Getting Started
6
+
7
+ ```bash
8
+ # Start the development server
9
+ agentforge run
10
+
11
+ # Or use pnpm directly
12
+ pnpm dev
13
+ ```
14
+
15
+ ## Project Structure
16
+
17
+ ```
18
+ ├── convex/ # Convex schema and functions
19
+ │ └── schema.ts # Database schema (agents, threads, messages)
20
+ ├── src/
21
+ │ └── agent.ts # Your agent definition
22
+ ├── package.json
23
+ └── tsconfig.json
24
+ ```
25
+
26
+ ## Learn More
27
+
28
+ - [AgentForge Documentation](https://github.com/Agentic-Engineering-Agency/agentforge)
29
+ - [Mastra Documentation](https://mastra.ai/docs)
30
+ - [Convex Documentation](https://docs.convex.dev)
@@ -0,0 +1,28 @@
1
+ import { defineSchema, defineTable } from "convex/server";
2
+ import { v } from "convex/values";
3
+
4
+ export default defineSchema({
5
+ agents: defineTable({
6
+ id: v.string(),
7
+ name: v.string(),
8
+ instructions: v.string(),
9
+ model: v.string(),
10
+ tools: v.optional(v.any()),
11
+ }).index("by_id", ["id"]),
12
+
13
+ threads: defineTable({
14
+ name: v.optional(v.string()),
15
+ }),
16
+
17
+ messages: defineTable({
18
+ threadId: v.id("threads"),
19
+ role: v.union(
20
+ v.literal("user"),
21
+ v.literal("assistant"),
22
+ v.literal("system"),
23
+ v.literal("tool")
24
+ ),
25
+ content: v.string(),
26
+ tool_calls: v.optional(v.any()),
27
+ }).index("by_thread", ["threadId"]),
28
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "my-agentforge-project",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "agentforge run",
8
+ "build": "tsc",
9
+ "convex:dev": "npx convex dev",
10
+ "convex:deploy": "npx convex deploy"
11
+ },
12
+ "dependencies": {
13
+ "@agentforge-ai/core": "^0.1.0",
14
+ "convex": "^1.17.0"
15
+ },
16
+ "devDependencies": {
17
+ "typescript": "^5.5.0"
18
+ }
19
+ }
@@ -0,0 +1,22 @@
1
+ import { Agent } from '@agentforge-ai/core';
2
+
3
+ /**
4
+ * A sample AgentForge agent.
5
+ *
6
+ * This is a starting point for your own agent. Modify the instructions,
7
+ * model, and tools to suit your needs.
8
+ */
9
+ const myAgent = new Agent({
10
+ id: 'my-first-agent',
11
+ name: 'My First Agent',
12
+ instructions: `You are a helpful AI assistant built with AgentForge.
13
+ You can help users with a variety of tasks.
14
+ Be concise, accurate, and friendly.`,
15
+ model: 'openai:gpt-4o-mini',
16
+ });
17
+
18
+ export default myAgent;
19
+
20
+ // Example usage:
21
+ // const response = await myAgent.generate('Hello, what can you do?');
22
+ // console.log(response.text);
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "lib": ["ES2022"],
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "resolveJsonModule": true,
12
+ "declaration": true,
13
+ "outDir": "./dist",
14
+ "rootDir": "./src"
15
+ },
16
+ "include": ["src/**/*.ts", "convex/**/*.ts"],
17
+ "exclude": ["node_modules", "dist"]
18
+ }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,128 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { Command } from "commander";
5
+
6
+ // src/commands/create.ts
7
+ import path from "path";
8
+ import { fileURLToPath } from "url";
9
+ import fs from "fs-extra";
10
+ import { execSync } from "child_process";
11
+ var __filename = fileURLToPath(import.meta.url);
12
+ var __dirname = path.dirname(__filename);
13
+ async function createProject(projectName, options) {
14
+ const targetDir = path.resolve(process.cwd(), projectName);
15
+ if (await fs.pathExists(targetDir)) {
16
+ console.error(`Error: Directory "${projectName}" already exists.`);
17
+ process.exit(1);
18
+ }
19
+ console.log(`
20
+ \u{1F528} Creating AgentForge project: ${projectName}
21
+ `);
22
+ const templateDir = path.resolve(
23
+ __dirname,
24
+ "..",
25
+ // from dist/commands to dist
26
+ "templates",
27
+ options.template
28
+ );
29
+ if (!await fs.pathExists(templateDir)) {
30
+ console.error(`Error: Template "${options.template}" not found.`);
31
+ process.exit(1);
32
+ }
33
+ await fs.copy(templateDir, targetDir);
34
+ const pkgPath = path.join(targetDir, "package.json");
35
+ if (await fs.pathExists(pkgPath)) {
36
+ const pkg = await fs.readJson(pkgPath);
37
+ pkg.name = projectName;
38
+ await fs.writeJson(pkgPath, pkg, { spaces: 2 });
39
+ }
40
+ console.log(` \u2705 Project scaffolded at ./${projectName}`);
41
+ console.log(`
42
+ \u{1F4E6} Installing dependencies...
43
+ `);
44
+ try {
45
+ execSync("pnpm install", {
46
+ cwd: targetDir,
47
+ stdio: "inherit"
48
+ });
49
+ console.log(`
50
+ \u2705 Dependencies installed`);
51
+ } catch {
52
+ console.warn(
53
+ `
54
+ \u26A0\uFE0F Could not install dependencies. Run "cd ${projectName} && pnpm install" manually.`
55
+ );
56
+ }
57
+ console.log(`
58
+ \u{1F389} AgentForge project "${projectName}" created successfully!
59
+
60
+ Next steps:
61
+ cd ${projectName}
62
+ agentforge run
63
+
64
+ Documentation: https://github.com/Agentic-Engineering-Agency/agentforge
65
+ `);
66
+ }
67
+
68
+ // src/commands/run.ts
69
+ import { spawn } from "child_process";
70
+ import path2 from "path";
71
+ import fs2 from "fs-extra";
72
+ async function runProject(options) {
73
+ const projectDir = process.cwd();
74
+ const pkgPath = path2.join(projectDir, "package.json");
75
+ if (!await fs2.pathExists(pkgPath)) {
76
+ console.error(
77
+ "Error: No package.json found. Are you in an AgentForge project directory?"
78
+ );
79
+ process.exit(1);
80
+ }
81
+ const convexDir = path2.join(projectDir, "convex");
82
+ if (!await fs2.pathExists(convexDir)) {
83
+ console.error(
84
+ "Error: No convex/ directory found. Are you in an AgentForge project directory?"
85
+ );
86
+ process.exit(1);
87
+ }
88
+ console.log(`
89
+ \u{1F680} Starting AgentForge development server...
90
+ `);
91
+ console.log(` Convex dev server starting on port ${options.port}...`);
92
+ const convexProcess = spawn("npx", ["convex", "dev"], {
93
+ cwd: projectDir,
94
+ stdio: "inherit",
95
+ shell: true
96
+ });
97
+ convexProcess.on("error", (err) => {
98
+ console.error(`Failed to start Convex dev server: ${err.message}`);
99
+ process.exit(1);
100
+ });
101
+ convexProcess.on("close", (code) => {
102
+ if (code !== 0) {
103
+ console.error(`Convex dev server exited with code ${code}`);
104
+ }
105
+ });
106
+ const shutdown = () => {
107
+ console.log("\n\n\u{1F44B} Shutting down AgentForge dev server...");
108
+ convexProcess.kill("SIGTERM");
109
+ process.exit(0);
110
+ };
111
+ process.on("SIGINT", shutdown);
112
+ process.on("SIGTERM", shutdown);
113
+ }
114
+
115
+ // src/index.ts
116
+ var program = new Command();
117
+ program.name("agentforge").description("CLI tool for creating, running, and managing AgentForge projects").version("0.1.0");
118
+ program.command("create").argument("<project-name>", "Name of the project to create").description("Create a new AgentForge project").option("-t, --template <template>", "Project template to use", "default").action(async (projectName, options) => {
119
+ await createProject(projectName, options);
120
+ });
121
+ program.command("run").description("Start the local development environment").option("-p, --port <port>", "Port for the dev server", "3000").action(async (options) => {
122
+ await runProject(options);
123
+ });
124
+ program.command("deploy").description("Deploy the project (coming soon)").action(() => {
125
+ console.log("Deploy command coming soon. Stay tuned!");
126
+ });
127
+ program.parse();
128
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/commands/create.ts","../src/commands/run.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { createProject } from './commands/create.js';\nimport { runProject } from './commands/run.js';\n\nconst program = new Command();\n\nprogram\n .name('agentforge')\n .description('CLI tool for creating, running, and managing AgentForge projects')\n .version('0.1.0');\n\nprogram\n .command('create')\n .argument('<project-name>', 'Name of the project to create')\n .description('Create a new AgentForge project')\n .option('-t, --template <template>', 'Project template to use', 'default')\n .action(async (projectName: string, options: { template: string }) => {\n await createProject(projectName, options);\n });\n\nprogram\n .command('run')\n .description('Start the local development environment')\n .option('-p, --port <port>', 'Port for the dev server', '3000')\n .action(async (options: { port: string }) => {\n await runProject(options);\n });\n\nprogram\n .command('deploy')\n .description('Deploy the project (coming soon)')\n .action(() => {\n console.log('Deploy command coming soon. Stay tuned!');\n });\n\nprogram.parse();\n","import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fs from 'fs-extra';\nimport { execSync } from 'node:child_process';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n/**\n * Options for the create command.\n */\nexport interface CreateOptions {\n /** The project template to use. */\n template: string;\n}\n\n/**\n * Creates a new AgentForge project from a template.\n *\n * @param projectName - The name of the project to create.\n * @param options - Options for the create command.\n */\nexport async function createProject(\n projectName: string,\n options: CreateOptions\n): Promise<void> {\n const targetDir = path.resolve(process.cwd(), projectName);\n\n // Check if directory already exists\n if (await fs.pathExists(targetDir)) {\n console.error(`Error: Directory \"${projectName}\" already exists.`);\n process.exit(1);\n }\n\n console.log(`\\n🔨 Creating AgentForge project: ${projectName}\\n`);\n\n // Resolve template directory\n const templateDir = path.resolve(\n __dirname,\n '..', // from dist/commands to dist\n 'templates',\n options.template\n );\n\n if (!(await fs.pathExists(templateDir))) {\n console.error(`Error: Template \"${options.template}\" not found.`);\n process.exit(1);\n }\n\n // Copy template to target directory\n await fs.copy(templateDir, targetDir);\n\n // Update package.json with project name\n const pkgPath = path.join(targetDir, 'package.json');\n if (await fs.pathExists(pkgPath)) {\n const pkg = await fs.readJson(pkgPath);\n pkg.name = projectName;\n await fs.writeJson(pkgPath, pkg, { spaces: 2 });\n }\n\n console.log(` ✅ Project scaffolded at ./${projectName}`);\n\n // Install dependencies\n console.log(`\\n📦 Installing dependencies...\\n`);\n try {\n execSync('pnpm install', {\n cwd: targetDir,\n stdio: 'inherit',\n });\n console.log(`\\n ✅ Dependencies installed`);\n } catch {\n console.warn(\n `\\n ⚠️ Could not install dependencies. Run \"cd ${projectName} && pnpm install\" manually.`\n );\n }\n\n console.log(`\n🎉 AgentForge project \"${projectName}\" created successfully!\n\nNext steps:\n cd ${projectName}\n agentforge run\n\nDocumentation: https://github.com/Agentic-Engineering-Agency/agentforge\n`);\n}\n","import { spawn } from 'node:child_process';\nimport path from 'node:path';\nimport fs from 'fs-extra';\n\n/**\n * Options for the run command.\n */\nexport interface RunOptions {\n /** The port for the dev server. */\n port: string;\n}\n\n/**\n * Starts the local development environment for an AgentForge project.\n *\n * This command starts the Convex development server and watches for file changes.\n *\n * @param options - Options for the run command.\n */\nexport async function runProject(options: RunOptions): Promise<void> {\n const projectDir = process.cwd();\n\n // Verify we're in an AgentForge project\n const pkgPath = path.join(projectDir, 'package.json');\n if (!(await fs.pathExists(pkgPath))) {\n console.error(\n 'Error: No package.json found. Are you in an AgentForge project directory?'\n );\n process.exit(1);\n }\n\n const convexDir = path.join(projectDir, 'convex');\n if (!(await fs.pathExists(convexDir))) {\n console.error(\n 'Error: No convex/ directory found. Are you in an AgentForge project directory?'\n );\n process.exit(1);\n }\n\n console.log(`\\n🚀 Starting AgentForge development server...\\n`);\n console.log(` Convex dev server starting on port ${options.port}...`);\n\n // Start the Convex dev server\n const convexProcess = spawn('npx', ['convex', 'dev'], {\n cwd: projectDir,\n stdio: 'inherit',\n shell: true,\n });\n\n convexProcess.on('error', (err) => {\n console.error(`Failed to start Convex dev server: ${err.message}`);\n process.exit(1);\n });\n\n convexProcess.on('close', (code) => {\n if (code !== 0) {\n console.error(`Convex dev server exited with code ${code}`);\n }\n });\n\n // Handle graceful shutdown\n const shutdown = () => {\n console.log('\\n\\n👋 Shutting down AgentForge dev server...');\n convexProcess.kill('SIGTERM');\n process.exit(0);\n };\n\n process.on('SIGINT', shutdown);\n process.on('SIGTERM', shutdown);\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;;;ACAxB,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,OAAO,QAAQ;AACf,SAAS,gBAAgB;AAEzB,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,KAAK,QAAQ,UAAU;AAgBzC,eAAsB,cACpB,aACA,SACe;AACf,QAAM,YAAY,KAAK,QAAQ,QAAQ,IAAI,GAAG,WAAW;AAGzD,MAAI,MAAM,GAAG,WAAW,SAAS,GAAG;AAClC,YAAQ,MAAM,qBAAqB,WAAW,mBAAmB;AACjE,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,UAAQ,IAAI;AAAA,yCAAqC,WAAW;AAAA,CAAI;AAGhE,QAAM,cAAc,KAAK;AAAA,IACvB;AAAA,IACA;AAAA;AAAA,IACA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M;","names":["path","fs"]}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@agentforge-ai/cli",
3
+ "version": "0.1.0",
4
+ "description": "CLI tool for creating, running, and managing AgentForge projects",
5
+ "type": "module",
6
+ "bin": {
7
+ "agentforge": "./dist/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "files": [
11
+ "dist",
12
+ "templates",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsup",
17
+ "test": "vitest run",
18
+ "test:watch": "vitest",
19
+ "typecheck": "tsc --noEmit",
20
+ "lint": "eslint src/",
21
+ "clean": "rm -rf dist"
22
+ },
23
+ "dependencies": {
24
+ "commander": "^12.0.0",
25
+ "chalk": "^5.3.0",
26
+ "fs-extra": "^11.2.0",
27
+ "ora": "^8.0.0",
28
+ "prompts": "^2.4.2"
29
+ },
30
+ "devDependencies": {
31
+ "@types/fs-extra": "^11.0.4",
32
+ "@types/prompts": "^2.4.9",
33
+ "tsup": "^8.0.0",
34
+ "typescript": "^5.5.0",
35
+ "vitest": "^2.0.0"
36
+ },
37
+ "keywords": [
38
+ "agentforge",
39
+ "cli",
40
+ "ai",
41
+ "agents",
42
+ "scaffolding"
43
+ ],
44
+ "license": "Apache-2.0",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/Agentic-Engineering-Agency/agentforge.git",
48
+ "directory": "packages/cli"
49
+ }
50
+ }
@@ -0,0 +1,8 @@
1
+ # OpenAI API Key (required for default model)
2
+ OPENAI_API_KEY=sk-your-key-here
3
+
4
+ # E2B API Key (required for sandbox execution)
5
+ E2B_API_KEY=e2b_your-key-here
6
+
7
+ # Convex deployment URL (set automatically by `npx convex dev`)
8
+ # CONVEX_URL=https://your-deployment.convex.cloud
@@ -0,0 +1,30 @@
1
+ # My AgentForge Project
2
+
3
+ Built with [AgentForge](https://github.com/Agentic-Engineering-Agency/agentforge) - The Minimalist Framework for Collaborative AI Agents.
4
+
5
+ ## Getting Started
6
+
7
+ ```bash
8
+ # Start the development server
9
+ agentforge run
10
+
11
+ # Or use pnpm directly
12
+ pnpm dev
13
+ ```
14
+
15
+ ## Project Structure
16
+
17
+ ```
18
+ ├── convex/ # Convex schema and functions
19
+ │ └── schema.ts # Database schema (agents, threads, messages)
20
+ ├── src/
21
+ │ └── agent.ts # Your agent definition
22
+ ├── package.json
23
+ └── tsconfig.json
24
+ ```
25
+
26
+ ## Learn More
27
+
28
+ - [AgentForge Documentation](https://github.com/Agentic-Engineering-Agency/agentforge)
29
+ - [Mastra Documentation](https://mastra.ai/docs)
30
+ - [Convex Documentation](https://docs.convex.dev)
@@ -0,0 +1,28 @@
1
+ import { defineSchema, defineTable } from "convex/server";
2
+ import { v } from "convex/values";
3
+
4
+ export default defineSchema({
5
+ agents: defineTable({
6
+ id: v.string(),
7
+ name: v.string(),
8
+ instructions: v.string(),
9
+ model: v.string(),
10
+ tools: v.optional(v.any()),
11
+ }).index("by_id", ["id"]),
12
+
13
+ threads: defineTable({
14
+ name: v.optional(v.string()),
15
+ }),
16
+
17
+ messages: defineTable({
18
+ threadId: v.id("threads"),
19
+ role: v.union(
20
+ v.literal("user"),
21
+ v.literal("assistant"),
22
+ v.literal("system"),
23
+ v.literal("tool")
24
+ ),
25
+ content: v.string(),
26
+ tool_calls: v.optional(v.any()),
27
+ }).index("by_thread", ["threadId"]),
28
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "my-agentforge-project",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "agentforge run",
8
+ "build": "tsc",
9
+ "convex:dev": "npx convex dev",
10
+ "convex:deploy": "npx convex deploy"
11
+ },
12
+ "dependencies": {
13
+ "@agentforge-ai/core": "^0.1.0",
14
+ "convex": "^1.17.0"
15
+ },
16
+ "devDependencies": {
17
+ "typescript": "^5.5.0"
18
+ }
19
+ }
@@ -0,0 +1,22 @@
1
+ import { Agent } from '@agentforge-ai/core';
2
+
3
+ /**
4
+ * A sample AgentForge agent.
5
+ *
6
+ * This is a starting point for your own agent. Modify the instructions,
7
+ * model, and tools to suit your needs.
8
+ */
9
+ const myAgent = new Agent({
10
+ id: 'my-first-agent',
11
+ name: 'My First Agent',
12
+ instructions: `You are a helpful AI assistant built with AgentForge.
13
+ You can help users with a variety of tasks.
14
+ Be concise, accurate, and friendly.`,
15
+ model: 'openai:gpt-4o-mini',
16
+ });
17
+
18
+ export default myAgent;
19
+
20
+ // Example usage:
21
+ // const response = await myAgent.generate('Hello, what can you do?');
22
+ // console.log(response.text);
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "lib": ["ES2022"],
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "resolveJsonModule": true,
12
+ "declaration": true,
13
+ "outDir": "./dist",
14
+ "rootDir": "./src"
15
+ },
16
+ "include": ["src/**/*.ts", "convex/**/*.ts"],
17
+ "exclude": ["node_modules", "dist"]
18
+ }