@defai.digital/automatosx 12.8.7 → 13.1.2
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/LICENSE +1 -1
- package/dist/bin.d.ts +8 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +16 -0
- package/dist/bin.js.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -74239
- package/dist/index.js.map +1 -0
- package/package.json +35 -160
- package/.github/assets/ax-cli.png +0 -0
- package/.github/assets/axlogo.png +0 -0
- package/CHANGELOG.md +0 -81
- package/README.md +0 -790
- package/SECURITY.md +0 -173
- package/dist/mcp/index.d.ts +0 -2
- package/dist/mcp/index.js +0 -43627
- package/examples/AGENTS_INFO.md +0 -187
- package/examples/README.md +0 -434
- package/examples/abilities/accessibility.md +0 -115
- package/examples/abilities/api-design.md +0 -168
- package/examples/abilities/best-practices.md +0 -102
- package/examples/abilities/caching-strategy.md +0 -165
- package/examples/abilities/ci-cd.md +0 -61
- package/examples/abilities/clean-code.md +0 -398
- package/examples/abilities/code-generation.md +0 -333
- package/examples/abilities/code-review.md +0 -51
- package/examples/abilities/component-architecture.md +0 -112
- package/examples/abilities/content-creation.md +0 -97
- package/examples/abilities/data-modeling.md +0 -171
- package/examples/abilities/data-validation.md +0 -50
- package/examples/abilities/db-modeling.md +0 -167
- package/examples/abilities/debugging.md +0 -52
- package/examples/abilities/design-patterns.md +0 -437
- package/examples/abilities/design-system-implementation.md +0 -126
- package/examples/abilities/documentation.md +0 -54
- package/examples/abilities/etl-pipelines.md +0 -44
- package/examples/abilities/feasibility-study.md +0 -20
- package/examples/abilities/general-assistance.md +0 -26
- package/examples/abilities/idea-evaluation.md +0 -21
- package/examples/abilities/infra-as-code.md +0 -57
- package/examples/abilities/job-orchestration.md +0 -44
- package/examples/abilities/literature-review.md +0 -19
- package/examples/abilities/longform-report.md +0 -25
- package/examples/abilities/mathematical-reasoning.md +0 -170
- package/examples/abilities/observability.md +0 -61
- package/examples/abilities/orbital-mechanics.md +0 -50
- package/examples/abilities/our-architecture-decisions.md +0 -180
- package/examples/abilities/our-code-review-checklist.md +0 -149
- package/examples/abilities/our-coding-standards.md +0 -369
- package/examples/abilities/our-project-structure.md +0 -183
- package/examples/abilities/performance.md +0 -89
- package/examples/abilities/problem-solving.md +0 -50
- package/examples/abilities/propulsion-systems.md +0 -50
- package/examples/abilities/quantum-algorithm-design.md +0 -54
- package/examples/abilities/quantum-error-correction.md +0 -56
- package/examples/abilities/quantum-frameworks-transpilation.md +0 -53
- package/examples/abilities/quantum-noise-modeling.md +0 -58
- package/examples/abilities/refactoring.md +0 -223
- package/examples/abilities/release-strategy.md +0 -58
- package/examples/abilities/secrets-policy.md +0 -61
- package/examples/abilities/secure-coding-review.md +0 -60
- package/examples/abilities/software-architecture.md +0 -394
- package/examples/abilities/solid-principles.md +0 -341
- package/examples/abilities/sql-optimization.md +0 -84
- package/examples/abilities/state-management.md +0 -96
- package/examples/abilities/task-planning.md +0 -65
- package/examples/abilities/technical-writing.md +0 -77
- package/examples/abilities/telemetry-diagnostics.md +0 -51
- package/examples/abilities/testing.md +0 -56
- package/examples/abilities/threat-modeling.md +0 -58
- package/examples/abilities/troubleshooting.md +0 -80
- package/examples/abilities/typescript-zod-validation.md +0 -830
- package/examples/agents/AGENTS_INTEGRATION.md +0 -99
- package/examples/agents/aerospace-scientist.yaml +0 -159
- package/examples/agents/architecture.yaml +0 -244
- package/examples/agents/automatosx.config.json +0 -286
- package/examples/agents/backend.yaml +0 -141
- package/examples/agents/ceo.yaml +0 -105
- package/examples/agents/creative-marketer.yaml +0 -173
- package/examples/agents/cto.yaml +0 -118
- package/examples/agents/data-scientist.yaml +0 -200
- package/examples/agents/data.yaml +0 -106
- package/examples/agents/design.yaml +0 -115
- package/examples/agents/devops.yaml +0 -124
- package/examples/agents/frontend.yaml +0 -171
- package/examples/agents/fullstack.yaml +0 -172
- package/examples/agents/mobile.yaml +0 -185
- package/examples/agents/product.yaml +0 -103
- package/examples/agents/quality.yaml +0 -117
- package/examples/agents/quantum-engineer.yaml +0 -166
- package/examples/agents/researcher.yaml +0 -122
- package/examples/agents/security.yaml +0 -115
- package/examples/agents/standard.yaml +0 -214
- package/examples/agents/writer.yaml +0 -122
- package/examples/providers/README.md +0 -117
- package/examples/providers/claude/CLAUDE_INTEGRATION.md +0 -302
- package/examples/providers/claude/mcp/automatosx.json +0 -244
- package/examples/providers/codex/CODEX_INTEGRATION.md +0 -593
- package/examples/providers/codex/README.md +0 -349
- package/examples/providers/codex/usage-examples.ts +0 -421
- package/examples/providers/gemini/GEMINI_INTEGRATION.md +0 -236
- package/examples/providers/gemini/README.md +0 -76
- package/examples/providers/openai-codex-example.ts +0 -421
- package/examples/pytorch_resnet50_training.py +0 -289
- package/examples/specs/automatosx-release.ax.yaml +0 -380
- package/examples/specs/enterprise.ax.yaml +0 -121
- package/examples/specs/enterprise.yaml.mustache +0 -121
- package/examples/specs/government.ax.yaml +0 -148
- package/examples/specs/government.yaml.mustache +0 -148
- package/examples/specs/minimal.ax.yaml +0 -21
- package/examples/specs/minimal.yaml.mustache +0 -21
- package/examples/teams/business.yaml +0 -56
- package/examples/teams/core.yaml +0 -60
- package/examples/teams/design.yaml +0 -58
- package/examples/teams/engineering.yaml +0 -69
- package/examples/teams/research.yaml +0 -56
- package/examples/use-cases/01-web-app-development.md +0 -374
- package/examples/workflows/analyst.yaml +0 -60
- package/examples/workflows/assistant.yaml +0 -48
- package/examples/workflows/basic-agent.yaml +0 -28
- package/examples/workflows/code-reviewer.yaml +0 -52
- package/examples/workflows/debugger.yaml +0 -63
- package/examples/workflows/designer.yaml +0 -69
- package/examples/workflows/developer.yaml +0 -60
- package/examples/workflows/fullstack-developer.yaml +0 -395
- package/examples/workflows/qa-specialist.yaml +0 -71
- package/schema/ability-metadata.json +0 -21
- package/schema/config.json +0 -703
- package/schema/spec-schema.json +0 -608
|
@@ -1,593 +0,0 @@
|
|
|
1
|
-
# AutomatosX Integration with Codex CLI
|
|
2
|
-
|
|
3
|
-
**IMPORTANT**: For the complete AutomatosX integration guide, **please read [AX-Integration.md](../AX-Integration.md)**.
|
|
4
|
-
|
|
5
|
-
This file provides **Codex-specific** setup instructions and configuration details. For comprehensive AutomatosX documentation including all agents, commands, memory features, workflows, and troubleshooting, see [AX-Integration.md](../AX-Integration.md).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
This project uses [AutomatosX](https://github.com/defai-digital/automatosx) with Codex CLI CLI as a provider for AI-powered agent orchestration.
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
**Codex CLI** is configured as a **provider** in AutomatosX, meaning:
|
|
14
|
-
- AutomatosX uses Codex CLI to power AI agent responses
|
|
15
|
-
- You interact with AutomatosX using `ax` terminal commands
|
|
16
|
-
- Codex runs in the background as the AI engine
|
|
17
|
-
- Git repository is required (Codex CLI requirement)
|
|
18
|
-
|
|
19
|
-
**Architecture**:
|
|
20
|
-
```
|
|
21
|
-
User → ax CLI → AutomatosX → Codex CLI (provider) → OpenAI API
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Quick Start
|
|
25
|
-
|
|
26
|
-
### Prerequisites
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# 1. Install Codex CLI
|
|
30
|
-
npm install -g @openai/codex-cli
|
|
31
|
-
|
|
32
|
-
# 2. Verify installation
|
|
33
|
-
codex --version # Should show: codex-cli 0.50.0+
|
|
34
|
-
|
|
35
|
-
# 3. Authenticate (if needed)
|
|
36
|
-
codex login
|
|
37
|
-
|
|
38
|
-
# 4. Initialize git repository (required by Codex)
|
|
39
|
-
git init # Already done by `ax setup`
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### Using AutomatosX with Codex
|
|
43
|
-
|
|
44
|
-
**Primary Usage**: Terminal CLI (`ax` commands)
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
# Run an agent with a task
|
|
48
|
-
ax run backend "create a REST API for user management"
|
|
49
|
-
|
|
50
|
-
# List available agents
|
|
51
|
-
ax list agents
|
|
52
|
-
|
|
53
|
-
# Search memory for past conversations
|
|
54
|
-
ax memory search "authentication"
|
|
55
|
-
|
|
56
|
-
# Check system status
|
|
57
|
-
ax status
|
|
58
|
-
|
|
59
|
-
# Check provider status
|
|
60
|
-
ax provider-limits
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**Provider Priority**: Codex is configured with priority 1 (highest) in `ax.config.json`
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"providers": {
|
|
68
|
-
"openai": {
|
|
69
|
-
"enabled": true,
|
|
70
|
-
"priority": 1, // Highest priority
|
|
71
|
-
"command": "codex", // Uses Codex CLI
|
|
72
|
-
"timeout": 2700000
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Provider Configuration
|
|
79
|
-
|
|
80
|
-
### Configuration File
|
|
81
|
-
|
|
82
|
-
Edit `ax.config.json` to customize Codex provider settings:
|
|
83
|
-
|
|
84
|
-
```json
|
|
85
|
-
{
|
|
86
|
-
"providers": {
|
|
87
|
-
"openai": {
|
|
88
|
-
"enabled": true,
|
|
89
|
-
"priority": 1,
|
|
90
|
-
"timeout": 2700000,
|
|
91
|
-
"command": "codex",
|
|
92
|
-
"mcp": {
|
|
93
|
-
"enabled": false,
|
|
94
|
-
"command": "codex",
|
|
95
|
-
"transport": "stdio",
|
|
96
|
-
"autoStart": false
|
|
97
|
-
},
|
|
98
|
-
"healthCheck": {
|
|
99
|
-
"enabled": true,
|
|
100
|
-
"interval": 300000,
|
|
101
|
-
"timeout": 5000
|
|
102
|
-
},
|
|
103
|
-
"circuitBreaker": {
|
|
104
|
-
"enabled": true,
|
|
105
|
-
"failureThreshold": 3,
|
|
106
|
-
"recoveryTimeout": 60000
|
|
107
|
-
},
|
|
108
|
-
"limitTracking": {
|
|
109
|
-
"enabled": true,
|
|
110
|
-
"window": "daily",
|
|
111
|
-
"resetHourUtc": 0
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Provider Features
|
|
119
|
-
|
|
120
|
-
| Feature | Supported | Notes |
|
|
121
|
-
|---------|-----------|-------|
|
|
122
|
-
| **Basic Execution** | ✅ | `codex exec` command |
|
|
123
|
-
| **Streaming Output** | ✅ | Real-time responses |
|
|
124
|
-
| **MCP Server Mode** | ✅ | Experimental, use `codex mcp-server` |
|
|
125
|
-
| **Sandbox Modes** | ✅ | `workspace-write`, `full`, `none` |
|
|
126
|
-
| **Git Integration** | ✅ Required | Codex requires git repository |
|
|
127
|
-
| **Health Checks** | ✅ | Automatic provider health monitoring |
|
|
128
|
-
| **Circuit Breaker** | ✅ | Auto-failover on repeated failures |
|
|
129
|
-
| **Limit Tracking** | ✅ | Daily quota tracking |
|
|
130
|
-
|
|
131
|
-
## Available Agents
|
|
132
|
-
|
|
133
|
-
This project includes 20 specialized agents that work with Codex:
|
|
134
|
-
|
|
135
|
-
- **backend** (Bob) - Backend development (Go/Rust systems)
|
|
136
|
-
- **frontend** (Frank) - Frontend development (React/Next.js/Swift)
|
|
137
|
-
- **architecture** (Avery) - System architecture and ADR management
|
|
138
|
-
- **fullstack** (Felix) - Full-stack development (Node.js/TypeScript)
|
|
139
|
-
- **mobile** (Maya) - Mobile development (iOS/Android, Swift/Kotlin/Flutter)
|
|
140
|
-
- **devops** (Oliver) - DevOps and infrastructure
|
|
141
|
-
- **security** (Steve) - Security auditing and threat modeling
|
|
142
|
-
- **data** (Daisy) - Data engineering and ETL
|
|
143
|
-
- **quality** (Queenie) - QA and testing
|
|
144
|
-
- **design** (Debbee) - UX/UI design
|
|
145
|
-
- **writer** (Wendy) - Technical writing
|
|
146
|
-
- **product** (Paris) - Product management
|
|
147
|
-
- **cto** (Tony) - Technical strategy
|
|
148
|
-
- **ceo** (Eric) - Business leadership
|
|
149
|
-
- **researcher** (Rodman) - Research and analysis
|
|
150
|
-
- **data-scientist** (Dana) - Machine learning and data science
|
|
151
|
-
- **aerospace-scientist** (Astrid) - Aerospace engineering and mission design
|
|
152
|
-
- **quantum-engineer** (Quinn) - Quantum computing and algorithms
|
|
153
|
-
- **creative-marketer** (Candy) - Creative marketing and content strategy
|
|
154
|
-
- **standard** (Stan) - Software standards and best practices
|
|
155
|
-
|
|
156
|
-
For a complete list with capabilities, run: `ax list agents --format json`
|
|
157
|
-
|
|
158
|
-
## Key Features
|
|
159
|
-
|
|
160
|
-
### 1. Persistent Memory
|
|
161
|
-
|
|
162
|
-
AutomatosX agents remember all previous conversations and decisions:
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
# First task - design is saved to memory
|
|
166
|
-
ax run product "Design a calculator with add/subtract features"
|
|
167
|
-
|
|
168
|
-
# Later task - automatically retrieves the design from memory
|
|
169
|
-
ax run backend "Implement the calculator API"
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### 2. Multi-Agent Collaboration
|
|
173
|
-
|
|
174
|
-
Agents can delegate tasks to each other automatically:
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
ax run product "Build a complete user authentication feature"
|
|
178
|
-
# → Product agent designs the system
|
|
179
|
-
# → Automatically delegates implementation to backend agent
|
|
180
|
-
# → Automatically delegates security audit to security agent
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### 3. Cross-Provider Support
|
|
184
|
-
|
|
185
|
-
AutomatosX supports multiple AI providers with automatic fallback:
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
$ ax run backend "implement authentication API"
|
|
189
|
-
⚠️ Switched from openai → gemini-cli
|
|
190
|
-
(OpenAI daily quota hit, resets at 2025-10-29 00:00 UTC)
|
|
191
|
-
|
|
192
|
-
✓ Task completed successfully with gemini-cli
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
**Provider Priority** (configured in `ax.config.json`):
|
|
196
|
-
1. **Codex CLI** (priority: 1) - Primary
|
|
197
|
-
2. **Gemini CLI** (priority: 2) - First fallback
|
|
198
|
-
3. **Claude Code** (priority: 3) - Second fallback
|
|
199
|
-
|
|
200
|
-
Check provider status:
|
|
201
|
-
```bash
|
|
202
|
-
$ ax provider-limits
|
|
203
|
-
📊 Provider Limits Status
|
|
204
|
-
|
|
205
|
-
⚠️ openai:
|
|
206
|
-
Status: limited
|
|
207
|
-
Window: daily
|
|
208
|
-
Resets: 2025-10-29 00:00:00 (6h)
|
|
209
|
-
|
|
210
|
-
✓ gemini-cli:
|
|
211
|
-
Status: available
|
|
212
|
-
Window: daily
|
|
213
|
-
|
|
214
|
-
✓ claude-code:
|
|
215
|
-
Status: available
|
|
216
|
-
Window: weekly
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### 4. Workspace Conventions
|
|
220
|
-
|
|
221
|
-
AutomatosX uses specific directories for organized file management:
|
|
222
|
-
|
|
223
|
-
- **`automatosx/PRD/`** - Product Requirements Documents, design specs, planning documents
|
|
224
|
-
- Use for: Architecture designs, feature specs, technical requirements
|
|
225
|
-
- Example: `automatosx/PRD/auth-system-design.md`
|
|
226
|
-
|
|
227
|
-
- **`automatosx/tmp/`** - Temporary files, scratch work, and intermediate outputs
|
|
228
|
-
- Use for: Draft code, test outputs, temporary analysis
|
|
229
|
-
- Auto-cleaned periodically
|
|
230
|
-
- Example: `automatosx/tmp/draft-api-endpoints.ts`
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
# Save architecture design
|
|
234
|
-
ax run product "Save the authentication architecture design to automatosx/PRD/auth-design.md"
|
|
235
|
-
|
|
236
|
-
# Create draft implementation
|
|
237
|
-
ax run backend "Put the draft API implementation in automatosx/tmp/auth-api-draft.ts for review"
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
These directories are automatically created by `ax setup` and included in `.gitignore` appropriately.
|
|
241
|
-
|
|
242
|
-
## Advanced Usage
|
|
243
|
-
|
|
244
|
-
### MCP Server Mode (Experimental)
|
|
245
|
-
|
|
246
|
-
Codex CLI can run as an MCP (Model Context Protocol) server:
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
# Start Codex as MCP server
|
|
250
|
-
codex mcp-server
|
|
251
|
-
|
|
252
|
-
# Or configure in ax.config.json
|
|
253
|
-
{
|
|
254
|
-
"providers": {
|
|
255
|
-
"openai": {
|
|
256
|
-
"mcp": {
|
|
257
|
-
"enabled": true,
|
|
258
|
-
"command": "codex",
|
|
259
|
-
"transport": "stdio",
|
|
260
|
-
"autoStart": true
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
See `examples/codex/usage-examples.ts` for MCP integration code examples.
|
|
268
|
-
|
|
269
|
-
### Parallel Execution
|
|
270
|
-
|
|
271
|
-
Run multiple agents in parallel for faster workflows:
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
ax run product "Design authentication system" --parallel
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### Resumable Runs
|
|
278
|
-
|
|
279
|
-
For long-running tasks, enable checkpoints:
|
|
280
|
-
|
|
281
|
-
```bash
|
|
282
|
-
ax run backend "Refactor entire codebase" --resumable
|
|
283
|
-
|
|
284
|
-
# If interrupted, resume with:
|
|
285
|
-
ax resume <run-id>
|
|
286
|
-
|
|
287
|
-
# List all runs
|
|
288
|
-
ax runs list
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
### Streaming Output
|
|
292
|
-
|
|
293
|
-
See real-time output from Codex:
|
|
294
|
-
|
|
295
|
-
```bash
|
|
296
|
-
ax run backend "Explain this codebase" --streaming
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Spec-Driven Development
|
|
300
|
-
|
|
301
|
-
For complex projects, use spec-driven workflows:
|
|
302
|
-
|
|
303
|
-
```bash
|
|
304
|
-
# Create spec from natural language
|
|
305
|
-
ax spec create "Build authentication with database, API, JWT, and tests"
|
|
306
|
-
|
|
307
|
-
# Or manually define in .specify/tasks.md
|
|
308
|
-
ax spec run --parallel
|
|
309
|
-
|
|
310
|
-
# Check progress
|
|
311
|
-
ax spec status
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
## Memory System
|
|
315
|
-
|
|
316
|
-
### Search Memory
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
# Search for past conversations
|
|
320
|
-
ax memory search "authentication"
|
|
321
|
-
ax memory search "API design"
|
|
322
|
-
|
|
323
|
-
# List recent memories
|
|
324
|
-
ax memory list --limit 10
|
|
325
|
-
|
|
326
|
-
# Export memory for backup
|
|
327
|
-
ax memory export > backup.json
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
### How Memory Works
|
|
331
|
-
|
|
332
|
-
- **Automatic**: All agent conversations are saved automatically
|
|
333
|
-
- **Fast**: SQLite FTS5 full-text search (< 1ms)
|
|
334
|
-
- **Local**: 100% private, data never leaves your machine
|
|
335
|
-
- **Cost**: $0 (no API calls for memory operations)
|
|
336
|
-
|
|
337
|
-
## Troubleshooting
|
|
338
|
-
|
|
339
|
-
### Common Issues
|
|
340
|
-
|
|
341
|
-
**"MCP client for `automatosx` timed out after 10/30/60 seconds"**
|
|
342
|
-
|
|
343
|
-
This is the most common issue when using AutomatosX with Codex CLI.
|
|
344
|
-
|
|
345
|
-
### Why This Happens
|
|
346
|
-
|
|
347
|
-
AutomatosX uses **lazy initialization** for optimal performance:
|
|
348
|
-
|
|
349
|
-
1. **MCP Handshake** (instant, <1ms)
|
|
350
|
-
- `initialize` → Returns server info immediately
|
|
351
|
-
- `tools/list` → Returns static tool schemas immediately
|
|
352
|
-
|
|
353
|
-
2. **First Tool Call** (15-20 seconds, one-time)
|
|
354
|
-
- Loads all provider modules (Claude, Gemini, OpenAI)
|
|
355
|
-
- Initializes Router with health checks
|
|
356
|
-
- Loads agent profiles from disk
|
|
357
|
-
- Opens SQLite database for memory
|
|
358
|
-
- Initializes Session/Workspace/Context managers
|
|
359
|
-
|
|
360
|
-
3. **Subsequent Tool Calls** (fast, <100ms)
|
|
361
|
-
- All services cached in memory
|
|
362
|
-
- No re-initialization needed
|
|
363
|
-
|
|
364
|
-
Codex CLI's default timeouts (10s startup, 30s tool) are too short for the first tool call's initialization sequence.
|
|
365
|
-
|
|
366
|
-
### The Fix
|
|
367
|
-
|
|
368
|
-
Edit `~/.codex/config.toml` (create if it doesn't exist):
|
|
369
|
-
|
|
370
|
-
```toml
|
|
371
|
-
# AutomatosX MCP Server - Increased timeouts for lazy initialization
|
|
372
|
-
[mcp_servers.automatosx]
|
|
373
|
-
command = "node"
|
|
374
|
-
args = ["/path/to/automatosx/dist/mcp/index.js"] # Get path from: ax setup --force
|
|
375
|
-
startup_timeout_sec = 60 # Allow time for MCP handshake
|
|
376
|
-
tool_timeout_sec = 120 # Allow time for first tool call initialization
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
**Important:** Replace `/path/to/automatosx/dist/mcp/index.js` with the actual path shown when you run `ax setup`.
|
|
380
|
-
|
|
381
|
-
### Why ~/.codex/config.toml?
|
|
382
|
-
|
|
383
|
-
The project-level `.codex/mcp-servers.json` file (created by `ax setup`) does **not** support timeout settings - that's a Codex CLI limitation. Timeouts can only be configured in the global `~/.codex/config.toml` file.
|
|
384
|
-
|
|
385
|
-
### Quick Setup
|
|
386
|
-
|
|
387
|
-
```bash
|
|
388
|
-
# 1. Run ax setup to see the correct MCP server path
|
|
389
|
-
ax setup --force
|
|
390
|
-
|
|
391
|
-
# 2. Copy the printed config.toml snippet to ~/.codex/config.toml
|
|
392
|
-
|
|
393
|
-
# 3. Restart Codex CLI
|
|
394
|
-
codex
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
### Quick Diagnosis
|
|
398
|
-
|
|
399
|
-
Use the built-in diagnostic tool to verify your configuration:
|
|
400
|
-
|
|
401
|
-
```bash
|
|
402
|
-
# Run Codex MCP diagnostics
|
|
403
|
-
ax doctor --codex
|
|
404
|
-
|
|
405
|
-
# With verbose output
|
|
406
|
-
ax doctor --codex --verbose
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
This checks:
|
|
410
|
-
- Codex CLI installation
|
|
411
|
-
- AutomatosX setup
|
|
412
|
-
- MCP server availability
|
|
413
|
-
- Global config.toml existence
|
|
414
|
-
- Timeout configuration (minimum 60s/120s)
|
|
415
|
-
- Project-level config conflicts
|
|
416
|
-
- MCP server connectivity
|
|
417
|
-
|
|
418
|
-
### Manual Diagnosis
|
|
419
|
-
|
|
420
|
-
```bash
|
|
421
|
-
# 1. Check if MCP server path is correct
|
|
422
|
-
ax setup --force | grep "args ="
|
|
423
|
-
|
|
424
|
-
# 2. Verify ~/.codex/config.toml has timeout settings
|
|
425
|
-
grep -A 4 "mcp_servers.automatosx" ~/.codex/config.toml
|
|
426
|
-
|
|
427
|
-
# 3. Test MCP server directly (should respond in <1 second)
|
|
428
|
-
echo 'Content-Length: 152
|
|
429
|
-
|
|
430
|
-
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"test","version":"1.0"},"capabilities":{}}}' | timeout 5 node /path/to/dist/mcp/index.js
|
|
431
|
-
|
|
432
|
-
# 4. Check for project-level config that may conflict
|
|
433
|
-
ls -la .codex/mcp-servers.json 2>/dev/null
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
---
|
|
437
|
-
|
|
438
|
-
**"Codex CLI not found"**
|
|
439
|
-
```bash
|
|
440
|
-
# Install Codex CLI
|
|
441
|
-
npm install -g @openai/codex-cli
|
|
442
|
-
|
|
443
|
-
# Verify installation
|
|
444
|
-
codex --version
|
|
445
|
-
|
|
446
|
-
# Check AutomatosX provider status
|
|
447
|
-
ax status
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
**"Git repository required"**
|
|
451
|
-
```bash
|
|
452
|
-
# Codex CLI requires a git repository
|
|
453
|
-
git init
|
|
454
|
-
|
|
455
|
-
# Or run ax setup (automatically initializes git)
|
|
456
|
-
ax setup
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
**"Provider not available"**
|
|
460
|
-
```bash
|
|
461
|
-
# Check system status
|
|
462
|
-
ax status
|
|
463
|
-
|
|
464
|
-
# View configuration
|
|
465
|
-
ax config show
|
|
466
|
-
|
|
467
|
-
# Check provider limits
|
|
468
|
-
ax provider-limits
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
**"Out of memory"**
|
|
472
|
-
```bash
|
|
473
|
-
# Clear old memories
|
|
474
|
-
ax memory clear --before "2024-01-01"
|
|
475
|
-
|
|
476
|
-
# View memory stats
|
|
477
|
-
ax cache stats
|
|
478
|
-
```
|
|
479
|
-
|
|
480
|
-
**"Authentication failed"**
|
|
481
|
-
```bash
|
|
482
|
-
# Login to Codex
|
|
483
|
-
codex login
|
|
484
|
-
|
|
485
|
-
# Verify authentication
|
|
486
|
-
codex exec "test prompt"
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
### Getting Help
|
|
490
|
-
|
|
491
|
-
```bash
|
|
492
|
-
# View command help
|
|
493
|
-
ax --help
|
|
494
|
-
ax run --help
|
|
495
|
-
|
|
496
|
-
# Enable debug mode
|
|
497
|
-
ax --debug run backend "task"
|
|
498
|
-
|
|
499
|
-
# Search memory for similar past tasks
|
|
500
|
-
ax memory search "similar task"
|
|
501
|
-
|
|
502
|
-
# Check Codex CLI help
|
|
503
|
-
codex --help
|
|
504
|
-
```
|
|
505
|
-
|
|
506
|
-
## Direct Codex CLI Usage
|
|
507
|
-
|
|
508
|
-
While AutomatosX is the recommended interface, you can also use Codex CLI directly:
|
|
509
|
-
|
|
510
|
-
### Interactive Mode
|
|
511
|
-
|
|
512
|
-
```bash
|
|
513
|
-
# Start interactive session
|
|
514
|
-
codex
|
|
515
|
-
|
|
516
|
-
# Or with initial prompt
|
|
517
|
-
codex "Explain TypeScript generics"
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
### Non-Interactive Mode
|
|
521
|
-
|
|
522
|
-
```bash
|
|
523
|
-
# Execute single command
|
|
524
|
-
codex exec "Write a Python function to sort a list"
|
|
525
|
-
|
|
526
|
-
# With options
|
|
527
|
-
codex exec --temperature 0.7 --max-tokens 500 "Generate haiku about code"
|
|
528
|
-
```
|
|
529
|
-
|
|
530
|
-
### Sandbox Mode
|
|
531
|
-
|
|
532
|
-
```bash
|
|
533
|
-
# Run in workspace-write sandbox
|
|
534
|
-
codex --sandbox workspace-write "Analyze this codebase"
|
|
535
|
-
|
|
536
|
-
# Full sandbox access
|
|
537
|
-
codex --sandbox full "Create file structure"
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
### MCP Commands
|
|
541
|
-
|
|
542
|
-
```bash
|
|
543
|
-
# Start MCP server
|
|
544
|
-
codex mcp-server
|
|
545
|
-
|
|
546
|
-
# Manage MCP servers
|
|
547
|
-
codex mcp list
|
|
548
|
-
codex mcp start <server-name>
|
|
549
|
-
codex mcp stop <server-name>
|
|
550
|
-
```
|
|
551
|
-
|
|
552
|
-
## Code Examples
|
|
553
|
-
|
|
554
|
-
See `examples/codex/usage-examples.ts` for comprehensive code examples:
|
|
555
|
-
|
|
556
|
-
1. **Basic CLI Execution** - Simple prompts and responses
|
|
557
|
-
2. **Streaming Execution** - Real-time output
|
|
558
|
-
3. **MCP Server Management** - Starting/stopping MCP server
|
|
559
|
-
4. **Full Integration** - CodexBridge usage
|
|
560
|
-
5. **Error Handling** - Retry patterns and type-specific handling
|
|
561
|
-
6. **Default Instances** - Using singleton instances
|
|
562
|
-
7. **Advanced Configuration** - Sandbox modes, custom configs
|
|
563
|
-
|
|
564
|
-
Run examples:
|
|
565
|
-
```bash
|
|
566
|
-
npm run example:codex
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
## Best Practices
|
|
570
|
-
|
|
571
|
-
1. **Use Terminal CLI**: Primary interface is `ax` commands, not direct Codex CLI
|
|
572
|
-
2. **Leverage Memory**: Reference past decisions and designs
|
|
573
|
-
3. **Start Simple**: Test with small tasks before complex workflows
|
|
574
|
-
4. **Review Configurations**: Check `ax.config.json` for timeouts and retries
|
|
575
|
-
5. **Keep Agents Specialized**: Use the right agent for each task type
|
|
576
|
-
6. **Monitor Provider Limits**: Use `ax provider-limits` to check quota
|
|
577
|
-
7. **Enable Fallbacks**: Configure backup providers (Gemini, Claude) for reliability
|
|
578
|
-
|
|
579
|
-
## Documentation
|
|
580
|
-
|
|
581
|
-
- **AutomatosX Docs**: https://github.com/defai-digital/automatosx
|
|
582
|
-
- **Codex CLI Docs**: https://docs.openai.com/codex-cli
|
|
583
|
-
- **Agent Directory**: `.automatosx/agents/`
|
|
584
|
-
- **Configuration**: `ax.config.json`
|
|
585
|
-
- **Memory Database**: `.automatosx/memory/memories.db`
|
|
586
|
-
- **Workspace**: `automatosx/PRD/` (planning docs) and `automatosx/tmp/` (temporary files)
|
|
587
|
-
- **Code Examples**: `examples/codex/usage-examples.ts`
|
|
588
|
-
|
|
589
|
-
## Support
|
|
590
|
-
|
|
591
|
-
- **AutomatosX Issues**: https://github.com/defai-digital/automatosx/issues
|
|
592
|
-
- **AutomatosX NPM**: https://www.npmjs.com/package/@defai.digital/automatosx
|
|
593
|
-
- **Codex CLI Issues**: https://github.com/openai/codex-cli/issues
|