@agentforge-ai/cli 0.3.2 → 0.4.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.
@@ -1,8 +1,37 @@
1
- # OpenAI API Key (required for default model)
2
- OPENAI_API_KEY=sk-your-key-here
1
+ # ─── Convex ─────────────────────────────────────────────────────────────
2
+ # Your Convex deployment URL (set automatically by `npx convex dev`)
3
+ CONVEX_URL=
3
4
 
4
- # E2B API Key (required for sandbox execution)
5
- E2B_API_KEY=e2b_your-key-here
5
+ # ─── LLM Providers ─────────────────────────────────────────────────────
6
+ # Set the API key for your preferred provider(s).
7
+ # You only need ONE provider to get started.
6
8
 
7
- # Convex deployment URL (set automatically by `npx convex dev`)
8
- # CONVEX_URL=https://your-deployment.convex.cloud
9
+ # OpenAI (https://platform.openai.com/api-keys)
10
+ OPENAI_API_KEY=
11
+
12
+ # OpenRouter — access 100+ models with one key (https://openrouter.ai/keys)
13
+ OPENROUTER_API_KEY=
14
+
15
+ # Anthropic (https://console.anthropic.com/)
16
+ ANTHROPIC_API_KEY=
17
+
18
+ # Google Gemini (https://aistudio.google.com/apikey)
19
+ GOOGLE_API_KEY=
20
+
21
+ # xAI / Grok (https://console.x.ai/)
22
+ XAI_API_KEY=
23
+
24
+ # ─── AgentForge Defaults ───────────────────────────────────────────────
25
+ # Default provider: openai | openrouter | anthropic | google | xai
26
+ AGENTFORGE_DEFAULT_PROVIDER=openai
27
+
28
+ # Default model (provider-specific)
29
+ AGENTFORGE_DEFAULT_MODEL=gpt-4o-mini
30
+
31
+ # ─── Sandbox (Code Execution) ──────────────────────────────────────────
32
+ # E2B API key for secure code execution (https://e2b.dev/)
33
+ E2B_API_KEY=
34
+
35
+ # ─── Dashboard ──────────────────────────────────────────────────────────
36
+ # Port for the web dashboard (default: 3000)
37
+ AGENTFORGE_DASHBOARD_PORT=3000
@@ -1,30 +1,110 @@
1
1
  # My AgentForge Project
2
2
 
