--llm flag tries to contribute to solve context optimization problem for AI agents. Instead of manually writing hundreds of lines describing available tools, agents just run dx --llm and automatically discover what they can do in any project.
Context Optimization Problem
Before dx —llm: Manual context files that get outdatedContext & Cost Optimization
The dx —llm
Dynamic context discovery in minimal tokens:Agent starts each task with 2 commands:
After dx —llm:Auto-Updated Context
Agent-Friendly Design
No TUI Required
Commands run directly in shell, perfect for automated environments
Exit Code Aware
Proper exit codes enable AI agents to detect success/failure
Stdio Inheritance
Commands inherit stdin/stdout for seamless pipeline integration
Recording Built-in
AI can record sessions for debugging and analysis
AI Safety & Verification
Command Safety Check
- Destructive patterns -
rm -rf,dd,format, etc. - Network operations - External API calls, data uploads
- File system risks - Writing to system directories
- Permission escalation -
sudo,su, privilege requests - Resource consumption - Infinite loops, fork bombs