agentleFS
mathematic-incmathematic-inc/earl/skills/development/troubleshoot-earl/SKILL.md

troubleshoot-earl

Skill113 starsChanged 2 months agoApache-2.0View on GitHub

Diagnoses and fixes Earl problems including installation failures, template errors, authentication issues, MCP connectivity, and SSRF blocks. Use when Earl isn't working, when earl call returns errors, when MCP tools are not visible, or when earl doctor reports failures.

  • Pipes a download into a shell
  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 4 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If this fails with command not found: earl, Earl is not installed.

    line 36
  2. Very specific:

    If earl doctor reports other failures, address each one before continuing.

    line 44
  3. Very specific:

    If the expected provider.command is not listed:

    line 73
  4. Very specific:

    Check that the file is in ./templates/ or the global template directory: ~/.config/earl/templates/ (macOS/Linux) or …

    line 75
  5. Very specific:

    Check that provider in the HCL matches what you're calling (earl call <provider>.<command>)

    line 77
  6. Distinctive:

    If required secrets are missing, print the checklist:

    line 88
  7. Very specific:

    macOS note: If earl secrets set hangs for more than 5 seconds, check for a macOS system dialog behind your terminal window asking to allow …

    line 97
  8. Very specific:

    After confirmation, re-run earl secrets list to verify keys are set.

    line 100
  9. Very specific:

    Check that the MCP config file exists and contains the earl entry:

    line 106
  10. Distinctive:

    If the config is missing or incorrect, write it (merging with existing entries, not overwriting).

    line 133
  11. Distinctive:

    If all above pass, run the failing command directly and examine the output:

    line 142
  12. Very specific:

    If the issue was a missing template: invoke create-template

    line 170
  13. Distinctive:

    If the issue was MCP config: config is now written.

    line 171
  14. Very specific:

    If the issue required browser OAuth: run earl auth login <profile>, then retry the command

    line 172
  15. Very specific:

    If Earl still isn't working after all steps: run earl doctor --json and share the output

    line 173

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Troubleshoot Earl

Cold-start diagnostic for when Earl isn't working. Follow the steps in order — each step may reveal the root cause.

What Agents Can Fix

  • Earl not installed
  • HCL parse errors
  • Jinja render errors
  • Template not found
  • Wrong CLI flag order
  • MCP config missing or incorrect
  • SSRF blocks (suggest workaround)

What Requires Human Action

  • Secret values — agent prints checklist; human runs earl secrets set <key> manually
  • auth_code_pkce OAuth — agent provides command; human completes browser flow
  • Agent restart for MCP — agent notes this; continues with CLI mode
  • macOS keychain access dialog — agent warns; human clicks "Always Allow"

Step 1: Earl Doctor

earl doctor

If this fails with command not found: earl, Earl is not installed. Install it:

cargo install earl  # requires Rust toolchain + Node.js + pnpm
# or: curl -fsSL https://raw.githubusercontent.com/mathematic-inc/earl/main/scripts/install.sh | bash
# Windows: irm https://raw.githubusercontent.com/mathematic-inc/earl/main/scripts/install.ps1 | iex

If earl doctor reports other failures, address each one before continuing.


Step 2: Validate Templates

earl templates validate

Fix any errors found. Common errors and fixes:

Error messageCauseFix
HCL parse error / unexpected tokenInvalid HCL syntaxCheck structure, quotes, and braces
template root must be an objectMissing top-level fieldsAdd version = 1 and provider = "..."
template must define either 'commands' or 'command', not bothUsed both singular and plural formUse only command blocks
command X has empty titleMissing title fieldAdd title = "..." to the command block
undefined variable{{ args.x }} doesn't match a param nameCheck that param names match {{ args.x }} references
params = [{{ ... }}]Bare Jinja in HCL arrayWrap in string: params = ["{{ ... }}"]

Step 3: Check Template Exists

earl templates list

If the expected provider.command is not listed:

  • Check that the file is in ./templates/ or the global template directory: ~/.config/earl/templates/ (macOS/Linux) or %APPDATA%\earl\templates\ (Windows)
  • Check that provider in the HCL matches what you're calling (earl call <provider>.<command>)
  • Re-run earl templates validate to catch parse errors

Step 4: Check Secrets

earl secrets list

If required secrets are missing, print the checklist:

Run in your terminal:
  earl secrets set <provider>.<key>

Tell me when done and I'll verify.

macOS note: If earl secrets set hangs for more than 5 seconds, check for a macOS system dialog behind your terminal window asking to allow Earl keychain access. Click "Always Allow."

After confirmation, re-run earl secrets list to verify keys are set.


Step 5: Check MCP Config (if using MCP)

Check that the MCP config file exists and contains the earl entry:

Claude Code: .claude/settings.json

{
  "mcpServers": {
    "earl": {
      "command": "earl",
      "args": ["mcp", "stdio"]
    }
  }
}

Note: ["mcp", "stdio", "--mode", "discovery"] is also valid — it is used when the template count is ≥ 30 (per setup-earl Phase 3). Do not remove the --mode discovery flag from a config that already has it; that would silently downgrade to full mode.

Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS), %APPDATA%\Claude\claude_desktop_config.json (Windows), or ~/.config/Claude/claude_desktop_config.json (Linux)

Cursor: .cursor/mcp.json (project directory)

Windsurf: .windsurf/mcp.json (project directory)

If the config is missing or incorrect, write it (merging with existing entries, not overwriting).

MCP tools not visible? The config is correct but MCP tools only activate after restarting the agent. In the current session, use earl call --yes --json via Bash instead.


Step 6: Run the Failing Command

If all above pass, run the failing command directly and examine the output:

earl call --yes --json <provider>.<command> --<param> <value>

Match the error to the table:

SymptomCategoryFix
HCL parse error / unexpected tokenHCL syntaxAgent: edit template, re-validate
undefined variable / template errorJinja renderAgent: fix {{ args.* }} references
HTTP 401 / 403Auth failureHuman: earl secrets set <key>
address not allowedSSRF blockAgent: use a public URL, or use bash protocol for local services
command not found: earlNot installedAgent: run install script
no such commandWrong command nameAgent: check earl templates list
MCP tool not visible in agentMCP not configured or restart neededAgent: write/fix config; tell user to restart
earl call hangs waiting for input--yes flag in wrong positionAgent: reorder — earl call --yes --json provider.command ...
earl secrets set hangsmacOS keychain dialogHuman: click "Always Allow" in system dialog
OAuth flow requiredBrowser-based authHuman: run earl auth login <profile>, complete browser flow
unknown environment / invalid environment nameBad --env valueAgent: check environments block in template for valid names
vars.* resolves to empty stringNo active environmentAgent: pass --env <name> or set [environments] default in config.toml
environment protocol switching not allowedProtocol mismatch in environment overrideAgent: prefer vars.* for different base URLs; only add allow_environment_protocol_switching = true to annotations if a protocol change is genuinely required (bypasses HTTP egress rules — see secure-agent)

Next Steps

  • If the issue was a missing template: invoke create-template
  • If the issue was MCP config: config is now written; restart your agent for MCP tools to activate
  • If the issue required browser OAuth: run earl auth login <profile>, then retry the command
  • If Earl still isn't working after all steps: run earl doctor --json and share the output

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.