### Verify Earl Installation and Run Demo (Bash/Shell) Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md Verifies the Earl installation using `earl doctor`. It then imports a system template if not already present and runs a demo command to list files in the current directory. Finally, it shows how to list available templates. ```bash earl doctor ``` ```bash earl templates list | grep -E "^system\." || earl templates import https://raw.githubusercontent.com/brwse/earl/main/examples/bash/system.hcl ``` ```bash earl call --yes --json system.list_files --path . ``` ```bash earl templates list ``` -------------------------------- ### Earl CLI Command Usage Example Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md Demonstrates the correct and incorrect order of flags for the `earl call` command. The `--yes` flag must precede the command name for automated execution. ```bash earl call --yes --json provider.command --param value ✓ earl call provider.command --yes --json --param value ✗ (wrong order) ``` -------------------------------- ### Install Earl CLI (PowerShell) Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md Installs Earl on Windows using PowerShell. This command downloads and executes the installation script. ```powershell irm https://raw.githubusercontent.com/brwse/earl/main/scripts/install.ps1 | iex ``` -------------------------------- ### Setup x86_64-linux-musl Cross-Compilation Toolchain (Shell) Source: https://github.com/brwse/earl/blob/main/CROSSCOMPILE.md This shell command demonstrates the setup for x86_64-linux-musl cross-compilation. It involves installing the 'musl-tools' package, which provides the 'musl-gcc' compiler needed for static musl binaries. ```bash # Install musl-tools which provides musl-gcc # No specific environment variables are shown here, assuming musl-gcc is in PATH ``` -------------------------------- ### Install Earl with Specific Protocols (HTTP, GraphQL, gRPC) Source: https://github.com/brwse/earl/blob/main/site/content/docs/troubleshooting.mdx This command installs the Earl binary with support for HTTP, GraphQL, and gRPC protocols. This is a common configuration for services interacting over these protocols. ```bash cargo install earl --features "http,graphql,grpc" ``` -------------------------------- ### Check and Install Earl CLI (Bash/Shell) Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md Checks if Earl is installed and its version. If not installed, it provides commands to install Earl on macOS/Linux using Cargo or a fallback script, and on Windows using PowerShell. Requires Rust toolchain and Node.js + pnpm for Cargo install. ```bash which earl && earl --version ``` ```bash cargo install earl ``` ```bash curl -fsSL https://raw.githubusercontent.com/brwse/earl/main/scripts/install.sh | bash ``` -------------------------------- ### Full Earl Configuration Example (TOML) Source: https://github.com/brwse/earl/blob/main/site/content/docs/configuration.mdx A comprehensive example of the `config.toml` file, demonstrating configurations for environments, network access, OAuth profiles, sandbox limits, and search settings. This serves as a template for users to adapt. ```toml # --- Environments --- [environments] default = "staging" # --- Network --- [[network.allow]] scheme = "https" host = "api.github.com" port = 443 path_prefix = "/" [network.proxy_profiles.corp] url = "https://proxy.corp.example.com:8080" # --- Auth --- [auth.profiles.github] flow = "device_code" client_id = "your-client-id" token_url = "https://github.com/login/oauth/access_token" device_authorization_url = "https://github.com/login/device/code" scopes = ["repo", "read:org"] # --- Sandbox --- [sandbox] bash_max_time_ms = 30000 bash_max_output_bytes = 1048576 bash_allow_network = false sql_force_read_only = true sql_max_rows = 1000 sql_connection_allowlist = ["myapp.db_url"] # --- Search --- [search] top_k = 40 rerank_k = 10 [search.local] embedding_model = "BGESmallENV15Q" reranker_model = "JINARerankerV1TurboEn" [search.remote] enabled = true base_url = "https://search.example.com" api_key_secret = "search.api_key" embeddings_path = "/embeddings" rerank_path = "/rerank" openai_compatible = true timeout_ms = 10000 ``` -------------------------------- ### Create Bot and Record Meeting with Recall.ai Source: https://github.com/brwse/earl/blob/main/skills/3p/recall_ai/SKILL.md This recipe demonstrates the asynchronous process of creating a bot, starting a recording, and retrieving a transcript from a meeting using Recall.ai. It emphasizes the importance of polling for status updates between steps to ensure data integrity and avoid errors. The process involves creating the bot, waiting for it to join, starting the recording, leaving the call, and then polling for the transcript to become available before downloading it. ```bash # 1. Create the bot (schedule 10+ minutes ahead for reliability) earl call --yes --json recall_ai.create_bot \ --meeting_url "https://zoom.us/j/123456789" \ --bot_name "Notetaker" \ --join_at "2026-02-23T15:00:00Z" # → SAVE the returned id as bot_id # 2. Poll until the bot has joined (repeat every 10–15s) earl call --yes --json recall_ai.get_bot --bot_id # → Wait until status == "joined" # 3. Start recording earl call --yes --json recall_ai.start_recording --bot_id # 4. (Meeting runs — poll every 30s if you need to monitor) earl call --yes --json recall_ai.get_bot --bot_id # 5. When the meeting ends, leave the call earl call --yes --json recall_ai.leave_call --bot_id # 6. Poll until transcript is ready (repeat every 15s) earl call --yes --json recall_ai.get_bot --bot_id # → Wait until media_shortcuts.transcript.status.code == "done" # → Read media_shortcuts.transcript.id from the response # 7. Get transcript metadata (includes download URL) earl call --yes --json recall_ai.get_transcript --transcript_id # → Read data.download_url from the response # 8. Download full transcript text earl call --yes --json recall_ai.download_transcript --url "" # → Returns speaker-attributed transcript text — summarize, extract action items, etc. ``` -------------------------------- ### HTTP - Search GitHub Issues Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx This example demonstrates how to search for GitHub issues using a query string via a standard HTTP GET request. ```APIDOC ## GET /search/issues ### Description Search for GitHub issues and pull requests using a query string. ### Method GET ### Endpoint https://api.github.com/search/issues ### Parameters #### Query Parameters - **query** (string) - Required - The search query string. - **per_page** (integer) - Optional - The number of results per page. Defaults to 10. ### Request Example ```hcl version = 1 provider = "github" categories = ["scm"] command "search_issues" { title = "Search Issues" summary = "Search GitHub issues using a query string" description = "Search for GitHub issues and pull requests." annotations { mode = "read" secrets = ["github.token"] } param "query" { type = "string" required = true } param "per_page" { type = "integer" default = 10 } operation { protocol = "http" method = "GET" url = "https://api.github.com/search/issues" headers = { Accept = "application/vnd.github+json" } query = { q = "{{ args.query }}" per_page = "{{ args.per_page }}" } auth { kind = "bearer" secret = "github.token" } } result { decode = "json" extract { json_pointer = "/items" } output = "Found {{ result | length }} issues" } } ``` ### Response #### Success Response (200) - **items** (array) - A list of issues matching the query. #### Response Example ```json { "items": [ { "title": "Example Issue", "html_url": "https://github.com/owner/repo/issues/1" } ] } ``` ``` -------------------------------- ### Setup aarch64-linux-gnu Cross-Compilation Toolchain (Shell) Source: https://github.com/brwse/earl/blob/main/CROSSCOMPILE.md This shell command demonstrates how to set up the toolchain for aarch64-linux-gnu cross-compilation. It involves installing the necessary GCC cross-compiler and configuring Cargo to use it for linking and compilation. ```bash # Install gcc-aarch64-linux-gnu and set environment variables export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc ``` -------------------------------- ### Bash - Disk Usage Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx This example demonstrates how to check disk usage for a given path using a bash script in a sandboxed environment. ```APIDOC ## Bash Script - Disk Usage ### Description Reports disk usage for a given path by running `du -sh` in a sandboxed bash environment. ### Method N/A (This is a bash script execution) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```hcl version = 1 provider = "system" categories = ["system", "bash"] command "disk_usage" { title = "Check disk usage" summary = "Reports disk usage for a given path" description = "Runs du -sh in a sandboxed bash environment." annotations { mode = "read" secrets = [] } param "path" { type = "string" required = true description = "Filesystem path to check" } operation { protocol = "bash" bash { script = "du -sh {{ args.path }}" sandbox { network = false } } } result { decode = "text" output = "{{ result }}" } } ``` ### Response #### Success Response (200) - **output** (string) - The output of the `du -sh` command. #### Response Example ```text 4.0K /path/to/directory ``` ``` -------------------------------- ### Invoke Troubleshoot Earl Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md This command should be invoked if the user encounters any issues with Earl's functionality or configuration. ```bash troubleshoot-earl ``` -------------------------------- ### Managing Earl Templates Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx Provides examples of commands for listing, searching, and validating Earl templates. It covers filtering options for listing and how to perform semantic searches. ```bash earl templates list # List all commands earl templates list --mode read # Filter by mode earl templates list --category scm # Filter by category earl templates list --json # JSON output ``` ```bash earl templates search "find open PRs" # Search with natural language earl templates search "database query" --limit 5 ``` ```bash earl templates validate # Validate all template files ``` -------------------------------- ### GraphQL - Get User Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx This example shows how to fetch a user by their ID using a GraphQL query over HTTP POST. ```APIDOC ## POST /graphql ### Description Fetch a user by ID via GraphQL. Queries the GraphQL API for a user by their ID. ### Method POST ### Endpoint https://api.example.com/graphql ### Parameters #### Query Parameters None #### Request Body None (GraphQL query is sent in the request body) ### Request Example ```hcl version = 1 provider = "myapi" categories = ["api"] command "get_user" { title = "Get User" summary = "Fetch a user by ID via GraphQL" description = "Queries the GraphQL API for a user by their ID." annotations { mode = "read" secrets = ["myapi.token"] } param "user_id" { type = "string" required = true } operation { protocol = "graphql" url = "https://api.example.com/graphql" auth { kind = "bearer" secret = "myapi.token" } graphql { query = "query User($id: ID!) { user(id: $id) { login email } }" operation_name = "User" variables = { id = "{{ args.user_id }}" } } } result { decode = "json" output = "{{ result }}" } } ``` ### Response #### Success Response (200) - **data** (object) - The result of the GraphQL query. #### Response Example ```json { "data": { "user": { "login": "exampleuser", "email": "user@example.com" } } } ``` ``` -------------------------------- ### SQL - Recent Orders Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx This example demonstrates how to fetch recent orders from a database using a parameterized SQL query. ```APIDOC ## SQL Query - Recent Orders ### Description Fetches recent orders from the database by running a read-only SQL query. ### Method N/A (This is an SQL query execution) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```hcl version = 1 provider = "analytics" categories = ["analytics", "sql"] command "recent_orders" { title = "Recent orders" summary = "Fetches recent orders from the database" description = "Runs a read-only SQL query to fetch recent orders." annotations { mode = "read" secrets = ["analytics.database_url"] } param "limit" { type = "integer" default = 10 } operation { protocol = "sql" sql { connection_secret = "analytics.database_url" query = "SELECT id, customer, total FROM orders ORDER BY created_at DESC LIMIT ?" params = ["{{ args.limit }}"] sandbox { } } } result { decode = "json" output = "{{ result }}" } } ``` ### Response #### Success Response (200) - **rows** (array) - A list of order records. #### Response Example ```json [ { "id": 1, "customer": "John Doe", "total": 100.50 } ] ``` ``` -------------------------------- ### Install Earl with Specific Protocols (Bash) Source: https://github.com/brwse/earl/blob/main/site/content/docs/troubleshooting.mdx This command installs the Earl binary with the 'bash' protocol feature enabled. This is useful if you only need bash scripting capabilities and want a smaller binary or to avoid compiling other protocols. ```bash cargo install earl --features bash ``` -------------------------------- ### Install Earl CLI Source: https://github.com/brwse/earl/blob/main/README.md Provides instructions for installing the Earl CLI tool. It can be installed using a curl script to download and execute an installation script, or directly via Cargo if the Rust toolchain is available. ```bash curl -fsSL https://raw.githubusercontent.com/brwse/earl/main/scripts/install.sh | bash # or: cargo install earl ``` -------------------------------- ### Install Earl using Cargo Source: https://github.com/brwse/earl/blob/main/skills/troubleshoot-earl/SKILL.md Installs the Earl tool using the Cargo package manager. This command requires the Rust toolchain, Node.js, and pnpm to be installed. Alternatively, installation scripts for shell and PowerShell are provided. ```bash cargo install earl # requires Rust toolchain + Node.js + pnpm # or: curl -fsSL https://raw.githubusercontent.com/brwse/earl/main/scripts/install.sh | bash # Windows: irm https://raw.githubusercontent.com/brwse/earl/main/scripts/install.ps1 | iex ``` -------------------------------- ### Invoke Create Earl Template Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md This command is invoked when the user wants to create a new Earl template from scratch, rather than migrating existing calls. ```bash create-template ``` -------------------------------- ### HTTP Request Example - Earl Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx Defines a standard HTTP GET request to search GitHub issues. It includes parameters for the query string and pagination, headers, and bearer authentication. The result is decoded as JSON and extracts the 'items' array. ```hcl version = 1 provider = "github" categories = ["scm"] command "search_issues" { title = "Search Issues" summary = "Search GitHub issues using a query string" description = "Search for GitHub issues and pull requests." annotations { mode = "read" secrets = ["github.token"] } param "query" { type = "string" required = true } param "per_page" { type = "integer" default = 10 } operation { protocol = "http" method = "GET" url = "https://api.github.com/search/issues" headers = { Accept = "application/vnd.github+json" } query = { q = "{{ args.query }}" per_page = "{{ args.per_page }}" } auth { kind = "bearer" secret = "github.token" } } result { decode = "json" extract { json_pointer = "/items" } output = "Found {{ result | length }} issues" } } ``` -------------------------------- ### Install Bubblewrap for macOS Sandbox Source: https://github.com/brwse/earl/blob/main/site/content/docs/troubleshooting.mdx While macOS uses the deprecated `sandbox-exec` for Bash sandboxing, you can install `bubblewrap` via Homebrew for stronger isolation. This is recommended if you require more robust sandboxing capabilities. ```bash brew install bubblewrap ``` -------------------------------- ### Install Bubblewrap for Linux Sandbox Source: https://github.com/brwse/earl/blob/main/site/content/docs/troubleshooting.mdx The Bash protocol on Linux uses `bwrap` (bubblewrap) for sandboxing. Install it using your system's package manager if it's not already present. `earl doctor` checks for its availability. ```bash # Debian / Ubuntu sudo apt install bubblewrap # Fedora sudo dnf install bubblewrap # Arch sudo pacman -S bubblewrap ``` -------------------------------- ### Execute Earl CLI Commands Source: https://github.com/brwse/earl/blob/main/site/content/docs/how-earl-works.mdx Demonstrates how to execute Earl CLI commands, including a valid call that matches a predefined template and an example of an impossible raw request. This highlights Earl's template-driven access control. ```bash # This works -- matches the github.search_issues template earl call github.search_issues --query "is:issue" --per_page 5 # There is no "raw request" command -- arbitrary URLs are impossible ``` -------------------------------- ### Install Earl with External Secret Manager Features (Bash) Source: https://github.com/brwse/earl/blob/main/site/content/docs/external-secrets.mdx Shows how to install the Earl CLI from source using Cargo, enabling specific external secret manager integrations via feature flags. Multiple features can be combined in a single installation command. ```bash cargo install earl --features secrets-1password # 1Password Connect cargo install earl --features secrets-vault # HashiCorp Vault cargo install earl --features secrets-aws # AWS Secrets Manager cargo install earl --features secrets-gcp # GCP Secret Manager cargo install earl --features secrets-azure # Azure Key Vault ``` ```bash cargo install earl --features secrets-1password,secrets-vault ``` -------------------------------- ### Calling Earl Commands Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx Illustrates how to execute API commands defined in Earl templates using the `earl call` command. It includes examples of passing parameters, using boolean flags, and obtaining JSON output. ```bash earl call github.search_issues --query "is:open label:bug" --per_page 5 ``` ```bash earl call github.create_issue --title "Bug report" --yes ``` ```bash earl call github.search_issues --query "test" --json ``` -------------------------------- ### Bash Multi-line Script Example - HCL Source: https://github.com/brwse/earl/blob/main/skills/references/bash-templates.md Demonstrates using HCL heredoc syntax for multi-line Bash scripts within an Earl template. This example executes multiple commands: `echo`, `uname -a`, `df -h`, and `free -m` or `vm_stat`. ```hcl bash { script = <<-EOT echo "Checking system info..." uname -a df -h free -m 2>/dev/null || vm_stat EOT } ``` -------------------------------- ### Start Earl as MCP Server (stdio) Source: https://github.com/brwse/earl/blob/main/skills/references/mcp-integration.md Initiates Earl as an MCP server using standard input/output. This is the default mode where each template becomes a separate MCP tool, suitable for smaller catalogs. ```bash earl mcp stdio ``` -------------------------------- ### Configure Per-Template SQL Sandboxing Source: https://github.com/brwse/earl/blob/main/site/content/docs/hardening.mdx Allows individual SQL templates to declare their own sandbox limits, including read-only mode and maximum rows. These settings are applied in addition to global sandbox configurations. ```hcl sandbox { read_only = true max_rows = 100 } ``` -------------------------------- ### Earl Authentication Methods Source: https://context7.com/brwse/earl/llms.txt HCL examples demonstrating various authentication strategies supported by Earl templates, including bearer tokens, API keys, basic auth, and OAuth2 profiles. ```hcl # Bearer token auth { kind = "bearer" secret = "github.token" } # API key (header, query, or cookie) auth { kind = "api_key" location = "header" name = "X-API-Key" secret = "stripe.api_key" } # Basic auth auth { kind = "basic" username = "deploy" password_secret = "registry.password" } # OAuth2 profile (auto-refreshing tokens) auth { kind = "oauth2_profile" profile = "github" } ``` -------------------------------- ### Configure Earl Write-Mode Behavior Source: https://github.com/brwse/earl/blob/main/site/content/docs/hardening.mdx Manages how templates marked for 'write' mode are handled. By default, they require explicit user confirmation or are blocked. This can be overridden with the `--yes` flag to allow write-mode tools. ```bash # Write-mode tools blocked (default — safe starting point) earl mcp stdio --mode full # Write-mode tools allowed earl mcp stdio --mode full --yes ``` -------------------------------- ### Invoke Third-Party Recall.ai Skill Source: https://github.com/brwse/earl/blob/main/site/content/docs/agent-skills.mdx This example shows how to invoke a third-party skill for the Recall.ai service using Earl. The agent fetches the skill from a GitHub URL and follows its instructions to record video meetings and retrieve transcripts. ```text Fetch https://raw.githubusercontent.com/brwse/earl/main/skills/3p/recall_ai/SKILL.md then follow the skill to help me record a meeting and get the transcript. ``` -------------------------------- ### Launch Earl Web Playground Source: https://github.com/brwse/earl/blob/main/site/content/docs/quick-start.mdx This command starts a local web-based UI for the Earl project. The web playground allows users to browse and test commands through a graphical interface, which is useful for initial orientation with new template catalogs. It automatically opens in the browser and provides a session token. ```bash earl web ``` -------------------------------- ### Run Earl Doctor for Verification Source: https://github.com/brwse/earl/blob/main/site/content/docs/hardening.mdx Executes the `earl doctor` command to verify the Earl setup. It checks configuration loading, template parsing, and the presence of required secrets, helping to identify common setup mistakes before connecting agents. ```bash earl doctor ``` -------------------------------- ### Basic Policy Configuration Example Source: https://github.com/brwse/earl/blob/main/site/content/docs/policy-engine.mdx A simple TOML configuration showing two policy entries. The first allows specific subjects to use a broad set of GitHub tools. The second denies all subjects from using a specific GitHub tool in write mode, demonstrating the deny-overrides behavior. ```toml [[policy]] subjects = ["user:alice", "group:admins"] tools = ["github.*"] effect = "allow" [[policy]] subjects = ["*"] tools = ["github.delete_repo"] modes = ["write"] effect = "deny" ``` -------------------------------- ### Configure Earl Binary Path in Claude Code Settings Source: https://github.com/brwse/earl/blob/main/site/content/docs/mcp.mdx Specifies the full path to the Earl binary in Claude Code's settings. This is useful when the `earl` command is not found in the agent's default PATH, for example, when installed via `cargo install`. ```json { "mcpServers": { "earl": { "command": "/Users/yourname/.cargo/bin/earl", "args": ["mcp", "stdio", "--mode", "full", "--yes"] } } } ``` -------------------------------- ### Earl MCP Discovery Mode Example Source: https://github.com/brwse/earl/blob/main/site/content/docs/mcp.mdx This command runs the Earl MCP server in 'discovery' mode using standard input/output. This mode exposes two meta-tools (`earl.tool_search` and `earl.tool_call`) regardless of the catalog size, making it efficient for large template collections by reducing context window usage at the cost of an extra round-trip per operation. ```bash earl mcp stdio --mode discovery ``` -------------------------------- ### Invoke Earl Skill Source: https://github.com/brwse/earl/blob/main/site/content/docs/agent-skills.mdx This example demonstrates how to instruct an AI agent to fetch and execute a skill file for Earl. The agent will download the specified skill markdown file and any referenced files, then follow the instructions within the skill to perform a task, such as setting up Earl. ```text Fetch https://raw.githubusercontent.com/brwse/earl/main/skills/setup-earl/SKILL.md and any files it references under https://raw.githubusercontent.com/brwse/earl/main/skills/references/ then follow the skill to help me get started with Earl. ``` -------------------------------- ### Launch Earl Web Playground Source: https://context7.com/brwse/earl/llms.txt How to launch the local web UI for browsing and testing Earl templates using `earl web`. Options include using a random port with automatic browser opening or a fixed port without opening the browser. ```bash # Default: random port, opens browser earl web # Fixed port, no browser earl web --listen 127.0.0.1:3000 --no-open ``` -------------------------------- ### Configure MCP for Claude Desktop Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md For Claude Desktop, the config file is external. This process involves writing the merged JSON to a temporary file, showing the diff to the user, and instructing manual application. Direct writing to the home directory is possible if agent has permissions. ```bash # Example of writing to a temp file and showing diff (conceptual) mcp_config_path="/path/to/external/config.json" temp_config=$(mktemp) # Read existing config, merge earl entry, write to temp_config # ... (JSON manipulation logic here) ... diff -u "$mcp_config_path" "$temp_config" # Instruct user to apply manually or write directly if permissions allow # echo "Please apply the changes shown above manually." ``` -------------------------------- ### Install LLVM Tools for Windows Cross-Compilation (Shell) Source: https://github.com/brwse/earl/blob/main/CROSSCOMPILE.md This shell command installs the LLVM tools, specifically the 'llvm-lib' archiver, required by 'cargo-xwin' for linking during Windows x86_64 cross-compilation on a Linux CI runner. ```bash sudo apt-get install -y llvm ``` -------------------------------- ### Install Earl PowerShell Shell Completion Source: https://github.com/brwse/earl/blob/main/site/content/docs/commands.mdx Installs Earl shell completions for PowerShell by appending the output of `earl completion powershell` to the user's PowerShell profile. This enables tab completion for Earl commands in PowerShell. ```powershell earl completion powershell >> $PROFILE ``` -------------------------------- ### Install Earl Fish Shell Completion Source: https://github.com/brwse/earl/blob/main/site/content/docs/commands.mdx Installs Earl shell completions for the Fish shell by redirecting the output of `earl completion fish` to the appropriate Fish completions directory. This enables tab completion for Earl commands in Fish. ```bash earl completion fish > ~/.config/fish/completions/earl.fish ``` -------------------------------- ### Importing Earl Templates Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx Demonstrates how to import Earl templates from local file paths or remote URLs. It also shows how to specify the import scope (local or global) and how Earl handles required secrets. ```bash earl templates import https://raw.githubusercontent.com/brwse/earl/main/examples/stripe.hcl earl secrets set stripe.api_key earl call stripe.list_customers ``` ```bash earl templates import ./my-template.hcl earl templates import /opt/templates/github.hcl ``` ```bash earl templates import https://example.com/templates/github.hcl ``` ```bash earl templates import ./github.hcl --scope global ``` -------------------------------- ### Earl MCP Full Mode Example Source: https://github.com/brwse/earl/blob/main/site/content/docs/mcp.mdx This command runs the Earl MCP server in 'full' mode using standard input/output. In this mode, every Earl template is exposed as a distinct MCP tool, allowing the AI agent to directly select and call any template. This is suitable for smaller template catalogs. ```bash earl mcp stdio --mode full ``` -------------------------------- ### Define HTTP GET Request with Query Parameters Source: https://github.com/brwse/earl/blob/main/skills/references/http-templates.md This HCL snippet defines a command to fetch items from an API using an HTTP GET request. It includes parameters for a search query and a limit, and specifies how to authenticate using a bearer token. The result is decoded as JSON. ```hcl version = 1 provider = "myapi" command "get_items" { title = "Get Items" summary = "Fetch items from the API" description = "Retrieves a list of items with optional filtering" annotations { mode = "read" secrets = ["myapi.token"] } param "query" { type = "string" required = true description = "Search query" } param "limit" { type = "integer" required = false description = "Max results to return" default = 10 } operation { protocol = "http" method = "GET" url = "https://api.example.com/items" query = { q = "{{ args.query }}" limit = "{{ args.limit }}" } headers = { Accept = "application/json" } auth { kind = "bearer" secret = "myapi.token" } } result { decode = "json" output = "Found {{ result | length }} items" } } ``` -------------------------------- ### Execute Earl Template Commands Source: https://context7.com/brwse/earl/llms.txt Demonstrates how to execute template commands using `earl call`. Covers basic read operations, JSON output for scripting, write operations with confirmation, and environment selection. ```bash # Basic read operation earl call github.search_repos --query "language:rust stars:>1000" # Read operation with JSON output for scripting earl call stripe.list_charges --limit 10 --json | jq '.result' # Write operation with auto-approval earl call github.create_issue --repo "myorg/myrepo" --title "Bug report" --yes # With environment selection earl call myservice.ping --env staging ``` -------------------------------- ### Configure MCP for Claude Code, Cursor, Windsurf Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md Reads, parses, and updates the MCP config file by adding the 'earl' key under 'mcpServers'. Creates the file if it doesn't exist and avoids overwriting existing entries. This is for agents like Claude Code, Cursor, and Windsurf. ```json { "mcpServers": { "earl": { "url": "http://localhost:8000", "command": "earl" } } } ``` -------------------------------- ### gRPC - Health Check Source: https://github.com/brwse/earl/blob/main/site/content/docs/templates.mdx This example shows how to perform a health check on a gRPC service. ```APIDOC ## POST /grpc.health.v1.Health/Check ### Description Check the health of a gRPC service. Calls the gRPC health check endpoint. ### Method POST ### Endpoint http://127.0.0.1:50051 ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **service** (string) - Optional - The name of the service to check. Defaults to empty string. ### Request Example ```hcl version = 1 provider = "health" categories = ["infrastructure"] command "check" { title = "Health Check" summary = "Check gRPC service health" description = "Calls the gRPC health check endpoint." annotations { mode = "read" secrets = ["service.token"] } operation { protocol = "grpc" url = "http://127.0.0.1:50051" headers = { x-trace-id = "{{ args.trace_id }}" } auth { kind = "bearer" secret = "service.token" } grpc { service = "grpc.health.v1.Health" method = "Check" body = { service = "" } } } param "trace_id" { type = "string" default = "" } result { decode = "json" output = "{{ result }}" } } ``` ### Response #### Success Response (200) - **status** (enum) - The health status of the service (e.g., `SERVING`, `NOT_SERVING`, `UNKNOWN`). #### Response Example ```json { "status": "SERVING" } ``` ``` -------------------------------- ### Activate Environment with CLI Flag and Configure Default Source: https://github.com/brwse/earl/blob/main/site/content/docs/environments.mdx Demonstrates how to activate a specific environment for a single command using the `--env` flag and how to set a persistent default environment in the `config.toml` file. ```bash # Activate staging just for this call earl call myservice.ping --env staging # Set a persistent default in config.toml # [environments] # default = "staging" ``` -------------------------------- ### Retrieve Video or Audio Recording with Recall.ai Source: https://github.com/brwse/earl/blob/main/skills/3p/recall_ai/SKILL.md This recipe outlines how to retrieve video and audio recordings from a meeting using Recall.ai. It involves first checking the status of the media artifacts using `get_bot` and polling if necessary. Once the artifacts are ready, you can obtain their download URLs using `get_video` and `get_audio`. The download URLs are temporary and should be presented to the user as clickable links. ```bash # 1. Get bot to find media IDs and confirm artifacts are ready earl call --yes --json recall_ai.get_bot --bot_id # → Read media_shortcuts.video_mixed.id and media_shortcuts.audio_mixed.id # → If media_shortcuts.video_mixed.status.code != "done", poll every 15s until it is # 2. Get video download URL earl call --yes --json recall_ai.get_video --video_id # → Returns data.download_url — share this link with the user (expires in ~5 hours) # 3. Get audio download URL earl call --yes --json recall_ai.get_audio --audio_id # → Returns data.download_url — share this link with the user (expires in ~5 hours) ``` -------------------------------- ### List Available Earl Templates Source: https://github.com/brwse/earl/blob/main/skills/create-template/SKILL.md Lists all pre-built provider templates available for import into Earl. This command helps determine if a specific service or provider is already supported. ```bash earl templates list ``` -------------------------------- ### Get Secret Metadata - Bash Source: https://github.com/brwse/earl/blob/main/site/content/docs/secrets-and-auth.mdx Retrieves metadata (key name, timestamps) for a specific secret. If the key does not exist, Earl will exit with an error. ```bash earl secrets get ``` -------------------------------- ### Configure Earl JWT Authentication Source: https://github.com/brwse/earl/blob/main/site/content/docs/hardening.mdx Sets up JWT authentication for Earl by specifying the audience and the OIDC discovery URL in the TOML configuration file. ```toml [auth.jwt] audience = "https://api.example.com" oidc_discovery_url = "https://accounts.example.com/.well-known/openid-configuration" ``` -------------------------------- ### Configure 1Password Connect Host and Token (Bash) Source: https://github.com/brwse/earl/blob/main/site/content/docs/external-secrets.mdx Provides an example of setting environment variables required for Earl to authenticate with a 1Password Connect server. These variables specify the server's host and the authentication token. ```bash export OP_CONNECT_HOST="https://op.internal.example.com" export OP_CONNECT_TOKEN="eyJhbGciOiJFUzI1NiIsImtpZCI6..." ``` -------------------------------- ### Invoke Migrate to Earl Source: https://github.com/brwse/earl/blob/main/skills/setup-earl/SKILL.md This command is invoked when the user indicates they want to migrate existing curl, gh, stripe-cli, or similar API/CLI calls to use Earl. ```bash migrate-to-earl ``` -------------------------------- ### Import Pre-built Earl Template Source: https://github.com/brwse/earl/blob/main/skills/create-template/SKILL.md Imports a pre-built Earl HCL template for a specified provider from a GitHub URL. Replace '' with the actual provider name (e.g., github, stripe). ```bash # Available: github, stripe, slack, notion, openai, anthropic, recall_ai, discord, gitlab, jira, linear, # pagerduty, twilio, sendgrid, cloudflare, vercel, render, shopify, hubspot, # mailchimp, datadog, sentry, airtable, auth0, supabase, resend earl templates import https://raw.githubusercontent.com/brwse/earl/main/examples/.hcl ```