3
- Built with [AgentForge](https://github.com/Agentic-Engineering-Agency/agentforge) - The Minimalist Framework for Collaborative AI Agents.
3
+ Built with [AgentForge](https://github.com/Agentic-Engineering-Agency/agentforge) a NanoClaw made with Mastra.
4
4
 
5
- ## Getting Started
5
+ ## Quick Start
6
6
 
7
7
  ```bash
8
- # Start the development server
9
- agentforge run
8
+ # 1. Install dependencies
9
+ npm install
10
10
 
11
- # Or use pnpm directly
12
- pnpm dev
11
+ # 2. Set up your environment
12
+ cp .env.example .env
13
+ # Edit .env and add your API key (OpenAI, OpenRouter, Anthropic, etc.)
14
+
15
+ # 3. Start the Convex dev server
16
+ npx convex dev
17
+
18
+ # 4. Start building!
19
+ npm run dev
13
20
  ```
14
21
 
15
22
  ## Project Structure
16
23
 
17
24
  ```
18
25
  ├── convex/ # Convex schema and functions
19
- │ └── schema.ts # Database schema (agents, threads, messages)
26
+ │ └── schema.ts # Database schema (agents, threads, messages, etc.)
20
27
  ├── src/
21
28
  │ └── agent.ts # Your agent definition
29
+ ├── skills/ # Custom skills directory
30
+ ├── .env.example # Environment variable template
22
31
  ├── package.json
23
32
  └── tsconfig.json
24
33
  ```
25
34
 
35
+ ## CLI Commands
36
+
37
+ ```bash
38
+ # Agent Management
39
+ agentforge agents list # List all agents
40
+ agentforge agents create # Create a new agent (interactive)
41
+ agentforge agents inspect <id> # Show agent details
42
+ agentforge agents edit <id> # Edit an agent
43
+ agentforge agents delete <id> # Delete an agent
44
+
45
+ # Chat
46
+ agentforge chat <agent-id> # Start chatting with an agent
47
+ agentforge chat --session <id> # Resume a session
48
+
49
+ # Sessions & Threads
50
+ agentforge sessions list # List all sessions
51
+ agentforge threads list # List all threads
52
+
53
+ # Skills
54
+ agentforge skills list # List installed skills
55
+ agentforge skills install <name> # Install a skill
56
+ agentforge skills search <query> # Search available skills
57
+
58
+ # Cron Jobs
59
+ agentforge cron list # List cron jobs
60
+ agentforge cron create # Create a cron job (interactive)
61
+
62
+ # MCP Connections
63
+ agentforge mcp list # List MCP connections
64
+ agentforge mcp add # Add a connection (interactive)
65
+ agentforge mcp test <id> # Test connection health
66
+
67
+ # Files & Projects
68
+ agentforge files list # List files
69
+ agentforge files upload <path> # Upload a file
70
+ agentforge projects list # List projects
71
+ agentforge projects create <name> # Create a project
72
+
73
+ # Configuration & Vault
74
+ agentforge config list # List all config
75
+ agentforge vault list # List secrets (masked)
76
+ agentforge vault add <name> <value> # Store a secret
77
+
78
+ # Utilities
79
+ agentforge status # Show system health
80
+ agentforge logs # Tail recent logs
81
+ agentforge dashboard # Open the web dashboard
82
+ agentforge deploy # Deploy to production
83
+ ```
84
+
85
+ ## Providers
86
+
87
+ AgentForge supports multiple LLM providers. Set your preferred provider in `.env`:
88
+
89
+ | Provider | Model Format | API Key Variable |
90
+ |----------|-------------|-----------------|
91
+ | OpenAI | `openai:gpt-4o-mini` | `OPENAI_API_KEY` |
92
+ | OpenRouter | `openrouter:anthropic/claude-3.5-sonnet` | `OPENROUTER_API_KEY` |
93
+ | Anthropic | `anthropic:claude-3-5-sonnet-20241022` | `ANTHROPIC_API_KEY` |
94
+ | Google | `google:gemini-2.0-flash` | `GOOGLE_API_KEY` |
95
+ | xAI | `xai:grok-2` | `XAI_API_KEY` |
96
+
97
+ ## Web Dashboard
98
+
99
+ Launch the dashboard for a visual interface:
100
+
101
+ ```bash
102
+ agentforge dashboard
103
+ ```
104
+
26
105
  ## Learn More
27
106
 
28
107
  - [AgentForge Documentation](https://github.com/Agentic-Engineering-Agency/agentforge)
29
- - [Mastra Documentation](https://mastra.ai/docs)
30
- - [Convex Documentation](https://docs.convex.dev)
108
+ - [CLI Reference](https://github.com/Agentic-Engineering-Agency/agentforge/blob/main/docs/cli-reference.md)
109
+ - [Convex Docs](https://docs.convex.dev)
110
+ - [Mastra Docs](https://mastra.ai/docs)
@@ -1,19 +1,53 @@
1
1
  import { defineSchema, defineTable } from "convex/server";
2
2
  import { v } from "convex/values";
3
3
 
4
+ /**
5
+ * AgentForge Database Schema
6
+ *
7
+ * This schema defines all the tables needed for your AgentForge project.
8
+ * Customize it to fit your needs — add new tables, fields, or indexes.
9
+ *
10
+ * IMPORTANT: Index names cannot be "by_id" or "by_creation_time" (reserved by Convex).
11
+ * Use camelCase names like "byAgentId", "byUserId", etc.
12
+ */
4
13
  export default defineSchema({
14
+ // ─── Agent Definitions ───────────────────────────────────────────────
5
15
  agents: defineTable({
6
16
  id: v.string(),
7
17
  name: v.string(),
18
+ description: v.optional(v.string()),
8
19
  instructions: v.string(),
9
20
  model: v.string(),
21
+ provider: v.string(),
10
22
  tools: v.optional(v.any()),
11
- }).index("by_id", ["id"]),
23
+ temperature: v.optional(v.number()),
24
+ maxTokens: v.optional(v.number()),
25
+ topP: v.optional(v.number()),
26
+ isActive: v.boolean(),
27
+ createdAt: v.number(),
28
+ updatedAt: v.number(),
29
+ userId: v.optional(v.string()),
30
+ })
31
+ .index("byAgentId", ["id"])
32
+ .index("byUserId", ["userId"])
33
+ .index("byIsActive", ["isActive"]),
12
34
 
35
+ // ─── Conversation Threads ────────────────────────────────────────────
13
36
  threads: defineTable({
14
37
  name: v.optional(v.string()),
15
- }),
38
+ agentId: v.string(),
39
+ userId: v.optional(v.string()),
40
+ projectId: v.optional(v.string()),
41
+ status: v.string(),
42
+ metadata: v.optional(v.any()),
43
+ createdAt: v.number(),
44
+ updatedAt: v.number(),
45
+ })
46
+ .index("byAgentId", ["agentId"])
47
+ .index("byUserId", ["userId"])
48
+ .index("byStatus", ["status"]),
16
49
 
50
+ // ─── Messages ────────────────────────────────────────────────────────
17
51
  messages: defineTable({
18
52
  threadId: v.id("threads"),
19
53
  role: v.union(
@@ -23,6 +57,216 @@ export default defineSchema({
23
57
  v.literal("tool")
24
58
  ),
25
59
  content: v.string(),
26
- tool_calls: v.optional(v.any()),
27
- }).index("by_thread", ["threadId"]),
60
+ toolCalls: v.optional(v.any()),
61
+ toolResults: v.optional(v.any()),
62
+ tokenUsage: v.optional(v.any()),
63
+ model: v.optional(v.string()),
64
+ provider: v.optional(v.string()),
65
+ timestamp: v.number(),
66
+ })
67
+ .index("byThreadId", ["threadId"])
68
+ .index("byTimestamp", ["timestamp"]),
69
+
70
+ // ─── Sessions ────────────────────────────────────────────────────────
71
+ sessions: defineTable({
72
+ name: v.string(),
73
+ agentId: v.string(),
74
+ threadId: v.optional(v.id("threads")),
75
+ status: v.string(),
76
+ userId: v.optional(v.string()),
77
+ startedAt: v.number(),
78
+ lastActivityAt: v.number(),
79
+ metadata: v.optional(v.any()),
80
+ })
81
+ .index("byAgentId", ["agentId"])
82
+ .index("byUserId", ["userId"])
83
+ .index("byStatus", ["status"]),
84
+
85
+ // ─── Files ───────────────────────────────────────────────────────────
86
+ files: defineTable({
87
+ name: v.string(),
88
+ folderId: v.optional(v.string()),
89
+ mimeType: v.string(),
90
+ size: v.number(),
91
+ storageId: v.optional(v.string()),
92
+ url: v.optional(v.string()),
93
+ userId: v.optional(v.string()),
94
+ projectId: v.optional(v.string()),
95
+ createdAt: v.number(),
96
+ })
97
+ .index("byFolderId", ["folderId"])
98
+ .index("byUserId", ["userId"])
99
+ .index("byProjectId", ["projectId"]),
100
+
101
+ // ─── Folders ─────────────────────────────────────────────────────────
102
+ folders: defineTable({
103
+ name: v.string(),
104
+ parentId: v.optional(v.string()),
105
+ userId: v.optional(v.string()),
106
+ projectId: v.optional(v.string()),
107
+ createdAt: v.number(),
108
+ })
109
+ .index("byParentId", ["parentId"])
110
+ .index("byUserId", ["userId"]),
111
+
112
+ // ─── Projects / Workspaces ───────────────────────────────────────────
113
+ projects: defineTable({
114
+ name: v.string(),
115
+ description: v.optional(v.string()),
116
+ status: v.string(),
117
+ userId: v.optional(v.string()),
118
+ settings: v.optional(v.any()),
119
+ createdAt: v.number(),
120
+ updatedAt: v.number(),
121
+ })
122
+ .index("byUserId", ["userId"])
123
+ .index("byStatus", ["status"]),
124
+
125
+ // ─── Skills ──────────────────────────────────────────────────────────
126
+ skills: defineTable({
127
+ name: v.string(),
128
+ description: v.optional(v.string()),
129
+ category: v.string(),
130
+ version: v.string(),
131
+ isInstalled: v.boolean(),
132
+ configuration: v.optional(v.any()),
133
+ agentId: v.optional(v.string()),
134
+ userId: v.optional(v.string()),
135
+ createdAt: v.number(),
136
+ updatedAt: v.number(),
137
+ })
138
+ .index("byAgentId", ["agentId"])
139
+ .index("byCategory", ["category"])
140
+ .index("byIsInstalled", ["isInstalled"]),
141
+
142
+ // ─── Cron Jobs ───────────────────────────────────────────────────────
143
+ cronJobs: defineTable({
144
+ name: v.string(),
145
+ schedule: v.string(),
146
+ agentId: v.string(),
147
+ action: v.string(),
148
+ isEnabled: v.boolean(),
149
+ lastRunAt: v.optional(v.number()),
150
+ nextRunAt: v.optional(v.number()),
151
+ userId: v.optional(v.string()),
152
+ createdAt: v.number(),
153
+ updatedAt: v.number(),
154
+ })
155
+ .index("byAgentId", ["agentId"])
156
+ .index("byIsEnabled", ["isEnabled"])
157
+ .index("byUserId", ["userId"]),
158
+
159
+ // ─── MCP Connections ─────────────────────────────────────────────────
160
+ mcpConnections: defineTable({
161
+ name: v.string(),
162
+ type: v.string(),
163
+ endpoint: v.string(),
164
+ isConnected: v.boolean(),
165
+ isEnabled: v.boolean(),
166
+ credentials: v.optional(v.any()),
167
+ capabilities: v.optional(v.any()),
168
+ userId: v.optional(v.string()),
169
+ lastConnectedAt: v.optional(v.number()),
170
+ createdAt: v.number(),
171
+ updatedAt: v.number(),
172
+ })
173
+ .index("byUserId", ["userId"])
174
+ .index("byIsEnabled", ["isEnabled"]),
175
+
176
+ // ─── API Keys ────────────────────────────────────────────────────────
177
+ apiKeys: defineTable({
178
+ provider: v.string(),
179
+ keyName: v.string(),
180
+ encryptedKey: v.string(),
181
+ isActive: v.boolean(),
182
+ userId: v.optional(v.string()),
183
+ createdAt: v.number(),
184
+ lastUsedAt: v.optional(v.number()),
185
+ })
186
+ .index("byProvider", ["provider"])
187
+ .index("byUserId", ["userId"])
188
+ .index("byIsActive", ["isActive"]),
189
+
190
+ // ─── Usage Tracking ──────────────────────────────────────────────────
191
+ usage: defineTable({
192
+ agentId: v.string(),
193
+ sessionId: v.optional(v.string()),
194
+ provider: v.string(),
195
+ model: v.string(),
196
+ promptTokens: v.number(),
197
+ completionTokens: v.number(),
198
+ totalTokens: v.number(),
199
+ cost: v.optional(v.number()),
200
+ userId: v.optional(v.string()),
201
+ timestamp: v.number(),
202
+ })
203
+ .index("byAgentId", ["agentId"])
204
+ .index("byUserId", ["userId"])
205
+ .index("byTimestamp", ["timestamp"])
206
+ .index("byProvider", ["provider"]),
207
+
208
+ // ─── Settings ────────────────────────────────────────────────────────
209
+ settings: defineTable({
210
+ userId: v.string(),
211
+ key: v.string(),
212
+ value: v.any(),
213
+ updatedAt: v.number(),
214
+ })
215
+ .index("byUserId", ["userId"])
216
+ .index("byUserIdAndKey", ["userId", "key"]),
217
+
218
+ // ─── System Logs ─────────────────────────────────────────────────────
219
+ logs: defineTable({
220
+ level: v.union(
221
+ v.literal("debug"),
222
+ v.literal("info"),
223
+ v.literal("warn"),
224
+ v.literal("error")
225
+ ),
226
+ source: v.string(),
227
+ message: v.string(),
228
+ metadata: v.optional(v.any()),
229
+ userId: v.optional(v.string()),
230
+ timestamp: v.number(),
231
+ })
232
+ .index("byLevel", ["level"])
233
+ .index("bySource", ["source"])
234
+ .index("byTimestamp", ["timestamp"]),
235
+
236
+ // ─── Heartbeat (Task Continuation) ───────────────────────────────────
237
+ heartbeats: defineTable({
238
+ agentId: v.string(),
239
+ threadId: v.optional(v.id("threads")),
240
+ status: v.string(),
241
+ currentTask: v.optional(v.string()),
242
+ pendingTasks: v.array(v.string()),
243
+ context: v.string(),
244
+ lastCheck: v.number(),
245
+ nextCheck: v.number(),
246
+ metadata: v.optional(v.any()),
247
+ })
248
+ .index("byAgentId", ["agentId"])
249
+ .index("byStatus", ["status"])
250
+ .index("byNextCheck", ["nextCheck"]),
251
+
252
+ // ─── Secure Vault ────────────────────────────────────────────────────
253
+ vault: defineTable({
254
+ name: v.string(),
255
+ category: v.string(),
256
+ provider: v.optional(v.string()),
257
+ encryptedValue: v.string(),
258
+ iv: v.string(),
259
+ maskedValue: v.string(),
260
+ isActive: v.boolean(),
261
+ expiresAt: v.optional(v.number()),
262
+ lastAccessedAt: v.optional(v.number()),
263
+ accessCount: v.number(),
264
+ userId: v.optional(v.string()),
265
+ createdAt: v.number(),
266
+ updatedAt: v.number(),
267
+ })
268
+ .index("byUserId", ["userId"])
269
+ .index("byCategory", ["category"])
270
+ .index("byProvider", ["provider"])
271
+ .index("byIsActive", ["isActive"]),
28
272
  });
@@ -7,11 +7,13 @@
7
7
  "dev": "agentforge run",
8
8
  "build": "tsc",
9
9
  "convex:dev": "npx convex dev",
10
- "convex:deploy": "npx convex deploy"
10
+ "convex:deploy": "npx convex deploy",
11
+ "dashboard": "agentforge dashboard"
11
12
  },
12
13
  "dependencies": {
13
- "@agentforge-ai/core": "^0.3.1",
14
- "convex": "^1.17.0"
14
+ "@agentforge-ai/core": "^0.3.2",
15
+ "convex": "^1.17.0",
16
+ "zod": "^3.23.0"
15
17
  },
16
18
  "devDependencies": {
17
19
  "typescript": "^5.5.0"