overai 1.4.11 → 1.4.13

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 CHANGED
@@ -46,6 +46,30 @@ While tools like **n8n** and **Zapier** are excellent for linear automation (e.g
46
46
  npm install overai
47
47
  ```
48
48
 
49
+ ## ✨ Auto-Coder CLI (Magic Project Generator)
50
+
51
+ Want to build a project instantly? OverAI includes a powerful CLI that can scaffold entire projects (React, Node, Python, etc.) from a single prompt.
52
+
53
+ **Usage:**
54
+
55
+ ```bash
56
+ # 1. Set your API Key (OpenAI, Gemini, or Anthropic)
57
+ export OPENAI_API_KEY=sk-...
58
+ # OR
59
+ export GOOGLE_API_KEY=AIza...
60
+
61
+ # 2. Run the magic command
62
+ npx overai-create "A personal portfolio website with HTML/CSS"
63
+ ```
64
+
65
+ **Options:**
66
+
67
+ * **Auto-Detection**: The CLI automatically picks the best model based on your environment variables.
68
+ * **Force Model**: You can specify a model manually:
69
+ ```bash
70
+ npx overai-create "A snake game in Python" --model google/gemini-2.0-flash-exp
71
+ ```
72
+
49
73
  ---
50
74
 
51
75
  ## ⚡ Quick Start: Gemini Example
@@ -117,13 +117,36 @@ const rl = readline.createInterface({
117
117
  output: process.stdout
118
118
  });
119
119
  async function main() {
120
- // Check for API Key
121
- if (!process.env.OPENAI_API_KEY) {
122
- console.error("❌ Error: OPENAI_API_KEY environment variable is not set.");
123
- console.error("Please set it before running this command:");
124
- console.error(" export OPENAI_API_KEY=sk-...");
125
- process.exit(1);
120
+ // Model Selection Logic
121
+ let model = "gpt-4o";
122
+ const args = process.argv.slice(2);
123
+ const modelArgIndex = args.indexOf('--model');
124
+ // Handle --model flag
125
+ if (modelArgIndex !== -1 && args[modelArgIndex + 1]) {
126
+ model = args[modelArgIndex + 1];
127
+ args.splice(modelArgIndex, 2); // Remove flag from args so it doesn't become part of the prompt
126
128
  }
129
+ else {
130
+ // Auto-detect best available model based on env vars
131
+ if (process.env.OPENAI_API_KEY) {
132
+ model = "gpt-4o";
133
+ }
134
+ else if (process.env.GOOGLE_API_KEY) {
135
+ model = "google/gemini-2.0-flash-exp";
136
+ }
137
+ else if (process.env.ANTHROPIC_API_KEY) {
138
+ model = "anthropic/claude-3-5-sonnet-20240620";
139
+ }
140
+ else {
141
+ console.error("❌ Error: No API Key found.");
142
+ console.error("Please set ONE of the following environment variables:");
143
+ console.error(" export OPENAI_API_KEY=sk-...");
144
+ console.error(" export GOOGLE_API_KEY=AIza...");
145
+ console.error(" export ANTHROPIC_API_KEY=sk-ant-...");
146
+ process.exit(1);
147
+ }
148
+ }
149
+ console.log(`🧠 Using AI Model: \x1b[36m${model}\x1b[0m`);
127
150
  // 2. Create the "AutoCoder" Agent
128
151
  const coder = new index_1.Agent({
129
152
  name: "AutoCoder",
@@ -148,7 +171,7 @@ async function main() {
148
171
  - Be comprehensive: Include README.md, .gitignore, and config files.
149
172
  - If something fails, try to fix it or report the specific error.
150
173
  - Do not ask for permission for each step, proceed autonomously until completion.`,
151
- llm: "gpt-4o",
174
+ llm: model,
152
175
  tools: fileTools
153
176
  });
154
177
  // 3. Get User Input
@@ -158,8 +181,8 @@ async function main() {
158
181
  console.log("\n🚀 **OverAI Auto-Coder** initialized.");
159
182
  console.log("I can build any project for you (Node.js, Python, simple websites, scripts...).");
160
183
  // If argument provided via CLI, use it. Otherwise ask.
161
- let userRequest = process.argv.slice(2).join(" ");
162
- if (!userRequest) {
184
+ let userRequest = args.join(" ");
185
+ if (!userRequest.trim()) {
163
186
  userRequest = await question("\n🛠️ What project should I build for you? (e.g., 'A weather CLI in Python', 'A React Todo app'): ");
164
187
  }
165
188
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overai",
3
- "version": "1.4.11",
3
+ "version": "1.4.13",
4
4
  "description": "OverAI TypeScript AI Agents Framework - Build, Deploy, and Monetize AI Agents in Minutes",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",