ubx optimize reads .xcl files and recent cost history, then uses AI to identify concrete cost-saving opportunities. Recommendations are classified as FIX (auto-applicable) or ADV (advisory).
Usage
Flags
| Flag | Description |
|---|---|
--apply | Interactively apply fixable (FIX) recommendations |
--format <fmt> | Output format: text, json |
--min-saving <amount> | Only show recommendations saving ≥ this amount per month (USD) |
Requirements
RequiresUBX_AI_API_KEY or ai { enabled = true } in workspace config.
Examples
Output
Recommendation types
| Type | Description |
|---|---|
FIX | Modifies a .xcl attribute in-place — instance size, feature toggles, storage tier |
ADV | Advisory action in the cloud console — Reserved Instances, Spot, CDN, etc. |
Interactive apply
FIX recommendation:
y— apply the fix (rewrites the.xclfile)N— skip this recommendations— skip all remaining recommendations
ubx fmt on modified files.
JSON output
AI model
UsesconfigPkg.DefaultAIModel (claude-haiku-4-5). Override in workspace config.
