{
  "id": "gemini-cli",
  "family": "Google",
  "title": "Gemini CLI",
  "auth_method": "pat_swap",
  "origin": "local",
  "token_step": "PAT swap: export the JWT before starting Gemini CLI; settings.json reads it from the environment. OAuth later.",
  "availability": {
    "status": "available",
    "line": null
  },
  "environment": "production",
  "verified": false,
  "badge": "Beta",
  "version": null,
  "released_at": null,
  "summary": "Gemini CLI settings.json HTTP MCP server with the Bearer header taken from the environment.",
  "client": "Gemini CLI",
  "html": "https://agents.a24labs.net/recipes/gemini-cli/",
  "json": "https://agents.a24labs.net/recipes/gemini-cli/recipe.json",
  "endpoints": {
    "hub": "https://agents.a24labs.net",
    "mcp": "https://edge.a24labs.net/mcp",
    "prm": "https://edge.a24labs.net/.well-known/oauth-protected-resource",
    "as_metadata": "https://id.a24labs.net/realms/a24labs/.well-known/openid-configuration",
    "auth_discovery": "https://edge.a24labs.net/discovery/v1/authentication",
    "bootstrap": "https://edge.a24labs.net/.well-known/awp-eeg",
    "token_endpoint": "https://frontdoor.a24labs.net/v1/oauth/token",
    "idp": "https://id.a24labs.net/realms/a24labs"
  },
  "steps": [
    {
      "title": "Get a PAT",
      "body": "Ask your operator for an AWP PAT, then exchange it at the token endpoint for a Bearer JWT. Save it to `~/.config/awp/edge.pat` with mode 600. Never paste it into chat or commit it."
    },
    {
      "title": "Install the token script",
      "body": "Save as `~/.config/awp/awp-edge-token.sh` (chmod 700). It prints a Bearer JWT valid for 15 minutes."
    },
    {
      "title": "Configure Gemini CLI",
      "body": "Add the config below."
    },
    {
      "title": "Load the token",
      "body": "Gemini CLI resolves $AWP_EDGE_JWT when it loads settings.json. Re-export and restart after 15 minutes."
    },
    {
      "title": "Get your twin connected",
      "body": "Paste the prompts below into the agent, in order."
    }
  ],
  "config": [
    {
      "title": "Gemini settings",
      "path": "~/.gemini/settings.json",
      "lang": "json",
      "body": "{\n \"mcpServers\": {\n \"awp-edge\": {\n \"httpUrl\": \"https://edge.a24labs.net/mcp\",\n \"headers\": { \"Authorization\": \"Bearer $AWP_EDGE_JWT\" }\n }\n }\n}"
    },
    {
      "title": "Start Gemini with a fresh token",
      "path": "shell",
      "lang": "bash",
      "body": "export AWP_EDGE_JWT=\"$(~/.config/awp/awp-edge-token.sh)\"\ngemini"
    }
  ],
  "token_script": "#!/bin/bash\n# awp-edge-token.sh — exchange an AWP PAT for a 15-minute Edge JWT. Prints the JWT only.\n# The PAT is read from a mode-600 file and sent on stdin, so it never appears in argv or history.\nset -euo pipefail\nPAT_FILE=\"${AWP_PAT_FILE:-$HOME/.config/awp/edge.pat}\"\nprintf '{\"grant_type\":\"urn:awp:params:oauth:grant-type:pat\",\"secret\":\"%s\"}' \"$(cat \"$PAT_FILE\")\" |\n  curl -sS --fail-with-body -X POST \"https://frontdoor.a24labs.net/v1/oauth/token\" \\\n    -H 'content-type: application/json' --data-binary @- |\n  python3 -c 'import json,sys; print(json.load(sys.stdin)[\"access_token\"])'",
  "token_response_example": "{\n  \"access_token\": \"<JWT>\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 900,\n  \"scope\": \"...\"\n}",
  "prompts": [
    {
      "prompt": "List the tools the awp-edge MCP server exposes.",
      "expect": "5 tools on this Edge (fewer if your PAT lacks a capability)."
    },
    {
      "tool": "discovery",
      "prompt": "Call the awp-edge tool discovery with limit 5 and list the resource ids it returns.",
      "expect": "Up to five resources labelled STORE (evidence.source=awp-store)."
    },
    {
      "tool": "workspace_search",
      "prompt": "Call workspace_search with query \"agents hub\" and limit 5.",
      "expect": "Up to five STORE results."
    },
    {
      "tool": "project_query",
      "prompt": "Call project_query with {\"id\": \"<project-id>\"}. Use id only; free-text query is unsupported.",
      "expect": "One project, or a clear bad-args error if you pass query."
    }
  ],
  "oauth": {
    "note": "For clients that support OAuth sign-in instead of a static header.",
    "authorization_server": "https://id.a24labs.net/realms/a24labs",
    "client_id": "awp-edge-mcp-oauth",
    "pkce": "S256"
  }
}
