genieceo 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.
Files changed (87) hide show
  1. package/DEVELOPMENT.md +240 -0
  2. package/LICENSE +21 -0
  3. package/README.md +443 -0
  4. package/config.example.json +28 -0
  5. package/dist/agent/context.d.ts +38 -0
  6. package/dist/agent/context.d.ts.map +1 -0
  7. package/dist/agent/context.js +131 -0
  8. package/dist/agent/context.js.map +1 -0
  9. package/dist/agent/index.d.ts +10 -0
  10. package/dist/agent/index.d.ts.map +1 -0
  11. package/dist/agent/index.js +54 -0
  12. package/dist/agent/index.js.map +1 -0
  13. package/dist/agent/loop.d.ts +40 -0
  14. package/dist/agent/loop.d.ts.map +1 -0
  15. package/dist/agent/loop.js +104 -0
  16. package/dist/agent/loop.js.map +1 -0
  17. package/dist/agent/subagent.d.ts +35 -0
  18. package/dist/agent/subagent.d.ts.map +1 -0
  19. package/dist/agent/subagent.js +96 -0
  20. package/dist/agent/subagent.js.map +1 -0
  21. package/dist/cli/commands/chat.d.ts +8 -0
  22. package/dist/cli/commands/chat.d.ts.map +1 -0
  23. package/dist/cli/commands/chat.js +161 -0
  24. package/dist/cli/commands/chat.js.map +1 -0
  25. package/dist/cli/commands/init.d.ts +6 -0
  26. package/dist/cli/commands/init.d.ts.map +1 -0
  27. package/dist/cli/commands/init.js +56 -0
  28. package/dist/cli/commands/init.js.map +1 -0
  29. package/dist/cli/commands/onboard.d.ts +6 -0
  30. package/dist/cli/commands/onboard.d.ts.map +1 -0
  31. package/dist/cli/commands/onboard.js +277 -0
  32. package/dist/cli/commands/onboard.js.map +1 -0
  33. package/dist/cli/commands/status.d.ts +6 -0
  34. package/dist/cli/commands/status.d.ts.map +1 -0
  35. package/dist/cli/commands/status.js +107 -0
  36. package/dist/cli/commands/status.js.map +1 -0
  37. package/dist/cli/index.d.ts +3 -0
  38. package/dist/cli/index.d.ts.map +1 -0
  39. package/dist/cli/index.js +49 -0
  40. package/dist/cli/index.js.map +1 -0
  41. package/dist/config/manager.d.ts +43 -0
  42. package/dist/config/manager.d.ts.map +1 -0
  43. package/dist/config/manager.js +147 -0
  44. package/dist/config/manager.js.map +1 -0
  45. package/dist/config/schema.d.ts +179 -0
  46. package/dist/config/schema.d.ts.map +1 -0
  47. package/dist/config/schema.js +74 -0
  48. package/dist/config/schema.js.map +1 -0
  49. package/dist/providers/llm.d.ts +46 -0
  50. package/dist/providers/llm.d.ts.map +1 -0
  51. package/dist/providers/llm.js +175 -0
  52. package/dist/providers/llm.js.map +1 -0
  53. package/dist/skills/loader.d.ts +49 -0
  54. package/dist/skills/loader.d.ts.map +1 -0
  55. package/dist/skills/loader.js +218 -0
  56. package/dist/skills/loader.js.map +1 -0
  57. package/dist/tools/base.d.ts +42 -0
  58. package/dist/tools/base.d.ts.map +1 -0
  59. package/dist/tools/base.js +90 -0
  60. package/dist/tools/base.js.map +1 -0
  61. package/dist/tools/filesystem.d.ts +17 -0
  62. package/dist/tools/filesystem.d.ts.map +1 -0
  63. package/dist/tools/filesystem.js +117 -0
  64. package/dist/tools/filesystem.js.map +1 -0
  65. package/dist/tools/shell.d.ts +8 -0
  66. package/dist/tools/shell.d.ts.map +1 -0
  67. package/dist/tools/shell.js +79 -0
  68. package/dist/tools/shell.js.map +1 -0
  69. package/dist/tools/spawn.d.ts +8 -0
  70. package/dist/tools/spawn.d.ts.map +1 -0
  71. package/dist/tools/spawn.js +23 -0
  72. package/dist/tools/spawn.js.map +1 -0
  73. package/dist/tools/web.d.ts +8 -0
  74. package/dist/tools/web.d.ts.map +1 -0
  75. package/dist/tools/web.js +194 -0
  76. package/dist/tools/web.js.map +1 -0
  77. package/dist/types/index.d.ts +51 -0
  78. package/dist/types/index.d.ts.map +1 -0
  79. package/dist/types/index.js +6 -0
  80. package/dist/types/index.js.map +1 -0
  81. package/dist/workspace/manager.d.ts +38 -0
  82. package/dist/workspace/manager.d.ts.map +1 -0
  83. package/dist/workspace/manager.js +140 -0
  84. package/dist/workspace/manager.js.map +1 -0
  85. package/docs/ONBOARDING.md +229 -0
  86. package/docs/WEB_SEARCH.md +365 -0
  87. package/package.json +38 -0
