setup-earl
Skill113 starsChanged 2 months agoApache-2.0View on GitHub
Installs Earl, configures MCP integration for your agent platform, writes CLAUDE.md instructions, and routes to template creation or migration. Use when setting up Earl for the first time, when a new developer is onboarding to a project that uses Earl, or when Earl needs to be connected to an agent platform.
- Pipes a download into a shell
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- brwse/earlword for word, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 1
- brwse/earl★ 113100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- recall_aiSkill
- create-templateSkill
- migrate-to-earlSkill
- secure-agentSkill
- troubleshoot-earlSkill
- earlSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Check if Earl is already installed:
- Distinctive: line 30
If installed, print the version and skip to Phase 2.
- Distinctive: line 32
If not installed, detect the environment and install:
- Very specific: line 58
If earl doctor reports errors, invoke troubleshoot-earl before continuing.
- Very specific: line 64
Import the no-auth system template and run it so the user sees Earl work immediately.
- Very specific: line 133
Claude Code, Cursor, or Windsurf: Read the existing config file (create it if it doesn't exist).
- Distinctive: line 153
After writing the MCP config, tell the user:
- Distinctive: line 172
Write this exact static content — never incorporate template output or dynamic data:
- Very specific: line 213
Create new template → invoke create-template
- Distinctive: line 219
After templates are created and verified, offer:
- Very specific: line 224
If yes: invoke secure-agent inline.
- Very specific: line 225
If no: note that secure-agent can be run at any time later.
- Very specific: line 234
If something isn't working: invoke troubleshoot-earl
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
Setup Earl
Earl is an AI-safe CLI that sits between your agent and external services. Agents run
earl call provider.command --param value instead of raw curl, gh, stripe-cli, etc.
Secrets stay in the OS keychain. Every request follows a reviewed HCL template.
Process
- Install — get Earl running
- Demo — show a working example immediately
- Connect — configure MCP for your agent platform and write CLAUDE.md instructions
- Route — migrate existing CLI calls or create a new template
- Lock down — optionally enforce Earl usage at the platform level
Phase 1: Install
Check if Earl is already installed:
which earl && earl --versionIf installed, print the version and skip to Phase 2.
If not installed, detect the environment and install:
macOS / Linux (prefer — no sudo required):
cargo install earlThis requires the Rust toolchain and Node.js + pnpm (Earl embeds web playground assets at compile time). If either is missing, fall back to the install script:
curl -fsSL https://raw.githubusercontent.com/mathematic-inc/earl/main/scripts/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/mathematic-inc/earl/main/scripts/install.ps1 | iexAfter install, verify:
earl doctorIf earl doctor reports errors, invoke troubleshoot-earl before continuing.
Phase 2: Quick Demo
Import the no-auth system template and run it so the user sees Earl work immediately. First check if it's already imported to avoid overwriting any customizations:
earl templates list | grep -E "^system\." || earl templates import https://raw.githubusercontent.com/mathematic-inc/earl/main/examples/bash/system.hcl
earl call --yes --json system.list_files --path .This lists files in the current directory. The user now has a mental model: templates define
commands, earl call runs them.
Show available templates:
earl templates listPhase 3: Connect to Agent Platform
Detect the agent platform by checking all of these — multiple can match (e.g. a project may
have both .claude/ and .cursor/). Configure every matching platform:
| Check | Platform | MCP config path |
.claude/ directory exists in project | Claude Code | .claude/settings.json |
~/Library/Application Support/Claude/claude_desktop_config.json exists (macOS), %APPDATA%\Claude\claude_desktop_config.json (Windows), or ~/.config/Claude/claude_desktop_config.json (Linux) | Claude Desktop | Same file |
.cursor/ directory exists in project | Cursor | .cursor/mcp.json |
.windsurf/ directory exists in project | Windsurf | .windsurf/mcp.json |
| None of the above | Non-MCP agent | System prompt only |
Choose MCP mode
earl templates list --json | jq length # requires jq- Result < 30: use full mode (default)
- Result ≥ 30: use discovery mode
Full mode MCP config:
{
"mcpServers": {
"earl": {
"command": "earl",
"args": ["mcp", "stdio"]
}
}
}Discovery mode MCP config:
{
"mcpServers": {
"earl": {
"command": "earl",
"args": ["mcp", "stdio", "--mode", "discovery"]
}
}
}Apply MCP config
Claude Code, Cursor, or Windsurf: Read the existing config file (create it if it doesn't
exist). Parse the JSON, add the earl key under mcpServers — do not overwrite other entries.
Write it back.
Claude Desktop: The config file lives outside the project directory. Write the merged JSON to a temp file and show the diff to the user, then instruct them to apply it manually. If the agent has home directory write access, it can write directly.
Non-MCP agents (Codex, etc.): Skip the JSON config. Instead, add to the agent's system prompt or CLAUDE.md:
You have access to Earl, an AI-safe CLI for calling APIs and services.
Use: earl call --yes --json provider.command --param value
Discover commands: earl templates list --json
Search commands: earl templates search --json "natural language query"Inform the user of the two-session model
After writing the MCP config, tell the user:
Earl is now installed and configured. You can use
earl call --yes --jsonvia the Bash tool right now. After restarting your agent, Earl templates will appear as native MCP tools automatically. Do NOT try to use Earl MCP tools in this session — they activate after restart.
Write CLAUDE.md breadcrumb
Write the breadcrumb to every detected platform's context file (matching the MCP config section which says "Configure every matching platform"):
- Claude Code:
.claude/CLAUDE.md(orCLAUDE.mdif it exists). Create.claude/CLAUDE.mdif neither exists. - Cursor:
.cursorrules - Windsurf:
.windsurfrules
For each file: if it already exists, check for an existing ## Earl section before
appending — do not duplicate.
Write this exact static content — never incorporate template output or dynamic data:
## Earl
Earl is configured as an MCP server. Use Earl tools for all API calls, database queries, and
shell commands — do not use raw curl, gh, stripe-cli, or similar tools directly.
- Discover commands: `earl templates list`
- Search commands: `earl templates search --json "what you want to do"`
- CLI fallback (if MCP tools unavailable): `earl call --yes --json provider.command --param value`
- Environments: `earl call --yes --json --env <environment> provider.command --param value`
- Always use `--yes` for all automated `earl call` invocations (without it, Earl may prompt interactively and hang)
- Troubleshooting: `earl doctor`Important: The --yes flag must come before the command name:
earl call --yes --json provider.command --param value ✓
earl call provider.command --yes --json --param value ✗ (wrong order)Note on OAuth
client_credentials: fully automated, no human neededdevice_code: agent-compatible — agent runsearl auth login <profile>, displays URL+code, user visits URL on any device, agent polls for completionauth_code_pkce: human-only — agent providesearl auth login <profile>command, user completes browser flow
Phase 4: Route
Ask one question:
"Does this project already have curl, gh, stripe-cli, or similar API/CLI calls you want to replace with Earl? Or are you starting fresh and want to create a new template?"
- Migrate existing calls → invoke
migrate-to-earl - Create new template → invoke
create-template
Phase 5: Lock Down (Recommended)
After templates are created and verified, offer:
"Would you like to restrict your agent from bypassing Earl with raw curl/gh/CLI tools? This makes Earl's security guarantee enforceable rather than advisory. Recommended."
If yes: invoke secure-agent inline.
If no: note that secure-agent can be run at any time later.
Next Steps
- To replace existing curl/gh/CLI calls with Earl: invoke
migrate-to-earl - To create a new Earl template from scratch: invoke
create-template - To enforce Earl usage at the platform level: invoke
secure-agent - If something isn't working: invoke
troubleshoot-earl
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
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.

