$npx -y skills add webflow/webflow-skills --skill webflow-cli-troubleshooterDiagnose and fix Webflow CLI issues including installation problems, authentication failures, build errors, and bundle problems. Uses CLI diagnostic flags (--version, --help, --verbose, --debug-bundler) for troubleshooting.
| 1 | # Webflow CLI Troubleshooter |
| 2 | |
| 3 | Diagnose and resolve Webflow CLI issues with diagnostic commands and automated fixes. |
| 4 | |
| 5 | ## Important Note |
| 6 | |
| 7 | **ALWAYS use Bash tool for all diagnostic operations:** |
| 8 | - Execute diagnostic commands via Bash tool |
| 9 | - Use Read tool to examine configuration files |
| 10 | - Verify CLI installation: `webflow --version` |
| 11 | - Check authentication: `webflow auth login` (if needed) |
| 12 | - Use CLI diagnostic flags: `--verbose`, `--debug-bundler`, `--help` |
| 13 | - DO NOT use Webflow MCP tools for CLI workflows |
| 14 | - All CLI commands require proper descriptions (not context parameters) |
| 15 | |
| 16 | **Package Manager Detection:** |
| 17 | - Check for lock files: `package-lock.json` (npm), `pnpm-lock.yaml` (pnpm), `yarn.lock` (yarn) |
| 18 | - If no lock file found, ask user which package manager to use (npm/pnpm/yarn) |
| 19 | - Use detected package manager for all install/build commands |
| 20 | |
| 21 | ## Instructions |
| 22 | |
| 23 | ### Phase 1: Issue Identification |
| 24 | 1. **Ask user to describe issue**: What command failed or what error occurred |
| 25 | 2. **Determine error category**: |
| 26 | - CLI not installed or wrong version |
| 27 | - Authentication failed |
| 28 | - Build/bundle failed |
| 29 | - Command not recognized |
| 30 | 3. **Capture error message**: Get exact error output |
| 31 | |
| 32 | ### Phase 2: Run Diagnostics |
| 33 | 4. **Check CLI installation**: Run `webflow --version` |
| 34 | 5. **Check authentication**: Run `webflow auth login` if needed |
| 35 | 6. **Run command with --verbose**: Execute failed command with `--verbose` flag for detailed output |
| 36 | 7. **Use --debug-bundler** (if bundle issue): Run with `--debug-bundler` flag to see bundler config |
| 37 | 8. **Check --help**: Run `webflow <command> --help` to verify command syntax |
| 38 | |
| 39 | ### Phase 3: Analyze & Fix |
| 40 | 9. **Identify root cause**: Parse error messages and diagnostic output |
| 41 | 10. **Present fix**: Show specific solution based on CLI error |
| 42 | 11. **Apply fix**: Execute fix commands |
| 43 | 12. **Verify**: Re-run original command to confirm resolution |
| 44 | |
| 45 | ## Examples |
| 46 | |
| 47 | ### Example 1: CLI Not Installed |
| 48 | |
| 49 | **User prompt:** |
| 50 | ``` |
| 51 | Getting "webflow: command not found" |
| 52 | ``` |
| 53 | |
| 54 | **Diagnostics:** |
| 55 | ``` |
| 56 | 🔍 Checking CLI Installation |
| 57 | |
| 58 | Executing: webflow --version |
| 59 | |
| 60 | Error: bash: webflow: command not found |
| 61 | |
| 62 | ❌ Webflow CLI not installed |
| 63 | ``` |
| 64 | |
| 65 | **Fix:** |
| 66 | ``` |
| 67 | 📋 Fix: Install Webflow CLI |
| 68 | |
| 69 | Executing: npm install -g @webflow/cli |
| 70 | |
| 71 | ✓ CLI installed |
| 72 | |
| 73 | Verifying... |
| 74 | Executing: webflow --version |
| 75 | |
| 76 | Output: @webflow/cli/1.5.2 |
| 77 | |
| 78 | ✅ Issue resolved |
| 79 | ``` |
| 80 | |
| 81 | ### Example 2: Build Failed |
| 82 | |
| 83 | **User prompt:** |
| 84 | ``` |
| 85 | Build is failing but I don't know why |
| 86 | ``` |
| 87 | |
| 88 | **Diagnostics:** |
| 89 | ``` |
| 90 | 🔍 Running Build with Diagnostics |
| 91 | |
| 92 | Executing: webflow library bundle --verbose |
| 93 | |
| 94 | Output: |
| 95 | [verbose] Loading webflow.json |
| 96 | [verbose] Found library config |
| 97 | [verbose] Building components from ./src/**/*.webflow.tsx |
| 98 | [verbose] Running bundler |
| 99 | Error: Failed to resolve import './missing-file.ts' |
| 100 | |
| 101 | ❌ Build failed: Missing import file |
| 102 | ``` |
| 103 | |
| 104 | **Fix:** |
| 105 | ``` |
| 106 | 📋 Fix: Missing Import |
| 107 | |
| 108 | Issue: Component imports './missing-file.ts' which doesn't exist |
| 109 | |
| 110 | Solutions: |
| 111 | 1. Create the missing file |
| 112 | 2. Fix the import path |
| 113 | 3. Remove the import if not needed |
| 114 | |
| 115 | Check your component imports and ensure all files exist. |
| 116 | ``` |
| 117 | |
| 118 | ### Example 3: Bundle Configuration Issue |
| 119 | |
| 120 | **User prompt:** |
| 121 | ``` |
| 122 | Bundle is failing with webpack errors |
| 123 | ``` |
| 124 | |
| 125 | **Diagnostics:** |
| 126 | ``` |
| 127 | 🔍 Checking Bundle Configuration |
| 128 | |
| 129 | Executing: webflow library bundle --debug-bundler |
| 130 | |
| 131 | Output: |
| 132 | [debug-bundler] Final bundler configuration: |
| 133 | { |
| 134 | "entry": "./src/Component.tsx", |
| 135 | "output": { |
| 136 | "path": "/dist", |
| 137 | "filename": "bundle.js" |
| 138 | }, |
| 139 | "resolve": { |
| 140 | "extensions": [".ts", ".tsx", ".js"] |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | Error: Module not found: Can't resolve 'styled-components' |
| 145 | |
| 146 | ❌ Bundle failed: Missing dependency |
| 147 | ``` |
| 148 | |
| 149 | **Fix:** |
| 150 | ``` |
| 151 | 📋 Fix: Install Missing Dependency |
| 152 | |
| 153 | Executing: npm install styled-components |
| 154 | |
| 155 | ✓ Dependency installed |
| 156 | |
| 157 | Retrying bundle... |
| 158 | Executing: webflow library bundle |
| 159 | |
| 160 | ✓ Bundle created successfully |
| 161 | |
| 162 | ✅ Issue resolved |
| 163 | ``` |
| 164 | |
| 165 | ## Guidelines |
| 166 | |
| 167 | ### CLI Diagnostic Commands |
| 168 | |
| 169 | **Version Check:** |
| 170 | ```bash |
| 171 | webflow --version |
| 172 | # or |
| 173 | webflow -V |
| 174 | ``` |
| 175 | |
| 176 | **Command Help:** |
| 177 | ```bash |
| 178 | webflow --help # General help |
| 179 | webflow library --help # Library commands help |
| 180 | webflow library bundle --help # Specific command help |
| 181 | ``` |
| 182 | |
| 183 | **Verbose Output:** |
| 184 | ```bash |
| 185 | # Add --verbose to any command for detailed debugging |
| 186 | webflow library bundle --verbose |
| 187 | webflow cloud deploy --verbose |
| 188 | webflow extension bundle --verbose |
| 189 | ``` |
| 190 | |
| 191 | **Debug Bundler:** |
| 192 | ```bash |
| 193 | # Show final bundler configuration |
| 194 | webflow library bundle --debug-bundler |
| 195 | webflow extension bundle --debug-bundler |
| 196 | ``` |
| 197 | |
| 198 | ### Common Issues & Fixes |
| 199 | |
| 200 | **Issue: CLI Not Found** |
| 201 | - **Diagnostic:** `webflow --version` fails |
| 202 | - **Fix:** `npm install -g @webflow/cli` |
| 203 | - **Verify:** `webflow --version` shows version |
| 204 | |
| 205 | **Issue: Wrong CLI Version** |
| 206 | - **Diagnostic:** `webflow --version` shows old version |
| 207 | - **Fix:** `npm update |