# TUI Operations Guide ## Overview The TUI Operations screen provides an interactive interface for executing Shopify price update operations directly from the terminal interface. ## How to Access 1. Run the TUI: `node src/tui-entry.js` or `npm run tui` 2. Navigate to "🔧 Operations" from the main menu 3. Use arrow keys to select operations and press Enter to execute ## Available Operations ### 💰 Update Prices - **Purpose**: Apply percentage adjustment to product prices - **Requirements**: Full configuration (domain, token, tag, adjustment %) - **What it does**: - Fetches products with the target tag - Applies the configured price adjustment - Sets compare-at prices for rollback capability - Updates prices in Shopify ### â†Šī¸ Rollback Prices - **Purpose**: Revert prices to their compare-at values - **Requirements**: Full configuration + previous price update - **What it does**: - Finds products with compare-at prices - Reverts current prices to compare-at prices - Clears compare-at prices after rollback ### 🔗 Test Connection - **Purpose**: Verify Shopify API access and credentials - **Requirements**: Domain and access token only - **What it does**: - Tests connection to Shopify API - Verifies access token permissions - Confirms store domain is accessible - **Note**: Can be run even without full configuration ### 📊 Analyze Products - **Purpose**: Preview products that will be affected by operations - **Requirements**: Full configuration - **What it does**: - Fetches products with the target tag - Counts total products and variants - Shows how many variants have prices - Displays what the price adjustment will be - **Note**: Read-only operation, makes no changes ## Operation Status & Progress ### Progress Tracking - Real-time progress bar during operations - Status messages showing current step - Percentage completion indicator ### Results Display - ✅ Success: Green border with success message and details - ❌ Error: Red border with error message and troubleshooting tips - 🚀 In Progress: Yellow border with progress information ### Result Details Each operation shows: - Success/failure status - Number of products/variants processed - Specific error messages if applicable - Helpful troubleshooting suggestions ## Navigation ### Keyboard Controls - **↑/↓ Arrow Keys**: Navigate between operations - **Enter**: Execute selected operation - **Esc**: Return to main menu ### Operation States - **Enabled**: White text - operation can be executed - **Disabled**: Gray text - missing required configuration - **Selected**: Blue background - currently highlighted operation ## Configuration Requirements ### Minimum for Test Connection - Shopify Shop Domain - Shopify Access Token ### Full Configuration Required - Shopify Shop Domain - Shopify Access Token - Target Product Tag - Price Adjustment Percentage - Operation Mode (update/rollback) ## Error Handling ### Common Issues 1. **Connection Failed**: Check domain and access token 2. **No Products Found**: Verify target tag exists on products 3. **Permission Denied**: Ensure access token has required permissions 4. **Network Error**: Check internet connection ### Troubleshooting Tips - Use "Test Connection" first to verify basic setup - Use "Analyze Products" to preview before making changes - Check the main console output for detailed error logs - Verify your .env file has all required variables ## Safety Features ### Preview Before Action - "Analyze Products" shows exactly what will be affected - Configuration status clearly displayed before operations - Confirmation required for destructive operations ### Rollback Capability - Update operations automatically set compare-at prices - Rollback operation can revert changes - Clear status messages about what can/cannot be rolled back ## Integration with Main App The TUI operations use the same underlying services as the command-line version: - Same ShopifyService for API calls - Same ProductService for business logic - Same error handling and retry mechanisms - Same logging and progress tracking This ensures consistency between TUI and CLI operations.