package/DEVELOPMENT.md ADDED
@@ -0,0 +1,240 @@
1
+ # Development Guide
2
+
3
+ ## Project Structure
4
+
5
+ ```
6
+ genieceo/
7
+ ├── src/
8
+ │ ├── agent/ # Agent core logic
9
+ │ │ ├── context.ts # System prompt builder
10
+ │ │ ├── index.ts # Agent initialization
11
+ │ │ ├── loop.ts # Main agent loop (Vercel AI SDK)
12
+ │ │ └── subagent.ts # Background task delegation
13
+ │ ├── cli/ # CLI interface
14
+ │ │ ├── commands/ # Command implementations
15
+ │ │ │ ├── chat.ts # Chat command (interactive/single)
16
+ │ │ │ ├── init.ts # Initialize command
17
+ │ │ │ └── status.ts # Status command
18
+ │ │ └── index.ts # CLI entry point (Commander)
19
+ │ ├── config/ # Configuration system
20
+ │ │ ├── manager.ts # Config loading/saving
21
+ │ │ └── schema.ts # Zod schemas
22
+ │ ├── providers/ # LLM providers
23
+ │ │ └── llm.ts # Vercel AI SDK wrapper
24
+ │ ├── skills/ # Skill system
25
+ │ │ ├── builtin/ # Built-in skills (markdown)
26
+ │ │ │ ├── coding/
27
+ │ │ │ ├── debugging/
28
+ │ │ │ └── planning/
29
+ │ │ └── loader.ts # Skill loading & management
30
+ │ ├── tools/ # Tool implementations
31
+ │ │ ├── base.ts # Tool registry & interface
32
+ │ │ ├── filesystem.ts # readFile, writeFile, listDir
33
+ │ │ ├── shell.ts # executeCommand (with safety)
34
+ │ │ ├── spawn.ts # spawnSubagent
35
+ │ │ └── web.ts # webSearch (multi-provider)
36
+ │ ├── types/ # TypeScript types
37
+ │ │ └── index.ts # Shared types
38
+ │ └── workspace/ # Workspace management
39
+ │ └── manager.ts # Workspace initialization
40
+ ├── package.json
41
+ ├── tsconfig.json
42
+ ├── README.md
43
+ └── LICENSE
44
+ ```
45
+
46
+ ## Code Statistics
47
+
48
+ - **Total Lines**: ~1,941 lines of TypeScript
49
+ - **Files**: 19 TypeScript files + 3 skill markdown files
50
+ - **Architecture**: Clean, modular, easy to extend
51
+
52
+ ## Building
53
+
54
+ ```bash
55
+ npm run build # Compile TypeScript to dist/
56
+ npm run dev # Watch mode for development
57
+ ```
58
+
59
+ ## Testing Locally
60
+
61
+ ```bash
62
+ # Build
63
+ npm run build
64
+
65
+ # Link for global use
66
+ npm link
67
+
68
+ # Test commands
69
+ genieceo init
70
+ genieceo status
71
+ genieceo chat -m "Hello!"
72
+ ```
73
+
74
+ ## Key Design Patterns
75
+
76
+ ### 1. Tool Registry Pattern
77
+ All tools are registered in a central registry and converted to Vercel AI SDK format:
78
+
79
+ ```typescript
80
+ const registry = new ToolRegistry();
81
+ registry.register(readFileTool);
82
+ const vercelTools = registry.toVercelTools();
83
+ ```
84
+
85
+ ### 2. Vercel AI SDK Integration
86
+ Using `generateText()` with automatic tool calling loop:
87
+
88
+ ```typescript
89
+ const result = await generateText({
90
+ model: getModel(),
91
+ messages,
92
+ tools,
93
+ maxSteps: 15 // Automatic iteration
94
+ });
95
+ ```
96
+
97
+ ### 3. Configuration with Zod
98
+ Type-safe configuration with runtime validation:
99
+
100
+ ```typescript
101
+ const ConfigSchema = z.object({
102
+ workspace: z.string(),
103
+ model: z.string(),
104
+ // ...
105
+ });
106
+ ```
107
+
108
+ ### 4. Skill System
109
+ Markdown files with YAML frontmatter:
110
+
111
+ ```markdown
112
+ ---
113
+ name: skill-name
114
+ description: What it does
115
+ ---
116
+ # Skill content
117
+ ```
118
+
119
+ ## Adding a New Tool
120
+
121
+ 1. Create tool file in `src/tools/`:
122
+
123
+ ```typescript
124
+ import { z } from 'zod';
125
+ import type { Tool } from '../types';
126
+
127
+ export const myTool: Tool = {
128
+ name: 'myTool',
129
+ description: 'What the tool does',
130
+ parameters: z.object({
131
+ param: z.string(),
132
+ }),
133
+ execute: async (params) => {
134
+ // Implementation
135
+ return { success: true };
136
+ },
137
+ };
138
+ ```
139
+
140
+ 2. Register in `src/agent/index.ts`:
141
+
142
+ ```typescript
143
+ import { myTool } from '../tools/mytool';
144
+ toolRegistry.register(myTool);
145
+ ```
146
+
147
+ ## Adding a New LLM Provider
148
+
149
+ 1. Install SDK:
150
+ ```bash
151
+ npm install @ai-sdk/anthropic
152
+ ```
153
+
154
+ 2. Update `src/providers/llm.ts`:
155
+
156
+ ```typescript
157
+ import { createAnthropic } from '@ai-sdk/anthropic';
158
+
159
+ case 'anthropic':
160
+ const anthropicProvider = createAnthropic({
161
+ apiKey: this.config.llm.anthropic.apiKey,
162
+ });
163
+ return anthropicProvider(model);
164
+ ```
165
+
166
+ 3. Update config schema in `src/config/schema.ts`
167
+
168
+ ## Adding a New Skill
169
+
170
+ Create directory in `src/skills/builtin/`:
171
+
172
+ ```
173
+ src/skills/builtin/myskill/
174
+ └── SKILL.md
175
+ ```
176
+
177
+ The skill will be automatically loaded on startup.
178
+
179
+ ## Architecture Benefits
180
+
181
+ 1. **Vercel AI SDK**: Automatic tool calling, provider-agnostic
182
+ 2. **Modular**: Each component is independent and testable
183
+ 3. **Type-safe**: TypeScript + Zod for runtime validation
184
+ 4. **Extensible**: Easy to add tools, skills, providers
185
+ 5. **Clean**: ~2000 lines vs nanobot's ~4000 lines (50% smaller!)
186
+
187
+ ## Publishing to npm
188
+
189
+ 1. Update version in `package.json`
190
+ 2. Build: `npm run build`
191
+ 3. Test: `npm link` and verify
192
+ 4. Publish: `npm publish`
193
+
194
+ ## Configuration
195
+
196
+ All configuration is managed through `~/.genieceo/config.json`. No environment variables are used.
197
+
198
+ Edit the config file directly to set:
199
+ - **llm.openai.apiKey**: OpenAI API key
200
+ - **model**: Model (e.g., "openai:gpt-4o")
201
+ - **workspace**: Workspace path
202
+ - **tools.webSearch.provider**: Search provider ("auto", "brave", "tavily", or "browser")
203
+ - **tools.webSearch.tavily.apiKey**: Tavily Search API key (optional, recommended)
204
+ - **tools.webSearch.brave.apiKey**: Brave Search API key (optional)
205
+
206
+ ## Troubleshooting
207
+
208
+ ### Build Errors
209
+ - Run `npm install` to ensure dependencies are installed
210
+ - Check TypeScript version: `npm list typescript`
211
+
212
+ ### Runtime Errors
213
+ - Verify config: `genieceo status`
214
+ - Check API keys are set
215
+ - Ensure workspace is initialized: `genieceo init`
216
+
217
+ ### Tool Errors
218
+ - Check tool parameters match Zod schema
219
+ - Verify workspace path exists
220
+ - Check shell command safety patterns
221
+
222
+ ## Contributing
223
+
224
+ 1. Fork the repository
225
+ 2. Create a feature branch: `git checkout -b feature-name`
226
+ 3. Make your changes
227
+ 4. Build and test: `npm run build && genieceo status`
228
+ 5. Commit: `git commit -m "Description"`
229
+ 6. Push: `git push origin feature-name`
230
+ 7. Create pull request
231
+
232
+ ## Philosophy
233
+
234
+ - **Simplicity over complexity**
235
+ - **Readability over cleverness**
236
+ - **Modularity over monoliths**
237
+ - **Type safety over duck typing**
238
+ - **Convention over configuration**
239
+
240
+ Keep the codebase small, clean, and understandable!
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 genieceo contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,443 @@
1
+ # genieceo 🐱
2
+
3
+ **Ultra-lightweight AI agent CLI assistant** inspired by [nanobot](https://github.com/HKUDS/nanobot)
4
+
5
+ genieceo is a powerful yet minimalist AI agent that helps you with tasks through natural language. It features a workspace for persistent memory, a skill system for specialized capabilities, and a subagent system for handling complex tasks in parallel.
6
+
7
+ ## ✨ Features
8
+
9
+ - 🪶 **Lightweight**: Clean TypeScript codebase, easy to understand and extend
10
+ - 🛠️ **Rich Toolset**: File operations, shell commands, web search, and more
11
+ - 🎯 **Skill System**: Teach the agent new capabilities through markdown files
12
+ - 🤖 **Subagents**: Delegate complex tasks to background agents
13
+ - 🔄 **Provider-Agnostic**: Uses @mariozechner/pi-ai - supports 15+ providers with automatic model discovery
14
+ - 💾 **Workspace**: Persistent workspace for files, skills, and configuration
15
+
16
+ ## 📦 Installation
17
+
18
+ ### From npm (coming soon)
19
+
20
+ ```bash
21
+ npm install -g genieceo
22
+ ```
23
+
24
+ ### From source (development)
25
+
26
+ ```bash
27
+ git clone https://github.com/yourusername/genieceo.git
28
+ cd genieceo
29
+ npm install
30
+ npm run build
31
+ npm link
32
+ ```
33
+
34
+ ## 🚀 Quick Start
35
+
36
+ ### 1. Initialize
37
+
38
+ ```bash
39
+ genieceo init
40
+ ```
41
+
42
+ This creates:
43
+ - Configuration file at `~/.genieceo/config.json`
44
+ - Workspace directory at `~/.genieceo/workspace/`
45
+
46
+ ### 2. Configure
47
+
48
+ #### Option A: Interactive Setup (Recommended)
49
+
50
+ Run the onboarding wizard to configure everything step-by-step:
51
+
52
+ ```bash
53
+ genieceo onboard
54
+ ```
55
+
56
+ The wizard will guide you through:
57
+ - **LLM Configuration**: Select provider (OpenAI, Anthropic, etc.) and enter API key
58
+ - **Model Selection**: Choose from available models for your provider
59
+ - **Health Check**: Verify your LLM setup is working correctly
60
+ - **Web Search**: Configure search providers (Tavily, Brave, or browser-based)
61
+
62
+ #### Option B: Manual Configuration
63
+
64
+ Edit `~/.genieceo/config.json` to add your API keys:
65
+
66
+ ```json
67
+ {
68
+ "workspace": "~/.genieceo/workspace",
69
+ "model": "openai:gpt-4o",
70
+ "maxIterations": 15,
71
+ "llm": {
72
+ "openai": {
73
+ "apiKey": "sk-..."
74
+ }
75
+ },
76
+ "tools": {
77
+ "webSearch": {
78
+ "provider": "auto",
79
+ "tavily": {
80
+ "apiKey": "tvly-..."
81
+ },
82
+ "brave": {
83
+ "apiKey": "BSA..."
84
+ }
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ **Note:** Web search will work even without API keys by using the browser fallback. However, for better results, configure at least one search provider (Tavily or Brave).
91
+
92
+ ### 3. Chat!
93
+
94
+ **Single message:**
95
+ ```bash
96
+ genieceo chat -m "What is 2+2?"
97
+ ```
98
+
99
+ **Interactive mode:**
100
+ ```bash
101
+ genieceo chat
102
+ ```
103
+
104
+ ## 🛠️ Available Tools
105
+
106
+ genieceo comes with powerful built-in tools:
107
+
108
+ ### File Operations
109
+ - **readFile**: Read file contents
110
+ - **writeFile**: Create or overwrite files
111
+ - **listDir**: List directory contents
112
+
113
+ ### Shell
114
+ - **executeCommand**: Run shell commands (with safety checks)
115
+
116
+ ### Web
117
+ - **webSearch**: Search the web using multiple providers (Tavily, Brave, or browser fallback)
118
+
119
+ ### Subagents
120
+ - **spawnSubagent**: Create background agents for complex tasks
121
+
122
+ ## 🎯 Skills
123
+
124
+ Skills teach the agent how to handle specialized tasks. Built-in skills:
125
+
126
+ - **planning**: Break down complex tasks systematically
127
+ - **debugging**: Debug code and systems methodically
128
+ - **coding**: Best practices for writing quality code
129
+
130
+ ### Adding Custom Skills
131
+
132
+ Create a skill in `~/.genieceo/workspace/skills/`:
133
+
134
+ ```
135
+ ~/.genieceo/workspace/skills/
136
+ └── myskill/
137
+ └── SKILL.md
138
+ ```
139
+
140
+ **SKILL.md format:**
141
+ ```markdown
142
+ ---
143
+ name: myskill
144
+ description: What this skill does
145
+ metadata:
146
+ always: false
147
+ requires:
148
+ bins: []
149
+ config: []
150
+ ---
151
+
152
+ # My Skill
153
+
154
+ Detailed instructions for the agent on how to use this skill...
155
+ ```
156
+
157
+ The `requires.config` field specifies config paths that must be set (e.g., `["llm.openai.apiKey", "tools.webSearch.apiKey"]`).
158
+
159
+ ## 🔧 Configuration
160
+
161
+ Configuration file: `~/.genieceo/config.json`
162
+
163
+ All configuration is managed through this file. No environment variables are used.
164
+
165
+ ```json
166
+ {
167
+ "workspace": "~/.genieceo/workspace",
168
+ "model": "openai:gpt-4o",
169
+ "maxIterations": 15,
170
+ "llm": {
171
+ "openai": {
172
+ "apiKey": "sk-..."
173
+ }
174
+ },
175
+ "tools": {
176
+ "webSearch": {
177
+ "provider": "auto",
178
+ "tavily": {
179
+ "apiKey": "tvly-..."
180
+ },
181
+ "brave": {
182
+ "apiKey": "BSA..."
183
+ }
184
+ },
185
+ "shell": {
186
+ "timeout": 30000,
187
+ "allowDangerous": false
188
+ }
189
+ }
190
+ }
191
+ ```
192
+
193
+ ### Configuration Options
194
+
195
+ #### Core Settings
196
+ - **workspace**: Directory for agent files and skills (default: `~/.genieceo/workspace`)
197
+ - **model**: LLM model in format `provider:model` (e.g., `openai:gpt-4o`)
198
+ - **maxIterations**: Maximum agent loop iterations (default: 15)
199
+
200
+ #### LLM Configuration
201
+ - **llm.openai.apiKey**: OpenAI API key (required)
202
+
203
+ #### Web Search Configuration
204
+ - **tools.webSearch.provider**: Search provider to use (options: `auto`, `brave`, `tavily`, `browser`)
205
+ - `auto` (default): Tries providers in order (Tavily → Brave → Browser)
206
+ - `brave`: Use Brave Search API only
207
+ - `tavily`: Use Tavily Search API only
208
+ - `browser`: Use browser-based fallback only (free, no API key needed)
209
+ - **tools.webSearch.tavily.apiKey**: Tavily API key (optional but recommended)
210
+ - Get your free API key at [tavily.com](https://tavily.com)
211
+ - Free tier: 1,000 searches/month
212
+ - Recommended for best search quality
213
+ - **tools.webSearch.brave.apiKey**: Brave Search API key (optional)
214
+ - Note: Brave now requires payment
215
+ - Get API key at [brave.com/search/api](https://brave.com/search/api)
216
+
217
+ **Browser Fallback**: If no API keys are configured, web search automatically uses a browser-based fallback (DuckDuckGo HTML). This works out-of-the-box with no configuration needed.
218
+
219
+ #### Shell Configuration
220
+ - **shell.timeout**: Command timeout in milliseconds (default: 30000)
221
+ - **shell.allowDangerous**: Allow dangerous commands (default: false)
222
+
223
+ ## 🔍 Web Search
224
+
225
+ genieceo supports multiple web search providers with automatic fallback:
226
+
227
+ ### Search Providers
228
+
229
+ 1. **Tavily** (Recommended)
230
+ - High-quality search results optimized for AI agents
231
+ - Free tier: 1,000 searches/month
232
+ - Get API key: [tavily.com](https://tavily.com)
233
+ - Config: `tools.webSearch.tavily.apiKey`
234
+
235
+ 2. **Brave Search**
236
+ - Premium search API (now requires payment)
237
+ - Get API key: [brave.com/search/api](https://brave.com/search/api)
238
+ - Config: `tools.webSearch.brave.apiKey`
239
+
240
+ 3. **Browser Fallback** (Always Available)
241
+ - Free, no API key required
242
+ - Uses DuckDuckGo HTML search
243
+ - Automatically used when no API keys configured
244
+ - Good enough for most use cases
245
+
246
+ ### Configuration Examples
247
+
248
+ **Auto mode** (tries providers in order):
249
+ ```json
250
+ {
251
+ "tools": {
252
+ "webSearch": {
253
+ "provider": "auto",
254
+ "tavily": { "apiKey": "tvly-..." }
255
+ }
256
+ }
257
+ }
258
+ ```
259
+
260
+ **Specific provider**:
261
+ ```json
262
+ {
263
+ "tools": {
264
+ "webSearch": {
265
+ "provider": "tavily",
266
+ "tavily": { "apiKey": "tvly-..." }
267
+ }
268
+ }
269
+ }
270
+ ```
271
+
272
+ **Browser-only** (no API key needed):
273
+ ```json
274
+ {
275
+ "tools": {
276
+ "webSearch": {
277
+ "provider": "browser"
278
+ }
279
+ }
280
+ }
281
+ ```
282
+
283
+ **Note**: The config format shown above is the current format. If you're using an older development version with `tools.webSearch.apiKey`, update to the new nested format shown in the examples.
284
+
285
+ ## 🤖 Using Subagents
286
+
287
+ Subagents run in the background and handle tasks independently:
288
+
289
+ ```bash
290
+ genieceo chat -m "Spawn a subagent to research the history of AI, while you create a summary document"
291
+ ```
292
+
293
+ The agent will:
294
+ 1. Spawn a background subagent for research
295
+ 2. Continue with creating the summary
296
+ 3. Integrate the research results when the subagent completes
297
+
298
+ ## 📚 Examples
299
+
300
+ ### File Operations
301
+
302
+ ```bash
303
+ genieceo chat -m "Create a hello.txt file with 'Hello, World!'"
304
+ ```
305
+
306
+ ### Web Search
307
+
308
+ ```bash
309
+ genieceo chat -m "Search for the latest TypeScript features and summarize them"
310
+ ```
311
+
312
+ ### Shell Commands
313
+
314
+ ```bash
315
+ genieceo chat -m "List all JavaScript files in the current directory"
316
+ ```
317
+
318
+ ### Complex Task with Subagents
319
+
320
+ ```bash
321
+ genieceo chat -m "Create a Node.js web server with Express. Spawn subagents to create routes, middleware, and tests in parallel"
322
+ ```
323
+
324
+ ## 🎨 CLI Commands
325
+
326
+ ### `genieceo init`
327
+ Initialize workspace and configuration
328
+
329
+ ### `genieceo onboard`
330
+ Interactive setup wizard for configuring LLM and web search
331
+
332
+ This command guides you through:
333
+ - **LLM Provider Selection**: Choose from available providers (OpenAI, Anthropic, Google, etc.)
334
+ - **API Key Configuration**: Enter your API keys securely
335
+ - **Model Selection**: Pick from available models for your provider
336
+ - **Health Check**: Test your LLM configuration with a real API call
337
+ - **Web Search Setup**: Configure search providers (Tavily, Brave, or browser-based)
338
+
339
+ Example:
340
+ ```bash
341
+ genieceo onboard
342
+ ```
343
+
344
+ ### `genieceo chat`
345
+ Start interactive chat mode
346
+
347
+ **Options:**
348
+ - `-m, --message <text>` - Send single message instead of interactive mode
349
+
350
+ ### `genieceo status`
351
+ Show configuration and workspace status
352
+
353
+ ## 🏗️ Architecture
354
+
355
+ ```
356
+ genieceo/
357
+ ├── src/
358
+ │ ├── cli/ # CLI interface
359
+ │ ├── agent/ # Agent loop, context, subagents
360
+ │ ├── tools/ # Tool implementations
361
+ │ ├── skills/ # Skill system & built-in skills
362
+ │ ├── workspace/ # Workspace management
363
+ │ ├── config/ # Configuration system
364
+ │ └── providers/ # LLM provider (@mariozechner/pi-ai)
365
+ ```
366
+
367
+ ## 🔄 Switching LLM Providers
368
+
369
+ genieceo uses @mariozechner/pi-ai, which provides:
370
+ - **Automatic model discovery** - no hardcoded model lists
371
+ - **15+ providers** - OpenAI, Anthropic, Google, Azure, Bedrock, Mistral, Groq, xAI, OpenRouter, and more
372
+ - **Cross-provider handoffs** - switch models mid-conversation
373
+ - **Unified interface** - same API for all providers
374
+
375
+ ### Available Providers
376
+
377
+ To see all available providers and their models:
378
+
379
+ ```bash
380
+ # The library automatically discovers all available models at runtime
381
+ # Simply configure your provider and model in config.json
382
+ ```
383
+
384
+ To use a different provider, simply update your config:
385
+
386
+ ```json
387
+ {
388
+ "model": "anthropic:claude-3-5-sonnet-20241022",
389
+ "llm": {
390
+ "anthropic": {
391
+ "apiKey": "sk-ant-..."
392
+ }
393
+ }
394
+ }
395
+ ```
396
+
397
+ **Supported providers (examples):**
398
+ - **OpenAI**: `openai:gpt-4o`, `openai:gpt-4o-mini`, `openai:o1`
399
+ - **Anthropic**: `anthropic:claude-3-5-sonnet-20241022`, `anthropic:claude-3-5-haiku-20241022`
400
+ - **Google**: `google:gemini-2.0-flash-exp`, `google:gemini-1.5-pro`
401
+ - **Mistral**: `mistral:mistral-large-latest`, `mistral:mistral-small-latest`
402
+ - **Groq**: `groq:llama-3.3-70b-versatile`, `groq:mixtral-8x7b-32768`
403
+ - **xAI**: `xai:grok-beta`
404
+ - **OpenRouter**: `openrouter:anthropic/claude-3.5-sonnet`
405
+ - **Azure OpenAI**: Configure via environment variables
406
+ - **Amazon Bedrock**: `bedrock:anthropic.claude-3-5-sonnet-20241022-v2:0`
407
+ - **Cerebras**: `cerebras:llama3.3-70b`
408
+ - **And 15+ more!**
409
+
410
+ The model list is automatically discovered from each provider's API, so you always have access to the latest models without updating genieceo.
411
+
412
+ ## 🛡️ Safety
413
+
414
+ - **Command blocking**: Dangerous commands (rm -rf, format, etc.) are blocked by default
415
+ - **Workspace isolation**: Agent works in `~/.genieceo/workspace/files/` by default
416
+ - **Timeout limits**: Commands have 30s timeout (configurable)
417
+ - **API key security**: Keys stored in config file with restricted permissions
418
+
419
+ ## 🤝 Contributing
420
+
421
+ Contributions welcome! The codebase is intentionally small and readable.
422
+
423
+ 1. Fork the repository
424
+ 2. Create a feature branch
425
+ 3. Make your changes
426
+ 4. Submit a pull request
427
+
428
+ ## 📝 License
429
+
430
+ MIT License - see LICENSE file for details
431
+
432
+ ## 🙏 Acknowledgments
433
+
434
+ Inspired by [nanobot](https://github.com/HKUDS/nanobot) - the ultra-lightweight Clawdbot alternative
435
+
436
+ ## 📞 Support
437
+
438
+ - Issues: [GitHub Issues](https://github.com/yourusername/genieceo/issues)
439
+ - Discussions: [GitHub Discussions](https://github.com/yourusername/genieceo/discussions)
440
+
441
+ ---
442
+
443
+ Made with ❤️ for developers who want a lightweight, extensible AI agent